diff options
| author | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:34 +0100 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:34 +0100 |
| commit | 07633a66e8c9bbb2b288a286bfbea6f562eeca4d (patch) | |
| tree | a255efa70ed6f202542649148c0445445504d181 /phpBB | |
| parent | ee82970d96e0a6772b24c48aab8ebd1888ec5216 (diff) | |
| parent | 5cfa0ec0c32ddc424f9651d8766db3e4ced59f96 (diff) | |
| download | forums-07633a66e8c9bbb2b288a286bfbea6f562eeca4d.tar forums-07633a66e8c9bbb2b288a286bfbea6f562eeca4d.tar.gz forums-07633a66e8c9bbb2b288a286bfbea6f562eeca4d.tar.bz2 forums-07633a66e8c9bbb2b288a286bfbea6f562eeca4d.tar.xz forums-07633a66e8c9bbb2b288a286bfbea6f562eeca4d.zip | |
Merge commit 'release-3.0-B3'
Diffstat (limited to 'phpBB')
325 files changed, 19102 insertions, 13188 deletions
diff --git a/phpBB/adm/images/file_conflict.gif b/phpBB/adm/images/file_conflict.gif Binary files differnew file mode 100644 index 0000000000..8b42730474 --- /dev/null +++ b/phpBB/adm/images/file_conflict.gif diff --git a/phpBB/adm/images/file_modified.gif b/phpBB/adm/images/file_modified.gif Binary files differnew file mode 100644 index 0000000000..4728cb3d50 --- /dev/null +++ b/phpBB/adm/images/file_modified.gif diff --git a/phpBB/adm/images/file_new.gif b/phpBB/adm/images/file_new.gif Binary files differnew file mode 100644 index 0000000000..1d6e15b59d --- /dev/null +++ b/phpBB/adm/images/file_new.gif diff --git a/phpBB/adm/images/file_new_conflict.gif b/phpBB/adm/images/file_new_conflict.gif Binary files differnew file mode 100644 index 0000000000..83fc598393 --- /dev/null +++ b/phpBB/adm/images/file_new_conflict.gif diff --git a/phpBB/adm/images/file_not_modified.gif b/phpBB/adm/images/file_not_modified.gif Binary files differnew file mode 100644 index 0000000000..98ed26db32 --- /dev/null +++ b/phpBB/adm/images/file_not_modified.gif diff --git a/phpBB/adm/images/file_up_to_date.gif b/phpBB/adm/images/file_up_to_date.gif Binary files differnew file mode 100644 index 0000000000..aff41a15c2 --- /dev/null +++ b/phpBB/adm/images/file_up_to_date.gif diff --git a/phpBB/adm/images/icon_delete_disabled.gif b/phpBB/adm/images/icon_delete_disabled.gif Binary files differnew file mode 100644 index 0000000000..da55bbbe44 --- /dev/null +++ b/phpBB/adm/images/icon_delete_disabled.gif diff --git a/phpBB/adm/images/icon_down_disabled.gif b/phpBB/adm/images/icon_down_disabled.gif Binary files differnew file mode 100644 index 0000000000..3ba36975b4 --- /dev/null +++ b/phpBB/adm/images/icon_down_disabled.gif diff --git a/phpBB/adm/images/icon_edit_disabled.gif b/phpBB/adm/images/icon_edit_disabled.gif Binary files differnew file mode 100644 index 0000000000..ac96b0e6dc --- /dev/null +++ b/phpBB/adm/images/icon_edit_disabled.gif diff --git a/phpBB/adm/images/icon_sync_disabled.gif b/phpBB/adm/images/icon_sync_disabled.gif Binary files differnew file mode 100644 index 0000000000..39985045c8 --- /dev/null +++ b/phpBB/adm/images/icon_sync_disabled.gif diff --git a/phpBB/adm/images/icon_up_disabled.gif b/phpBB/adm/images/icon_up_disabled.gif Binary files differnew file mode 100644 index 0000000000..2797192574 --- /dev/null +++ b/phpBB/adm/images/icon_up_disabled.gif diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 336afc0de1..6c142fde3f 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -136,21 +136,27 @@ function adm_page_header($page_title) 'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/", 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/", - 'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />', - 'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />', - 'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />', - 'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />', - 'ICON_SYNC' => '<img src="' . $phpbb_admin_path . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />', - + 'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />', + 'ICON_MOVE_UP_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />', + 'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />', + 'ICON_MOVE_DOWN_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />', + 'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />', + 'ICON_EDIT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />', + 'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />', + 'ICON_DELETE_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />', + 'ICON_SYNC' => '<img src="' . $phpbb_admin_path . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />', + 'ICON_SYNC_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />', + + 'S_USER_LANG' => $user->lang['USER_LANG'], 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], - 'S_CONTENT_ENCODING' => $user->lang['ENCODING'], + 'S_CONTENT_ENCODING' => 'UTF-8', 'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'], 'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT']) ); - if (!empty($config['send_encoding'])) + if ($config['send_encoding']) { - header('Content-type: text/html; charset: ' . $user->lang['ENCODING']); + header('Content-type: text/html; charset=UTF-8'); } header('Cache-Control: private, no-cache="set-cookie"'); header('Expires: 0'); @@ -371,4 +377,102 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) return $tpl; } +/** +* Going through a config array and validate values, writing errors to $error. +*/ +function validate_config_vars($config_vars, &$cfg_array, &$error) +{ + global $phpbb_root_path, $user; + + foreach ($config_vars as $config_name => $config_definition) + { + if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) + { + continue; + } + + if (!isset($config_definition['validate'])) + { + continue; + } + + // Validate a bit. ;) String is already checked through request_var(), therefore we do not check this again + switch ($config_definition['validate']) + { + case 'bool': + $cfg_array[$config_name] = ($cfg_array[$config_name]) ? 1 : 0; + break; + + case 'int': + $cfg_array[$config_name] = (int) $cfg_array[$config_name]; + break; + + // Relative path (appended $phpbb_root_path) + case 'rpath': + case 'rwpath': + if (!$cfg_array[$config_name]) + { + break; + } + + $destination = $cfg_array[$config_name]; + + // Adjust destination path (no trailing slash) + if ($destination{(sizeof($destination)-1)} == '/' || $destination{(sizeof($destination)-1)} == '\\') + { + $destination = substr($destination, 0, sizeof($destination)-2); + } + + $destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination); + if ($destination && ($destination[0] == '/' || $destination[0] == "\\")) + { + $destination = ''; + } + + $cfg_array[$config_name] = trim($destination); + + // Path being relative (still prefixed by phpbb_root_path), but with the ability to escape the root dir... + case 'path': + case 'wpath': + + if (!$cfg_array[$config_name]) + { + break; + } + + $cfg_array[$config_name] = trim($cfg_array[$config_name]); + + // Make sure no NUL byte is present... + if (strpos($cfg_array[$config_name], '\0') !== false || strpos($cfg_array[$config_name], '%00') !== false) + { + $cfg_array[$config_name] = ''; + break; + } + + if (!file_exists($phpbb_root_path . $cfg_array[$config_name])) + { + $error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]); + } + + if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !is_dir($phpbb_root_path . $cfg_array[$config_name])) + { + $error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]); + } + + // Check if the path is writeable + if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath') + { + if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !is_writeable($phpbb_root_path . $cfg_array[$config_name])) + { + $error[] = sprintf($user->lang['DIRECTORY_NOT_WRITEABLE'], $cfg_array[$config_name]); + } + } + + break; + } + } + + return; +} + ?>
\ No newline at end of file diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html index 964a07bf67..42de3e7060 100644 --- a/phpBB/adm/style/acp_attachments.html +++ b/phpBB/adm/style/acp_attachments.html @@ -295,10 +295,9 @@ </tr> <!-- ENDIF --> <tr> - <input type="hidden" name="extension_change_list[]" value="{extensions.EXTENSION_ID}" /> <td><b>{extensions.EXTENSION}</b></td> <td>{extensions.GROUP_OPTIONS}</td> - <td><input type="checkbox" class="radio" name="extension_id_list[]" value="{extensions.EXTENSION_ID}" /></td> + <td><input type="checkbox" class="radio" name="extension_id_list[]" value="{extensions.EXTENSION_ID}" /><input type="hidden" name="extension_change_list[]" value="{extensions.EXTENSION_ID}" /></td> </tr> <!-- END extensions --> </tbody> @@ -319,6 +318,7 @@ <thead> <tr> <th>{L_FILENAME}</th> + <th>{L_FILEDATE}</th> <th>{L_FILESIZE}</th> <th>{L_ATTACH_POST_ID}</th> <th>{L_ATTACH_TO_POST}</th> @@ -328,21 +328,24 @@ <tbody> <!-- BEGIN orphan --> <!-- IF orphan.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> - <td><a href="{orphan.U_FILE}" rel="file">{orphan.FILE}</a></td> + <td><a href="{orphan.U_FILE}">{orphan.REAL_FILENAME}</a></td> + <td>{orphan.FILETIME}</td> <td>{orphan.FILESIZE}</td> - <td><b>ID: </b><input type="text" name="post_id[{orphan.FILE}]" size="7" maxlength="10" value="{orphan.POST_IDS}" /></td> - <td><input type="checkbox" class="radio" name="add[{orphan.FILE}]" /></td> - <td><input type="checkbox" class="radio" name="delete[{orphan.FILE}]" /></td> + <td><b>ID: </b><input type="text" name="post_id[{orphan.ATTACH_ID}]" size="7" maxlength="10" value="{orphan.POST_ID}" /></td> + <td><input type="checkbox" class="radio" name="add[{orphan.ATTACH_ID}]" /></td> + <td><input type="checkbox" class="radio" name="delete[{orphan.ATTACH_ID}]" /></td> </tr> <!-- END orphan --> - <tr> - <td colspan="3"> </td> - <td class="small"><a href="javascript:marklist('orphan', 'add', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('orphan', 'add', false);">{L_UNMARK_ALL}</a></td> - <td class="small"><a href="javascript:marklist('orphan', 'delete', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('orphan', 'delete', false);">{L_UNMARK_ALL}</a></td> + <tr class="row4"> + <td colspan="4"> </td> + <td class="small"><a href="#" onclick="marklist('orphan', 'add', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('orphan', 'add', false); return false;">{L_UNMARK_ALL}</a></td> + <td class="small"><a href="#" onclick="marklist('orphan', 'delete', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('orphan', 'delete', false); return false;">{L_UNMARK_ALL}</a></td> </tr> </tbody> </table> + <br /> + <fieldset class="submit-buttons"> <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> diff --git a/phpBB/adm/style/acp_ban.html b/phpBB/adm/style/acp_ban.html index 8bfdf735a5..4629200c97 100644 --- a/phpBB/adm/style/acp_ban.html +++ b/phpBB/adm/style/acp_ban.html @@ -12,19 +12,19 @@ <!-- var ban_length = new Array(); - ban_length[-1] = ""; + ban_length[-1] = ''; <!-- BEGIN ban_length --> ban_length['{ban_length.BAN_ID}'] = "{ban_length.A_LENGTH}"; <!-- END ban_length --> var ban_reason = new Array(); - ban_reason[-1] = ""; + ban_reason[-1] = ''; <!-- BEGIN ban_reason --> ban_reason['{ban_reason.BAN_ID}'] = "{ban_reason.A_REASON}"; <!-- END ban_reason --> var ban_give_reason = new Array(); - ban_give_reason[-1] = ""; + ban_give_reason[-1] = ''; <!-- BEGIN ban_give_reason --> ban_give_reason['{ban_give_reason.BAN_ID}'] = "{ban_give_reason.A_REASON}"; <!-- END ban_give_reason --> diff --git a/phpBB/adm/style/acp_bbcodes.html b/phpBB/adm/style/acp_bbcodes.html index 162ee18c35..c1eb7e2193 100644 --- a/phpBB/adm/style/acp_bbcodes.html +++ b/phpBB/adm/style/acp_bbcodes.html @@ -96,7 +96,7 @@ <!-- BEGIN bbcodes --> <!-- IF bbcodes.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> <td style="text-align: center;">{bbcodes.BBCODE_TAG}</td> - <td style="text-align: center;"><a href="{bbcodes.U_EDIT}">{ICON_EDIT}</a> <a href="{bbcodes.U_DELETE}">{ICON_DELETE}</a></td> + <td style="text-align: right; width: 40px;"><a href="{bbcodes.U_EDIT}">{ICON_EDIT}</a> <a href="{bbcodes.U_DELETE}">{ICON_DELETE}</a></td> </tr> <!-- END bbcodes --> </tbody> diff --git a/phpBB/adm/style/acp_board.html b/phpBB/adm/style/acp_board.html index 02cb055a74..dd29017cb1 100644 --- a/phpBB/adm/style/acp_board.html +++ b/phpBB/adm/style/acp_board.html @@ -6,6 +6,13 @@ <p>{L_TITLE_EXPLAIN}</p> +<!-- IF S_ERROR --> + <div class="errorbox"> + <h3>{L_WARNING}</h3> + <p>{ERROR_MSG}</p> + </div> +<!-- ENDIF --> + <form id="acp_board" method="post" action="{U_ACTION}"> <!-- BEGIN options --> diff --git a/phpBB/adm/style/acp_bots.html b/phpBB/adm/style/acp_bots.html index 1924133bfd..bc6c657490 100644 --- a/phpBB/adm/style/acp_bots.html +++ b/phpBB/adm/style/acp_bots.html @@ -89,7 +89,7 @@ <input class="button2" name="add" type="submit" value="{L_BOT_ADD}" /> </fieldset> - <fieldset class="quick"> + <fieldset class="quick" style="float: right;"> <select name="action">{S_BOT_OPTIONS}</select> <input class="button2" name="submit" type="submit" value="{L_SUBMIT}" /> </fieldset> diff --git a/phpBB/adm/style/acp_captcha.html b/phpBB/adm/style/acp_captcha.html index 2fc22d6371..bdc48ea0aa 100644 --- a/phpBB/adm/style/acp_captcha.html +++ b/phpBB/adm/style/acp_captcha.html @@ -18,100 +18,18 @@ <dt><label for="enable_post_confirm">{L_VISUAL_CONFIRM_POST}:</label><br /><span>{L_VISUAL_CONFIRM_POST_EXPLAIN}</span></dt> <dd><input type="radio" class="radio" id="enable_post_confirm" name="enable_post_confirm" value="1"<!-- IF POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_ENABLED} <input type="radio" class="radio" name="enable_post_confirm" value="0"<!-- IF not POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</dd> </dl> -</fieldset> - <!-- IF GD --> -<fieldset> - <legend>{L_CAPTCHA_OVERLAP}</legend> -<!-- IF TTF --> -<dl> - <dt><label for="policy_overlap">{L_CAPTCHA_OVERLAP}:</label><br /><span>{U_POLICY_OVERLAP}</span></dt> - <dd><input id="policy_overlap" name="policy_overlap" value="1" class="radio" type="radio"<!-- IF OVERLAP_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_YES} <input name="policy_overlap" value="0" class="radio" type="radio"<!-- IF not OVERLAP_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd> -</dl> -<dl> - <dt><label for="policy_overlap_noise_pixel">{L_OVERLAP_NOISE_PIXEL}:</label></dt> - <select id="policy_overlap_noise_pixel" name="policy_overlap_noise_pixel"><option value="0"<!-- IF OVERLAP_NOISE_PIXEL eq '0' --> selected="selected"<!-- ENDIF -->>{L_NO_NOISE}</option><option value="1"<!-- IF OVERLAP_NOISE_PIXEL eq '1' --> selected="selected"<!-- ENDIF -->>{L_LIGHT}</option><option value="2"<!-- IF OVERLAP_NOISE_PIXEL eq '2' --> selected="selected"<!-- ENDIF -->>{L_MEDIUM}</option><option value="3"<!-- IF OVERLAP_NOISE_PIXEL eq '3' --> selected="selected"<!-- ENDIF -->>{L_HEAVY}</option></select></dd> -</dl> -<dl> - <dt><label for="policy_overlap_noise_line">{L_OVERLAP_NOISE_LINE}:</label></dt> - - <dd><input id="policy_overlap_noise_line" name="policy_overlap_noise_line" value="1" class="radio" type="radio"<!-- IF OVERLAP_NOISE_LINE_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_YES} <input name="policy_overlap_noise_line" value="0" class="radio" type="radio"<!-- IF not OVERLAP_NOISE_LINE_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd> -</dl> -</fieldset> -<!-- ENDIF --> - -<fieldset> - <legend>{L_CAPTCHA_ENTROPY}</legend> -<dl> - <dt><label for="policy_entropy">{L_CAPTCHA_ENTROPY}:</label><br /><span>{U_POLICY_ENTROPY}</span></dt> - <dd><input id="policy_entropy" name="policy_entropy" value="1" class="radio" type="radio"<!-- IF ENTROPY_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_YES} <input name="policy_entropy" value="0" class="radio" type="radio"<!-- IF not ENTROPY_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd> -</dl> -<dl> - <dt><label for="policy_entropy_noise_pixel">{L_ENTROPY_NOISE_PIXEL}:</label></dt> - <select id="policy_entropy_noise_pixel" name="policy_entropy_noise_pixel"><option value="0"<!-- IF ENTROPY_NOISE_PIXEL eq '0' --> selected="selected"<!-- ENDIF -->>{L_NO_NOISE}</option><option value="1"<!-- IF ENTROPY_NOISE_PIXEL eq '1' --> selected="selected"<!-- ENDIF -->>{L_LIGHT}</option><option value="2"<!-- IF ENTROPY_NOISE_PIXEL eq '2' --> selected="selected"<!-- ENDIF -->>{L_MEDIUM}</option><option value="3"<!-- IF ENTROPY_NOISE_PIXEL eq '3' --> selected="selected"<!-- ENDIF -->>{L_HEAVY}</option></select></dd> -</dl> -<dl> - - <dt><label for="policy_entropy_noise_line">{L_ENTROPY_NOISE_LINE}:</label></dt> - <dd><input id="policy_entropy_noise_line" name="policy_entropy_noise_line" value="1" class="radio" type="radio"<!-- IF ENTROPY_NOISE_LINE_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_YES} <input name="policy_entropy_noise_line" value="0" class="radio" type="radio"<!-- IF not ENTROPY_NOISE_LINE_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd> -</dl> -</fieldset> - -<!-- IF TTF --> -<fieldset> - <legend>{L_CAPTCHA_SHAPE}</legend> -<dl> - <dt><label for="policy_shape">{L_CAPTCHA_SHAPE}:</label><br /><span>{U_POLICY_SHAPE}</span></dt> - <dd><input id="policy_shape" name="policy_shape" value="1" class="radio" type="radio"<!-- IF SHAPE_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_YES} <input name="policy_shape" value="0" class="radio" type="radio"<!-- IF not SHAPE_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd> - -</dl> <dl> - <dt><label for="policy_shape_noise_pixel">{L_SHAPE_NOISE_PIXEL}:</label></dt> - <select id="policy_shape_noise_pixel" name="policy_shape_noise_pixel"><option value="0"<!-- IF SHAPE_NOISE_PIXEL eq '0' --> selected="selected"<!-- ENDIF -->>{L_NO_NOISE}</option><option value="1"<!-- IF SHAPE_NOISE_PIXEL eq '1' --> selected="selected"<!-- ENDIF -->>{L_LIGHT}</option><option value="2"<!-- IF SHAPE_NOISE_PIXEL eq '2' --> selected="selected"<!-- ENDIF -->>{L_MEDIUM}</option><option value="3"<!-- IF SHAPE_NOISE_PIXEL eq '3' --> selected="selected"<!-- ENDIF -->>{L_HEAVY}</option></select></dd> + <dt><label for="captcha_gd">{L_CAPTCHA_GD}:</label><br /><span>{L_CAPTCHA_GD_EXPLAIN}</span></dt> + <dd><input id="captcha_gd" name="captcha_gd" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD --> checked="checked"<!-- ENDIF --> /> {L_YES} <input name="captcha_gd" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd> </dl> <dl> - <dt><label for="policy_shape_noise_line">{L_SHAPE_NOISE_LINE}:</label></dt> - <dd><input id="policy_shape_noise_line" name="policy_shape_noise_line" value="1" class="radio" type="radio"<!-- IF SHAPE_NOISE_LINE_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_YES} <input name="policy_shape_noise_line" value="0" class="radio" type="radio"<!-- IF not SHAPE_NOISE_LINE_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd> + <dt><label for="captcha_gd_noise">{L_CAPTCHA_GD_NOISE}:</label><br /><span>{L_CAPTCHA_GD_NOISE_EXPLAIN}</span></dt> + <dd><input id="captcha_gd_noise" name="captcha_gd_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_NOISE --> checked="checked"<!-- ENDIF --> /> {L_YES} <input name="captcha_gd_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_NOISE --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd> </dl> -</fieldset> <!-- ENDIF --> - -<fieldset> - <legend>{L_CAPTCHA_3DBITMAP}</legend> -<dl> - <dt><label for="policy_3dbitmap">{L_CAPTCHA_3DBITMAP}:</label><br /><span>{U_POLICY_3DBITMAP}</span></dt> - <dd><input id="policy_3dbitmap" name="policy_3dbitmap" value="1" class="radio" type="radio"<!-- IF THREEDBITMAP_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_YES} <input name="policy_3dbitmap" value="0" class="radio" type="radio"<!-- IF not THREEDBITMAP_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd> -</dl> </fieldset> -<!-- IF TTF --> -<fieldset> - <legend>{L_CAPTCHA_CELLS}</legend> -<dl> - <dt><label for="policy_cells">{L_CAPTCHA_CELLS}:</label><br /><span>{U_POLICY_CELLS}</span></dt> - <dd><input id="policy_cells" name="policy_cells" value="1" class="radio" type="radio"<!-- IF CELLS_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_YES} <input name="policy_cells" value="0" class="radio" type="radio"<!-- IF not CELLS_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd> -</dl> -</fieldset> - -<fieldset> - <legend>{L_CAPTCHA_STENCIL}</legend> -<dl> - <dt><label for="policy_stencil">{L_CAPTCHA_STENCIL}:</label><br /><span>{U_POLICY_STENCIL}</span></dt> - <dd><input id="policy_stencil" name="policy_stencil" value="1" class="radio" type="radio"<!-- IF STENCIL_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_YES} <input name="policy_stencil" value="0" class="radio" type="radio"<!-- IF not STENCIL_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd> -</dl> -</fieldset> - -<fieldset> - <legend>{L_CAPTCHA_COMPOSITE}</legend> -<dl> - <dt><label for="policy_composite">{L_CAPTCHA_COMPOSITE}:</label><br /><span>{U_POLICY_COMPOSITE}</span></dt> - <dd><input id="policy_composite" name="policy_composite" value="1" class="radio" type="radio"<!-- IF COMPOSITE_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_YES} <input name="policy_composite" value="0" class="radio" type="radio"<!-- IF not COMPOSITE_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd> -</dl> -</fieldset> -<!-- ENDIF --> - -<!-- ENDIF --> - <fieldset class="submit-buttons"> <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> diff --git a/phpBB/adm/style/acp_email.html b/phpBB/adm/style/acp_email.html index e06bcc3b04..5b3d19c8b6 100644 --- a/phpBB/adm/style/acp_email.html +++ b/phpBB/adm/style/acp_email.html @@ -24,7 +24,7 @@ <dl> <dt><label for="usernames">{L_SEND_TO_USERS}:</label><br /><span>{L_SEND_TO_USERS_EXPLAIN}</span></dt> <dd><textarea name="usernames" id="usernames" rows="5" cols="40">{USERNAMES}</textarea></dd> - <dd>[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> + <dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> </dl> <dl> <dt><label for="subject">{L_SUBJECT}:</label></dt> diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index dff974e818..63ed7cb883 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -97,6 +97,14 @@ <!-- ENDIF --> </dl> <dl> + <dt><label for="forum_password">{L_FORUM_PASSWORD}:</label><br /><span>{L_FORUM_PASSWORD_EXPLAIN}</span></dt> + <dd><input type="password" id="forum_password" name="forum_password" value="{FORUM_PASSWORD}" /></dd> + </dl> + <dl> + <dt><label for="forum_password_confirm">{L_FORUM_PASSWORD_CONFIRM}:</label><br /><span>{L_FORUM_PASSWORD_CONFIRM_EXPLAIN}</span></dt> + <dd><input type="password" id="forum_password_confirm" name="forum_password_confirm" value="{FORUM_PASSWORD_CONFIRM}" /></dd> + </dl> + <dl> <dt><label for="forum_style">{L_FORUM_STYLE}:</label></dt> <dd><select id="forum_style" name="forum_style"><option value="0">{L_DEFAULT_STYLE}</option>{S_STYLES_OPTIONS}</select></dd> </dl> @@ -149,14 +157,6 @@ <dt><label for="topics_per_page">{L_FORUM_TOPICS_PAGE}:</label><br /><span>{L_FORUM_TOPICS_PAGE_EXPLAIN}</span></dt> <dd><input type="text" id="topics_per_page" name="topics_per_page" value="{TOPICS_PER_PAGE}" /></dd> </dl> - <dl> - <dt><label for="forum_password">{L_FORUM_PASSWORD}:</label><br /><span>{L_FORUM_PASSWORD_EXPLAIN}</span></dt> - <dd><input type="password" id="forum_password" name="forum_password" value="{FORUM_PASSWORD}" /></dd> - </dl> - <dl> - <dt><label for="forum_password_confirm">{L_FORUM_PASSWORD_CONFIRM}:</label><br /><span>{L_FORUM_PASSWORD_CONFIRM_EXPLAIN}</span></dt> - <dd><input type="password" id="forum_password_confirm" name="forum_password_confirm" value="{FORUM_PASSWORD_CONFIRM}" /></dd> - </dl> </fieldset> <fieldset> @@ -283,8 +283,40 @@ </form> +<!-- ELSEIF S_CONTINUE_SYNC --> + + <script type="text/javascript"> + <!-- + + var close_waitscreen = 0; + window.open('{UA_PROGRESS_BAR}', '_sync', 'height=240, resizable=yes, scrollbars=no, width=400'); + + //--> + </script> + + <h1>{L_FORUM_ADMIN}</h1> + + <p>{L_FORUM_ADMIN_EXPLAIN}</p> + + <p>{L_PROGRESS_EXPLAIN}</p> + <!-- ELSE --> + <script type="text/javascript"> + <!-- + + /** + * Popup search progress bar + */ + function popup_progress_bar() + { + var close_waitscreen = 0; + window.open('{UA_PROGRESS_BAR}', '_sync', 'height=240, resizable=yes, scrollbars=no, width=400'); + } + + //--> + </script> + <h1>{L_FORUM_ADMIN}</h1> <p>{L_FORUM_ADMIN_EXPLAIN}</p> @@ -297,12 +329,18 @@ <!-- ENDIF --> <!-- IF S_RESYNCED --> + <script language="javascript" type="text/javascript"> + <!-- + var close_waitscreen = 1; + //--> + </script> + <div class="successbox"> <h3>{L_NOTIFY}</h3> <p>{L_FORUM_RESYNCED}</p> </div> <!-- ENDIF --> - + <p><strong>{NAVIGATION}<!-- IF S_NO_FORUMS --> [<a href="{U_EDIT}">{L_EDIT}</a> | <a href="{U_DELETE}">{L_DELETE}</a><!-- IF not S_LINK --> | <a href="{U_SYNC}">{L_RESYNC}</a><!-- ENDIF --->]<!-- ENDIF --></strong></p> <!-- IF .forums --> @@ -313,15 +351,31 @@ <tr> <td style="width: 5%;">{forums.FOLDER_IMAGE}</td> <td> - <strong><!-- IF forums.S_LINK -->{forums.FORUM_NAME}<!-- ELSE --><a href="{forums.U_FORUM}">{forums.FORUM_NAME}</a><!-- ENDIF --></strong> + <!-- IF forums.FORUM_IMAGE --><div style="float: left;">{forums.FORUM_IMAGE}</div><!-- ENDIF --> + <strong><!-- IF forums.S_FORUM_LINK -->{forums.FORUM_NAME}<!-- ELSE --><a href="{forums.U_FORUM}">{forums.FORUM_NAME}</a><!-- ENDIF --></strong> <!-- IF forums.FORUM_DESCRIPTION --><br /><span>{forums.FORUM_DESCRIPTION}</span><!-- ENDIF --> <!-- IF forums.S_FORUM_POST --><br /><br /><span>{L_TOPICS}: <b>{forums.FORUM_TOPICS}</b> / {L_POSTS}: <b>{forums.FORUM_POSTS}</b></span><!-- ENDIF --> </td> - <td style="width: 15%; text-align: right; white-space: nowrap;"> - <!-- IF not forums.S_FIRST_ROW --><a href="{forums.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF --> - <!-- IF not forums.S_LAST_ROW --><a href="{forums.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF --> + <td style="vertical-align: top; width: 100px; text-align: right; white-space: nowrap;"> + <!-- IF forums.S_FIRST_ROW && not forums.S_LAST_ROW --> + {ICON_MOVE_UP_DISABLED} + <a href="{forums.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> + <!-- ELSEIF not forums.S_FIRST_ROW && not forums.S_LAST_ROW--> + <a href="{forums.U_MOVE_UP}">{ICON_MOVE_UP}</a> + <a href="{forums.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> + <!-- ELSEIF forums.S_LAST_ROW && not forums.S_FIRST_ROW --> + <a href="{forums.U_MOVE_UP}">{ICON_MOVE_UP}</a> + {ICON_MOVE_DOWN_DISABLED} + <!-- ELSE --> + {ICON_MOVE_UP_DISABLED} + {ICON_MOVE_DOWN_DISABLED} + <!-- ENDIF --> <a href="{forums.U_EDIT}">{ICON_EDIT}</a> - <!-- IF not forums.S_LINK --><a href="{forums.U_SYNC}">{ICON_SYNC}</a> <!-- ENDIF --> + <!-- IF not forums.S_FORUM_LINK --> + <a href="{forums.U_SYNC}" onclick="popup_progress_bar();">{ICON_SYNC}</a> + <!-- ELSE --> + {ICON_SYNC_DISABLED} + <!-- ENDIF --> <a href="{forums.U_DELETE}">{ICON_DELETE}</a> </td> </tr> @@ -353,4 +407,4 @@ <!-- ENDIF --> -<!-- INCLUDE overall_footer.html -->
\ No newline at end of file +<!-- INCLUDE overall_footer.html --> diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html index 2b446056a7..3d4e274228 100644 --- a/phpBB/adm/style/acp_groups.html +++ b/phpBB/adm/style/acp_groups.html @@ -217,14 +217,14 @@ <div class="pagination" style="float: left;"> <!-- IF PAGINATION --> - <a href="javascript:jumpto();" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> + <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> <!-- ELSE --> {S_ON_PAGE} <!-- ENDIF --> </div> <fieldset class="quick"> - <span class="small"><a href="javascript:marklist('list', 'mark', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('list', 'mark', false);">{L_UNMARK_ALL}</a></span><br /> + <span class="small"><a href="#" onclick="marklist('list', 'mark', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('list', 'mark', false); return false;">{L_UNMARK_ALL}</a></span><br /> <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}" /> @@ -247,7 +247,7 @@ <dl> <dt><label for="usernames">{L_USERNAME}:</label><br /><span>{L_USERNAMES_EXPLAIN}</span></dt> <dd><textarea id="usernames" name="usernames" cols="40" rows="5"></textarea></dd> - <dd>[ <a href="{U_FIND_USERNAME}" target="usersearch">{L_FIND_USERNAME}</a> ]</dd> + <dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> </dl> </fieldset> diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html index ca4c39004a..e3cfb5764a 100644 --- a/phpBB/adm/style/acp_icons.html +++ b/phpBB/adm/style/acp_icons.html @@ -139,14 +139,22 @@ </tr> <!-- ENDIF --> <!-- IF items.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> - <td style="text-align: center;"><img src="{items.IMG_SRC}" width="{items.WIDTH}" height="{items.HEIGHT}" alt="{items.ALT_TEXT}" title="{items.ALT_TEXT}" /></td> + <td style="width: 85%; text-align: center;"><img src="{items.IMG_SRC}" width="{items.WIDTH}" height="{items.HEIGHT}" alt="{items.ALT_TEXT}" title="{items.ALT_TEXT}" /></td> <!-- IF S_SMILIES --> <td style="text-align: center;">{items.CODE}</td> <td style="text-align: center;">{items.EMOTION}</td> <!-- ENDIF --> - <td style="width: 15%; text-align: right; white-space: nowrap;"> - <!-- IF not items.S_FIRST_ROW --><a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF --> - <!-- IF not items.S_LAST_ROW --><a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF --> + <td style="width: 80px; text-align: right; white-space: nowrap;"> + <!-- IF items.S_FIRST_ROW && not items.S_LAST_ROW --> + {ICON_MOVE_UP_DISABLED} + <a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> + <!-- ELSEIF not items.S_FIRST_ROW && not items.S_LAST_ROW--> + <a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a> + <a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> + <!-- ELSEIF items.S_LAST_ROW && not items.S_FIRST_ROW --> + <a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a> + {ICON_MOVE_DOWN_DISABLED} + <!-- ENDIF --> <a href="{items.U_EDIT}">{ICON_EDIT}</a> <a href="{items.U_DELETE}">{ICON_DELETE}</a> </td> diff --git a/phpBB/adm/style/acp_inactive.html b/phpBB/adm/style/acp_inactive.html new file mode 100755 index 0000000000..8c50ec5c41 --- /dev/null +++ b/phpBB/adm/style/acp_inactive.html @@ -0,0 +1,75 @@ +<!-- INCLUDE overall_header.html --> + +<a name="maincontent"></a> + +<h2>{L_INACTIVE_USERS}</h2> + +<p>{L_INACTIVE_USERS_EXPLAIN}</p> + +<form id="inactive" method="post" action="{U_ACTION}"> + +<div class="clearfix"></div> + +<div class="pagination"> + <!-- IF PAGINATION --> + <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> + <!-- ELSE --> + {S_ON_PAGE} + <!-- ENDIF --> +</div> + +<table cellspacing="1"> +<thead> +<tr> + <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_MARK}</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> <input type="checkbox" class="radio" name="mark[]" value="{inactive.USER_ID}" /> </td> + </tr> +<!-- BEGINELSE --> + <tr> + <td colspan="6" style="text-align: center;">{L_NO_INACTIVE_USERS}</td> + </tr> +<!-- END inactive --> +</tbody> +</table> + +<!-- IF .inactive --> + <fieldset class="quick" style="float: left;"> + {L_DISPLAY_LOG}: {S_LIMIT_DAYS} {L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR} + <input class="button2" type="submit" value="{L_GO}" name="sort" /> + </fieldset> + + <fieldset class="quick"> + <p><a href="#" onclick="marklist('inactive', 'mark', true); return false;">{L_MARK_ALL}</a> • <a href="#" onclick="marklist('inactive', 'mark', false); return false;">{L_UNMARK_ALL}</a></p> + <select name="action">{S_INACTIVE_OPTIONS}</select> + + <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" /> + </fieldset> +<!-- ENDIF --> + +<div class="pagination"> + <!-- IF PAGINATION --> + <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> + <!-- ELSE --> + {S_ON_PAGE} + <!-- ENDIF --> +</div> + +</form> + +<!-- INCLUDE overall_footer.html -->
\ No newline at end of file diff --git a/phpBB/adm/style/acp_language.html b/phpBB/adm/style/acp_language.html index 5f32855f48..22cbd3921c 100644 --- a/phpBB/adm/style/acp_language.html +++ b/phpBB/adm/style/acp_language.html @@ -44,7 +44,7 @@ </dl> <dl> <dt><label>{L_LANG_ISO_CODE}:</label></dt> - <dd><b>{LANG_ISO}</b></dd> + <dd><strong>{LANG_ISO}</strong></dd> </dl> <dl> <dt><label for="lang_author">{L_LANG_AUTHOR}:</label></dt> @@ -85,7 +85,7 @@ <tbody> <!-- BEGIN missing --> <tr class="row4"> - <td><b>{missing.FILE}</b></td> + <td><strong>{missing.FILE}</strong></td> <td style="text-align: right;"><input type="submit" name="missing_file[{missing.KEY}]" value="{L_SELECT}" class="button2" /></td> </tr> {missing.TPL} @@ -131,8 +131,12 @@ </tr> <!-- ENDIF --> <tr> - <td class="row3"><b>{PRINT_MESSAGE}<!-- IF S_FROM_STORE --><br /><span style="color: red;">{L_FILE_FROM_STORAGE}</span><!-- ENDIF --></b></td> - <td class="row3" style="text-align: right;"><input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" /> <input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /><!-- IF ALLOW_UPLOAD --> {L_UPLOAD_METHOD}: <!-- BEGIN buttons--><input type="radio" class="radio"<!-- IF buttons.S_FIRST_ROW --> id="method" checked="checked"<!-- ENDIF --> value="{buttons.VALUE}" name="method"> {buttons.VALUE} <!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td> + <td rowspan="2" class="row3"><strong>{PRINT_MESSAGE}<!-- IF S_FROM_STORE --><br /><span style="color: red;">{L_FILE_FROM_STORAGE}</span><!-- ENDIF --></strong></td> + <td class="row3" style="text-align: right;"><input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" /> <input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /></td> + </tr> + <tr> + <td class="row3" style="text-align: right;"> + <!-- IF ALLOW_UPLOAD --> {L_UPLOAD_METHOD}: <!-- BEGIN buttons--><input type="radio" class="radio"<!-- IF buttons.S_FIRST_ROW --> id="method" checked="checked"<!-- ENDIF --> value="{buttons.VALUE}" name="method" /> {buttons.VALUE} <!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td> </tr> </thead> <tbody> @@ -144,7 +148,10 @@ {TPL} <!-- ENDIF --> <tr> - <td class="row3" colspan="3" style="text-align: right;"><input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" /> <input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /><!-- IF ALLOW_UPLOAD --> {L_UPLOAD_METHOD}: <!-- BEGIN buttons--><input type="radio" class="radio" value="{buttons.VALUE}" name="method"> {buttons.VALUE} <!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td> + <td class="row3" colspan="3" style="text-align: right;"><!-- IF ALLOW_UPLOAD --> {L_UPLOAD_METHOD}: <!-- BEGIN buttons--><input type="radio" class="radio" value="{buttons.VALUE}" name="method" /> {buttons.VALUE} <!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td> + </tr> + <tr> + <td class="row3" colspan="3" style="text-align: right;"><input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" /> <input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /></td> </tr> </tbody> </table> @@ -173,12 +180,12 @@ <legend>{L_UPLOAD_SETTINGS}</legend> <dl> <dt><label>{L_UPLOAD_METHOD}:</label></dt> - <dd><b>{NAME}</b></dd> + <dd><strong>{NAME}</strong></dd> </dl> <!-- BEGIN data --> <dl> - <dt><label for="store">{data.NAME}:</label><br /><span>{data.EXPLAIN}</span></dt> - <dd><input type="text" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" checked="checked" /></dd> + <dt><label for="{data.DATA}">{data.NAME}:</label><br /><span>{data.EXPLAIN}</span></dt> + <dd><input type="text" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" /></dd> </dl> <!-- END data --> </fieldset> @@ -209,27 +216,27 @@ </thead> <tbody> <tr> - <td class="row3" colspan="5"><b>{L_INSTALLED_LANGUAGE_PACKS}</b></td> + <td class="row3" colspan="5"><strong>{L_INSTALLED_LANGUAGE_PACKS}</strong></td> </tr> <!-- BEGIN lang --> <!-- IF lang.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> <td><a href="{lang.U_DETAILS}">{lang.ENGLISH_NAME}</a> {lang.TAG}</td> <td>{lang.LOCAL_NAME}</td> - <td style="text-align: center;"><b>{lang.ISO}</b></td> + <td style="text-align: center;"><strong>{lang.ISO}</strong></td> <td style="text-align: center;">{lang.USED_BY}</td> <td style="text-align: center;"> <a href="{lang.U_DOWNLOAD}">{L_DOWNLOAD}</a> | <a href="{lang.U_DELETE}">{L_DELETE}</a></td> </tr> <!-- END lang --> <!-- IF .notinst --> <tr> - <td class="row3" colspan="5"><b>{L_UNINSTALLED_LANGUAGE_PACKS}</b></td> + <td class="row3" colspan="5"><strong>{L_UNINSTALLED_LANGUAGE_PACKS}</strong></td> </tr> <!-- ENDIF --> <!-- BEGIN notinst --> <!-- IF notinst.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> <td>{notinst.NAME}</td> <td>{notinst.LOCAL_NAME}</td> - <td style="text-align: center;"><b>{notinst.ISO}</b></td> + <td style="text-align: center;"><strong>{notinst.ISO}</strong></td> <td colspan="2" style="text-align: center;"><a href="{notinst.U_INSTALL}">{L_INSTALL}</a></td> </tr> <!-- END notinst --> diff --git a/phpBB/adm/style/acp_logs.html b/phpBB/adm/style/acp_logs.html index e3411fb393..e5dc04c94a 100644 --- a/phpBB/adm/style/acp_logs.html +++ b/phpBB/adm/style/acp_logs.html @@ -17,7 +17,7 @@ <div class="pagination"> <!-- IF PAGINATION --> - <a href="javascript:jumpto();" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> + <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> <!-- ELSE --> {S_ON_PAGE} <!-- ENDIF --> @@ -70,7 +70,7 @@ <!-- IF S_CLEARLOGS --> <fieldset class="quick"> - <b class="small"><a href="javascript: marklist('list', 'mark', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('list', 'mark', false);">{L_UNMARK_ALL}</a></b><br /> + <b class="small"><a href="#" onclick="marklist('list', 'mark', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('list', 'mark', false); return false;">{L_UNMARK_ALL}</a></b><br /> <input class="button2" type="submit" name="delmarked" value="{L_DELETE_MARKED}" /> <input class="button2" type="submit" name="delall" value="{L_DELETE_ALL}" /> </fieldset> @@ -78,7 +78,7 @@ <div class="pagination"> <!-- IF PAGINATION --> - <a href="javascript:jumpto();" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> + <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> <!-- ELSE --> {S_ON_PAGE} <!-- ENDIF --> diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html index a3a3e90c00..9279cb9b9b 100644 --- a/phpBB/adm/style/acp_main.html +++ b/phpBB/adm/style/acp_main.html @@ -1,166 +1,172 @@ <!-- INCLUDE overall_header.html --> -<a name="maincontent"></a><h1>{L_WELCOME_PHPBB}</h1> +<a name="maincontent"></a> -<p>{L_ADMIN_INTRO}</p> +<!-- IF S_RESTORE_PERMISSIONS --> -<!-- IF S_DEBUG_EXTRA --> - <div class="errorbox"> - <h3>{L_WARNING}</h3> - <p>{L_DEBUG_EXTRA_WARNING}</p> - </div> -<!-- ENDIF --> + <h1>{L_PERMISSIONS_TRANSFERED}</h1> -<!-- IF S_REMOVE_INSTALL --> - <div class="errorbox"> - <h3>{L_WARNING}</h3> - <p>{L_REMOVE_INSTALL}</p> - </div> -<!-- ENDIF --> + <p>{L_PERMISSIONS_TRANSFERED_EXPLAIN}</p> -<table cellspacing="1"> - <caption>{L_FORUM_STATS}</caption> - <col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" /> -<thead> -<tr> - <th>{L_STATISTIC}</th> - <th>{L_VALUE}</th> - <th>{L_STATISTIC}</th> - <th>{L_VALUE}</th> -</tr> -</thead> -<tbody> -<tr> - <td>{L_NUMBER_POSTS}: </td> - <td><b>{TOTAL_POSTS}</b></td> - <td>{L_POSTS_PER_DAY}: </td> - <td><b>{POSTS_PER_DAY}</b></td> -</tr> -<tr> - <td>{L_NUMBER_TOPICS}: </td> - <td><b>{TOTAL_TOPICS}</b></td> - <td>{L_TOPICS_PER_DAY}: </td> - <td><b>{TOPICS_PER_DAY}</b></td> -</tr> -<tr> - <td>{L_NUMBER_USERS}: </td> - <td><b>{TOTAL_USERS}</b></td> - <td>{L_USERS_PER_DAY}: </td> - <td><b>{USERS_PER_DAY}</b></td> -</tr> -<tr> - <td>{L_NUMBER_FILES}: </td> - <td><b>{TOTAL_FILES}</b></td> - <td>{L_FILES_PER_DAY}: </td> - <td><b>{FILES_PER_DAY}</b></td> -</tr> -<tr> - <td>{L_BOARD_STARTED}: </td> - <td><b>{START_DATE}</b></td> - <td>{L_AVATAR_DIR_SIZE}: </td> - <td><b>{AVATAR_DIR_SIZE}</b></td> -</tr> -<tr> - <td>{L_DATABASE_SIZE}: </td> - <td><b>{DBSIZE}</b></td> - <td>{L_UPLOAD_DIR_SIZE}: </td> - <td><b>{UPLOAD_DIR_SIZE}</b></td> -</tr> -<tr> - <td>{L_DATABASE_SERVER_INFO}: </td> - <td><b>{DATABASE_INFO}</b></td> - <td>{L_GZIP_COMPRESSION}: </td> - <td><b>{GZIP_COMPRESSION}</b></td> -</tr> -</tbody> -</table> - -<!-- IF S_ACTION_OPTIONS --> - <form id="stats" method="post" action="{U_ACTION}"> - <fieldset class="quick"> - <select name="action">{S_ACTION_OPTIONS}</select> - - <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" /> - </fieldset> - </form> -<!-- ENDIF --> +<!-- ELSE --> -<!-- IF .log --> - <h2>{L_ADMIN_LOG}</h2> + <h1>{L_WELCOME_PHPBB}</h1> - <p>{L_ADMIN_LOG_INDEX_EXPLAIN}</p> + <p>{L_ADMIN_INTRO}</p> + + <!-- IF S_REMOVE_INSTALL --> + <div class="errorbox"> + <h3>{L_WARNING}</h3> + <p>{L_REMOVE_INSTALL}</p> + </div> + <!-- ENDIF --> <table cellspacing="1"> + <caption>{L_FORUM_STATS}</caption> + <col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" /> <thead> <tr> - <th>{L_USERNAME}</th> - <th>{L_IP}</th> - <th>{L_TIME}</th> - <th>{L_ACTION}</th> + <th>{L_STATISTIC}</th> + <th>{L_VALUE}</th> + <th>{L_STATISTIC}</th> + <th>{L_VALUE}</th> </tr> </thead> <tbody> - <!-- BEGIN log --> - <!-- IF log.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> + <tr> + <td>{L_NUMBER_POSTS}: </td> + <td><b>{TOTAL_POSTS}</b></td> + <td>{L_POSTS_PER_DAY}: </td> + <td><b>{POSTS_PER_DAY}</b></td> + </tr> + <tr> + <td>{L_NUMBER_TOPICS}: </td> + <td><b>{TOTAL_TOPICS}</b></td> + <td>{L_TOPICS_PER_DAY}: </td> + <td><b>{TOPICS_PER_DAY}</b></td> + </tr> + <tr> + <td>{L_NUMBER_USERS}: </td> + <td><b>{TOTAL_USERS}</b></td> + <td>{L_USERS_PER_DAY}: </td> + <td><b>{USERS_PER_DAY}</b></td> + </tr> + <tr> + <td>{L_NUMBER_FILES}: </td> + <td><b>{TOTAL_FILES}</b></td> + <td>{L_FILES_PER_DAY}: </td> + <td><b>{FILES_PER_DAY}</b></td> + </tr> - <td>{log.USERNAME}</td> - <td style="text-align: center;">{log.IP}</td> - <td style="text-align: center;">{log.DATE}</td> - <td>{log.ACTION}</td> - </tr> - <!-- END log --> + + <tr> + <td>{L_BOARD_STARTED}: </td> + <td><b>{START_DATE}</b></td> + <td>{L_AVATAR_DIR_SIZE}: </td> + <td><b>{AVATAR_DIR_SIZE}</b></td> + </tr> + <tr> + <td>{L_DATABASE_SIZE}: </td> + <td><b>{DBSIZE}</b></td> + <td>{L_UPLOAD_DIR_SIZE}: </td> + <td><b>{UPLOAD_DIR_SIZE}</b></td> + </tr> + <tr> + <td>{L_DATABASE_SERVER_INFO}: </td> + <td><b>{DATABASE_INFO}</b></td> + <td>{L_GZIP_COMPRESSION}: </td> + <td><b>{GZIP_COMPRESSION}</b></td> + </tr> + <!-- IF S_TOTAL_ORPHAN --> + <tr> + <td> </td> + <td> </td> + <td>{L_NUMBER_ORPHAN}: </td> + <td><b>{TOTAL_ORPHAN}</b></td> + </tr> + <!-- ENDIF --> </tbody> </table> - <br /> - <div style="text-align: right;"><a href="{U_ADMIN_LOG}">» {L_VIEW_ADMIN_LOG}</a></div> + <!-- IF S_ACTION_OPTIONS --> + <form id="stats" method="post" action="{U_ACTION}"> + <fieldset class="quick"> + <select name="action">{S_ACTION_OPTIONS}</select> -<!-- ENDIF --> + <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" /> + </fieldset> + </form> + <!-- ENDIF --> -<!-- IF S_INACTIVE_USERS --> - <h2>{L_INACTIVE_USERS}</h2> + <!-- IF .log --> + <h2>{L_ADMIN_LOG}</h2> - <p>{L_INACTIVE_USERS_EXPLAIN}</p> + <p>{L_ADMIN_LOG_INDEX_EXPLAIN}</p> - <form id="inactive" method="post" action="{U_ACTION}"> + <table cellspacing="1"> + <thead> + <tr> + <th>{L_USERNAME}</th> + <th>{L_IP}</th> + <th>{L_TIME}</th> + <th>{L_ACTION}</th> + </tr> + </thead> + <tbody> + <!-- BEGIN log --> + <!-- IF log.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> + + <td>{log.USERNAME}</td> + <td style="text-align: center;">{log.IP}</td> + <td style="text-align: center;">{log.DATE}</td> + <td>{log.ACTION}</td> + </tr> + <!-- END log --> + </tbody> + </table> + + <br /> + <div style="text-align: right;"><a href="{U_ADMIN_LOG}">» {L_VIEW_ADMIN_LOG}</a></div> - <table cellspacing="1"> - <thead> - <tr> - <th>{L_USERNAME}</th> - <th>{L_JOINED}</th> - <th>{L_LAST_VISIT}</th> - <th>{L_MARK}</th> - </tr> - </thead> - <tbody> - <!-- BEGIN inactive --> - <!-- IF inactive.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> + <!-- ENDIF --> - <td><a href="{inactive.U_USER_ADMIN}">{inactive.USERNAME}</a></td> - <td>{inactive.DATE}</td> - <td>{inactive.LAST_VISIT}</td> - <td> <input type="checkbox" class="radio" name="mark[]" value="{inactive.USER_ID}" /> </td> - </tr> - <!-- BEGINELSE --> + <!-- IF S_INACTIVE_USERS --> + <h2>{L_INACTIVE_USERS}</h2> + + <p>{L_INACTIVE_USERS_EXPLAIN_INDEX}</p> + + <div style="text-align: right;"><a href="{U_INACTIVE_USERS}">» {L_VIEW_INACTIVE_USERS}</a></div> + + <table cellspacing="1"> + <thead> <tr> - <td colspan="3" style="text-align: center;">{L_NO_INACTIVE_USERS}</td> + <th>{L_USERNAME}</th> + <th>{L_JOINED}</th> + <th>{L_INACTIVE_DATE}</th> + <th>{L_INACTIVE_REASON}</th> + <th>{L_LAST_VISIT}</th> </tr> - <!-- END inactive --> - </tbody> - </table> - - <!-- IF .inactive --> - <fieldset class="quick"> - <p><a href="javascript:marklist('inactive', 'mark', true);">{L_MARK_ALL}</a> • <a href="javascript:marklist('inactive', 'mark', false);">{L_UNMARK_ALL}</a></p> - <select name="action">{S_INACTIVE_OPTIONS}</select> + </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> + </tr> + <!-- BEGINELSE --> + <tr> + <td colspan="5" style="text-align: center;">{L_NO_INACTIVE_USERS}</td> + </tr> + <!-- END inactive --> + </tbody> + </table> - <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" /> - </fieldset> <!-- ENDIF --> - </form> - <!-- ENDIF --> <!-- INCLUDE overall_footer.html -->
\ No newline at end of file diff --git a/phpBB/adm/style/acp_modules.html b/phpBB/adm/style/acp_modules.html index 3f27c94be3..e267d54410 100644 --- a/phpBB/adm/style/acp_modules.html +++ b/phpBB/adm/style/acp_modules.html @@ -21,16 +21,20 @@ function display_modes(value) { - // Remove select fields + // Find the old select tag var item = document.getElementById('module_mode'); - var j = 0; - - // empty existing items - for (var i = 0; i <= item.options.length; i++) - { - item.options[i] = null; - } + // Create the new select tag + var new_node = document.createElement('select'); + new_node.setAttribute('id', 'module_mode'); + + // Substitute it for the old one + item.parentNode.replaceChild(new_node, item); + + // Reset the variable + item = document.getElementById('module_mode'); + + var j = 0; <!-- BEGIN m_names --> if (value == '{m_names.NAME}') @@ -143,11 +147,22 @@ <!-- BEGIN modules --> <tr> <td style="width: 5%;">{modules.MODULE_IMAGE}</td> - <td style="width: 50%;"><a href="{modules.U_MODULE}">{modules.MODULE_TITLE}</a><!-- IF not modules.MODULE_DISPLAYED --> <span class="small">[{L_HIDDEN_MODULE}]</span><!-- ENDIF --></td> + <td><a href="{modules.U_MODULE}">{modules.MODULE_TITLE}</a><!-- IF not modules.MODULE_DISPLAYED --> <span class="small">[{L_HIDDEN_MODULE}]</span><!-- ENDIF --></td> <td style="width: 15%; white-space: nowrap; text-align: center; vertical-align: middle;"> <!-- IF modules.MODULE_ENABLED --><a href="{modules.U_DISABLE}">{L_DISABLE}</a><!-- ELSE --><a href="{modules.U_ENABLE}">{L_ENABLE}</a><!-- ENDIF --> </td> - <td style="width: 20%; white-space: nowrap; text-align: center; vertical-align: middle;"> - <!-- IF not modules.S_FIRST_ROW --><a href="{modules.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF --> - <!-- IF not modules.S_LAST_ROW --><a href="{modules.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF --> + <td style="width:90px; white-space: nowrap; text-align: right; vertical-align: middle;"> + <!-- IF modules.S_FIRST_ROW && not modules.S_LAST_ROW --> + {ICON_MOVE_UP_DISABLED} + <a href="{modules.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> + <!-- ELSEIF not modules.S_FIRST_ROW && not modules.S_LAST_ROW--> + <a href="{modules.U_MOVE_UP}">{ICON_MOVE_UP}</a> + <a href="{modules.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> + <!-- ELSEIF modules.S_LAST_ROW && not modules.S_FIRST_ROW --> + <a href="{modules.U_MOVE_UP}">{ICON_MOVE_UP}</a> + {ICON_MOVE_DOWN_DISABLED} + <!-- ELSE --> + {ICON_MOVE_UP_DISABLED} + {ICON_MOVE_DOWN_DISABLED} + <!-- ENDIF --> <a href="{modules.U_EDIT}">{ICON_EDIT}</a> <a href="{modules.U_DELETE}">{ICON_DELETE}</a> </td> diff --git a/phpBB/adm/style/acp_permission_roles.html b/phpBB/adm/style/acp_permission_roles.html index 0eca7e9273..1622fce7db 100644 --- a/phpBB/adm/style/acp_permission_roles.html +++ b/phpBB/adm/style/acp_permission_roles.html @@ -96,7 +96,7 @@ <h1>{L_ACL_TYPE}</h1> <fieldset class="quick"> - <a href="javascript: mark_options('a_options', 'y');">{L_ALL_YES}</a> • <a href="javascript: mark_options('a_options', 'n');">{L_ALL_NEVER}</a> • <a href="javascript: mark_options('a_options', 'u');">{L_ALL_NO}</a> + <a href="#" onclick="mark_options('a_options', 'y'); return false;">{L_ALL_YES}</a> • <a href="#" onclick="mark_options('a_options', 'n'); return false;">{L_ALL_NEVER}</a> • <a href="#" onclick="mark_options('a_options', 'u'); return false;">{L_ALL_NO}</a> </fieldset> <fieldset class="permissions"> @@ -121,7 +121,7 @@ <!-- ELSE --> <td class="preset preset_custom"> <!-- ENDIF --> - <a href="javascript:swap_options('options{auth.S_ROW_COUNT}');"><span></span></a></td> + <a href="#" onclick="swap_options('options{auth.S_ROW_COUNT}'); return false;"><span></span></a></td> <!-- END auth --> </tr> <tr class="row3"> @@ -131,9 +131,9 @@ <thead> <tr> <th scope="col" style="text-align: left; padding-left: 0;"><strong>{L_ACL_SETTING} [{auth.CAT_NAME}]</strong></th> - <th scope="col"><a href="javascript: mark_options('options{auth.S_ROW_COUNT}', 'y');">{L_ACL_YES}</a></th> - <th scope="col"><a href="javascript: mark_options('options{auth.S_ROW_COUNT}', 'u');">{L_ACL_NO}</a></th> - <th scope="col"><a href="javascript: mark_options('options{auth.S_ROW_COUNT}', 'n');">{L_ACL_NEVER}</a></th> + <th scope="col"><a href="#" onclick="mark_options('options{auth.S_ROW_COUNT}', 'y'); return false;">{L_ACL_YES}</a></th> + <th scope="col"><a href="#" onclick="mark_options('options{auth.S_ROW_COUNT}', 'u'); return false;">{L_ACL_NO}</a></th> + <th scope="col"><a href="#" onclick="mark_options('options{auth.S_ROW_COUNT}', 'n'); return false;">{L_ACL_NEVER}</a></th> </tr> </thead> <tbody> @@ -173,10 +173,10 @@ <form id="acp_roles" method="post" action="{U_ACTION}"> <table cellspacing="1"> - <col class="col1" /><col class="col1" /><col class="col2" /><col class="col2" /><col class="col2" /> + <col class="col2" /><col class="col2" /><col class="col1" /><col class="col2" /><col class="col2" /> <thead> <tr> - <th style="width: 50%">{L_ROLE_NAME}</th> + <th>{L_ROLE_NAME}</th> <th colspan="2">{L_OPTIONS}</th> </tr> </thead> @@ -186,10 +186,21 @@ <td style="vertical-align: top;"><b>{roles.ROLE_NAME}</b> <!-- IF roles.ROLE_DESCRIPTION --><br /><span>{roles.ROLE_DESCRIPTION}</span><!-- ENDIF --> </td> - <td style="vertical-align: top; white-space: nowrap;"><!-- IF roles.U_DISPLAY_ITEMS --><a href="{roles.U_DISPLAY_ITEMS}">{L_VIEW_ASSIGNED_ITEMS}</a><!-- ELSE -->{L_VIEW_ASSIGNED_ITEMS}<!-- ENDIF --></td> - <td style="vertical-align: top; white-space: nowrap;"> - <!-- IF not roles.S_FIRST_ROW --><a href="{roles.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF --> - <!-- IF not roles.S_LAST_ROW --><a href="{roles.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF --> + <td style="width: 30%; text-align: center; vertical-align: top; white-space: nowrap;"><!-- IF roles.U_DISPLAY_ITEMS --><a href="{roles.U_DISPLAY_ITEMS}">{L_VIEW_ASSIGNED_ITEMS}</a><!-- ELSE -->{L_VIEW_ASSIGNED_ITEMS}<!-- ENDIF --></td> + <td style="width: 80px; text-align: right; vertical-align: top; white-space: nowrap;"> + <!-- IF roles.S_FIRST_ROW && not roles.S_LAST_ROW --> + {ICON_MOVE_UP_DISABLED} + <a href="{roles.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> + <!-- ELSEIF not roles.S_FIRST_ROW && not roles.S_LAST_ROW--> + <a href="{roles.U_MOVE_UP}">{ICON_MOVE_UP}</a> + <a href="{roles.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> + <!-- ELSEIF roles.S_LAST_ROW && not roles.S_FIRST_ROW --> + <a href="{roles.U_MOVE_UP}">{ICON_MOVE_UP}</a> + {ICON_MOVE_DOWN_DISABLED} + <!-- ELSE --> + {ICON_MOVE_UP_DISABLED} + {ICON_MOVE_DOWN_DISABLED} + <!-- ENDIF --> <a href="{roles.U_EDIT}" title="{L_EDIT_ROLE}">{ICON_EDIT}</a> <a href="{roles.U_REMOVE}" title="{L_REMOVE_ROLE}">{ICON_DELETE}</a> </td> diff --git a/phpBB/adm/style/acp_permissions.html b/phpBB/adm/style/acp_permissions.html index 8694125b0d..e04ae5a717 100644 --- a/phpBB/adm/style/acp_permissions.html +++ b/phpBB/adm/style/acp_permissions.html @@ -89,7 +89,7 @@ <dl> <dt><label for="username">{L_FIND_USERNAME}:</label></dt> <dd><input class="medium" type="text" id="username" name="username[]" /></dd> - <dd>[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> + <dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> <dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</dd> </dl> </fieldset> @@ -134,7 +134,7 @@ <legend>{L_MANAGE_USERS}</legend> <dl> <dd class="full"><select style="width: 100%;" name="user_id[]" multiple="multiple" size="5">{S_DEFINED_USER_OPTIONS}</select></dd> - <dd class="full" style="text-align: right;"><input type="checkbox" class="radio" name="all_users" value="1" /> {L_ALL_USERS}</dd> + <!-- IF S_ALLOW_ALL_SELECT --><dd class="full" style="text-align: right;"><input type="checkbox" class="radio" name="all_users" value="1" /> {L_ALL_USERS}</dd><!-- ENDIF --> </dl> </fieldset> @@ -152,7 +152,7 @@ <p>{L_USERNAMES_EXPLAIN}</p> <dl> <dd class="full"><textarea id="username" name="usernames" rows="5" cols="5" style="width: 100%; height: 60px;"></textarea></dd> - <dd class="full" style="text-align: left;"><div style="float: right;">[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</div><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</dd> + <dd class="full" style="text-align: left;"><div style="float: right;">[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</div><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</dd> </dl> </fieldset> @@ -179,7 +179,7 @@ <legend>{L_MANAGE_GROUPS}</legend> <dl> <dd class="full"><select style="width: 100%;" name="group_id[]" multiple="multiple" size="5">{S_DEFINED_GROUP_OPTIONS}</select></dd> - <dd class="full" style="text-align: right;"><input type="checkbox" class="radio" name="all_groups" value="1" /> {L_ALL_GROUPS}</dd> + <!-- IF S_ALLOW_ALL_SELECT --><dd class="full" style="text-align: right;"><input type="checkbox" class="radio" name="all_groups" value="1" /> {L_ALL_GROUPS}</dd><!-- ENDIF --> </dl> </fieldset> @@ -239,7 +239,7 @@ <dl> <dt><label for="username">{L_FIND_USERNAME}:</label></dt> <dd><input type="text" id="username" name="username[]" /></dd> - <dd>[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> + <dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> <dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</dd> </dl> </fieldset> @@ -356,7 +356,7 @@ <fieldset class="quick" style="float: left; text-align: left;"> {L_PERMISSION_APPLIED_TO_ALL}<br /> - <a href="javascript:marklist('set_permissions', 'inherit', true);">{L_MARK_ALL}</a> • <a href="javascript:marklist('set_permissions', 'inherit', false);">{L_UNMARK_ALL}</a> + <a href="#" onclick="marklist('set_permissions', 'inherit', true); return false;">{L_MARK_ALL}</a> • <a href="#" onclick="marklist('set_permissions', 'inherit', false); return false;">{L_UNMARK_ALL}</a> </fieldset> <fieldset class="quick" style="float: right;"> diff --git a/phpBB/adm/style/acp_profile.html b/phpBB/adm/style/acp_profile.html index 809eb46bda..020da77327 100644 --- a/phpBB/adm/style/acp_profile.html +++ b/phpBB/adm/style/acp_profile.html @@ -27,10 +27,17 @@ <dt><label>{L_FIELD_TYPE}:</label><br /><span>{L_FIELD_TYPE_EXPLAIN}</span></dt> <dd><b>{FIELD_TYPE}</b></dd> </dl> + <!-- IF S_EDIT_MODE --> + <dl> + <dt><label>{L_FIELD_IDENT}:</label><br /><span>{L_FIELD_IDENT_EXPLAIN}</span></dt> + <dd><input type="hidden" name="field_ident" value="{FIELD_IDENT}" /><strong>{FIELD_IDENT}</strong></dd> + </dl> + <!-- ELSE --> <dl> <dt><label for="field_ident">{L_FIELD_IDENT}:</label><br /><span>{L_FIELD_IDENT_EXPLAIN}</span></dt> <dd><input class="medium" type="text" id="field_ident" name="field_ident" value="{FIELD_IDENT}" /></dd> </dl> + <!-- ENDIF --> <dl> <dt><label for="field_no_view">{L_DISPLAY_PROFILE_FIELD}:</label><br /><span>{L_DISPLAY_PROFILE_FIELD_EXPLAIN}</span></dt> <dd><input type="radio" class="radio" id="field_no_view" name="field_no_view" value="0"<!-- IF not S_FIELD_NO_VIEW --> checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" class="radio" name="field_no_view" value="1"<!-- IF S_FIELD_NO_VIEW --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd> @@ -154,14 +161,20 @@ <!-- ELSE --> <h1>{L_ACP_CUSTOM_PROFILE_FIELDS}</h1> - + + <!-- IF S_NEED_EDIT --> + <div class="errorbox"> + <h3>{L_WARNING}</h3> + <p>{L_CUSTOM_FIELDS_NOT_TRANSLATED}</p> + </div> + <!-- ENDIF --> + <table cellspacing="1"> <thead> <tr> <th>{L_FIELD_IDENT}</th> <th>{L_FIELD_TYPE}</th> - <th> </th> - <th>{L_OPTIONS}</th> + <th colspan="2">{L_OPTIONS}</th> </tr> </thead> <tbody> @@ -170,12 +183,24 @@ <td>{fields.FIELD_IDENT}</td> <td>{fields.FIELD_TYPE}</td> - <td><a href="{fields.U_ACTIVATE_DEACTIVATE}">{fields.L_ACTIVATE_DEACTIVATE}</a><!-- IF fields.S_NEED_EDIT --> | <a href="{fields.U_EDIT}"><span style="color:red;">{L_EDIT}</span><!-- ENDIF --></td> - - <td style="width: 15%; text-align: right; white-space: nowrap;"> - <!-- IF not fields.S_FIRST_ROW --><a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF --> - <!-- IF not fields.S_LAST_ROW --><a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF --> - <!-- IF not fields.S_NEED_EDIT --><a href="{fields.U_EDIT}">{ICON_EDIT}</a> <!-- ENDIF --> + <td style="text-align: center;"><a href="{fields.U_ACTIVATE_DEACTIVATE}">{fields.L_ACTIVATE_DEACTIVATE}</a><!-- IF fields.S_NEED_EDIT --> | <a href="{fields.U_TRANSLATE}" style="color: red;">{L_TRANSLATE}</a><!-- ENDIF --></td> + + <td style="width: 80px; text-align: right; white-space: nowrap;"> + <!-- IF fields.S_FIRST_ROW && not fields.S_LAST_ROW --> + {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> + <!-- ELSEIF fields.S_LAST_ROW && not fields.S_FIRST_ROW --> + <a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a> + {ICON_MOVE_DOWN_DISABLED} + <!-- ENDIF --> + <!-- IF not fields.S_NEED_EDIT --> + <a href="{fields.U_EDIT}">{ICON_EDIT}</a> + <!-- ELSE --> + {ICON_EDIT_DISABLED} + <!-- ENDIF --> <a href="{fields.U_DELETE}">{ICON_DELETE}</a> </td> diff --git a/phpBB/adm/style/acp_prune_forums.html b/phpBB/adm/style/acp_prune_forums.html index 22592f79c5..b6a9fac56a 100644 --- a/phpBB/adm/style/acp_prune_forums.html +++ b/phpBB/adm/style/acp_prune_forums.html @@ -25,7 +25,7 @@ </tr> <!-- BEGINELSE --> <tr> - <td class="row3" style="text-align: center;">{L_NO_PRUNE}</td> + <td colspan="3" class="row3" style="text-align: center;">{L_NO_PRUNE}</td> </tr> <!-- END pruned --> </tbody> diff --git a/phpBB/adm/style/acp_reasons.html b/phpBB/adm/style/acp_reasons.html index 93d23563e2..be987dd294 100644 --- a/phpBB/adm/style/acp_reasons.html +++ b/phpBB/adm/style/acp_reasons.html @@ -17,19 +17,37 @@ </div> <!-- ENDIF --> + <!-- IF not S_TRANSLATED --> + <h3>{L_AVAILABLE_TITLES}</h3> + + <p>{S_AVAILABLE_TITLES}</p> + <!-- ENDIF --> + <form id="acp_reasons" method="post" action="{U_ACTION}"> <fieldset> <legend>{L_TITLE}</legend> - <p><!-- IF S_TRANSLATED -->{L_IS_TRANSLATED}<!-- ELSE -->{L_IS_NOT_TRANSLATED}<!-- ENDIF --></p> + <p><!-- IF S_TRANSLATED -->{L_IS_TRANSLATED_EXPLAIN}<!-- ELSE -->{L_IS_NOT_TRANSLATED_EXPLAIN}<!-- ENDIF --></p> <dl> <dt><label for="reason_title">{L_REASON_TITLE}:</label></dt> <dd><input name="reason_title" type="text" id="reason_title" value="{REASON_TITLE}" /></dd> </dl> + <!-- IF S_TRANSLATED --> + <dl> + <dt>{L_REASON_TITLE_TRANSLATED}</dt> + <dd>{TRANSLATED_TITLE}</dd> + </dl> + <!-- ENDIF --> <dl> <dt><label for="reason_description">{L_REASON_DESCRIPTION}:</label></dt> <dd><textarea name="reason_description" id="reason_description" rows="8">{REASON_DESCRIPTION}</textarea></dd> </dl> + <!-- IF S_TRANSLATED --> + <dl> + <dt>{L_REASON_DESC_TRANSLATED}</dt> + <dd>{TRANSLATED_DESCRIPTION}</dd> + </dl> + <!-- ENDIF --> </fieldset> <fieldset class="submit-buttons"> @@ -64,11 +82,23 @@ <br /><span>{reasons.REASON_DESCRIPTION}</span> </td> <td style="width: 100px;">{reasons.REASON_COUNT}</td> - <td style="width: 15%; text-align: right; white-space: nowrap;"> - <!-- IF not reasons.S_FIRST_ROW --><a href="{reasons.U_MOVE_UP}">{ICON_MOVE_UP}</a> <!-- ENDIF --> - <!-- IF not reasons.S_LAST_ROW --><a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ENDIF --> + <td style="width: 80px; text-align: right; white-space: nowrap;"> + <!-- IF reasons.S_FIRST_ROW && not reasons.S_LAST_ROW --> + {ICON_MOVE_UP_DISABLED} + <a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> + <!-- ELSEIF not reasons.S_FIRST_ROW && not reasons.S_LAST_ROW--> + <a href="{reasons.U_MOVE_UP}">{ICON_MOVE_UP}</a> + <a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> + <!-- ELSEIF reasons.S_LAST_ROW && not reasons.S_FIRST_ROW --> + <a href="{reasons.U_MOVE_UP}">{ICON_MOVE_UP}</a> + {ICON_MOVE_DOWN_DISABLED} + <!-- ENDIF --> <a href="{reasons.U_EDIT}">{ICON_EDIT}</a> - <!-- IF reasons.U_DELETE --><a href="{reasons.U_DELETE}">{ICON_DELETE}</a><!-- ENDIF --> + <!-- IF reasons.U_DELETE --> + <a href="{reasons.U_DELETE}">{ICON_DELETE}</a> + <!-- ELSE --> + {ICON_DELETE_DISABLED} + <!-- ENDIF --> </td> </tr> <!-- END reasons --> diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html index fe6783e338..11f022ecbc 100644 --- a/phpBB/adm/style/acp_search.html +++ b/phpBB/adm/style/acp_search.html @@ -55,8 +55,8 @@ <!-- END backend --> <fieldset class="submit-buttons"> - <input class="button1" type="submit" id="submit" name="submit" value="Submit" /> - <input class="button2" type="reset" id="reset" name="reset" value="Reset" /> + <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /> + <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> </fieldset> </form> @@ -82,7 +82,7 @@ <p>{L_ACP_SEARCH_INDEX_EXPLAIN}</p> <!-- IF S_CONTINUE_INDEXING --> - <a href="{U_CONTINUE_INDEXING}" onclick="javascript:popup_progress_bar('{S_CONTINUE_INDEXING}');">{L_CONTINUE}</a> + <a href="{U_CONTINUE_INDEXING}" onclick="popup_progress_bar('{S_CONTINUE_INDEXING}');">{L_CONTINUE}</a> <p>{L_CONTINUE_EXPLAIN}</p> <!-- ELSE --> @@ -121,9 +121,9 @@ <fieldset class="quick"> <!-- IF backend.S_INDEXED --> - <input class="button2" type="submit" name="action[delete]" value="{L_DELETE_INDEX}" onclick="javascript:popup_progress_bar('delete')" /> + <input class="button2" type="submit" name="action[delete]" value="{L_DELETE_INDEX}" onclick="popup_progress_bar('delete');" /> <!-- ELSE --> - <input class="button2" type="submit" name="action[create]" value="{L_CREATE_INDEX}" onclick="javascript:popup_progress_bar('create')" /> + <input class="button2" type="submit" name="action[create]" value="{L_CREATE_INDEX}" onclick="popup_progress_bar('create');" /> <!-- ENDIF --> </fieldset> diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html index c448bf539f..8ac3e0c96b 100644 --- a/phpBB/adm/style/acp_styles.html +++ b/phpBB/adm/style/acp_styles.html @@ -330,7 +330,7 @@ </dl> <dl> <dt><label for="font_size">{L_FONT_SIZE}:</label></dt> - <dd><input id="font_size" name="font_size" type="text" value="{FONT_SIZE}" size="3" maxlength="3" /> <select id="font_size_unit" name="font_size_unit">{S_FONT_SIZE_UNITS}</select></dd> + <dd><input id="font_size" name="font_size" type="text" value="{FONT_SIZE}" size="5" maxlength="5" /> <select id="font_size_unit" name="font_size_unit">{S_FONT_SIZE_UNITS}</select></dd> </dl> <dl> <dt><label for="font_weight">{L_BOLD}:</label></dt> @@ -440,7 +440,7 @@ </table> <fieldset class="quick"> - <span class="small"><a href="javascript:marklist('acp_styles', 'delete', true);">Mark all</a> :: <a href="javascript:marklist('acp_styles', 'delete', false);">Unmark all</a></span><br /> + <span class="small"><a href="#" onclick="marklist('acp_styles', 'delete', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('acp_styles', 'delete', false); return false;">{L_UNMARK_ALL}</a></span><br /> <input class="button1" type="submit" id="submit" name="submit" value="{L_DELETE_MARKED}" /> </fieldset> @@ -537,7 +537,7 @@ <!-- ENDIF --> {installed.S_ACTIONS} <!-- IF S_STYLE --> - | <a href="{installed.U_PREVIEW}" onclick="this.target='_preview';">{L_PREVIEW}</a> + | <a href="{installed.U_PREVIEW}">{L_PREVIEW}</a> <!-- ENDIF --> </td> <!-- END installed --> diff --git a/phpBB/adm/style/acp_update.html b/phpBB/adm/style/acp_update.html new file mode 100644 index 0000000000..06672f39ae --- /dev/null +++ b/phpBB/adm/style/acp_update.html @@ -0,0 +1,40 @@ +<!-- INCLUDE overall_header.html --> + +<a name="maincontent"></a> + +<!-- IF S_VERSION_CHECK --> + + <h1>{L_VERSION_CHECK}</h1> + + <p>{L_VERSION_CHECK_EXPLAIN}</p> + + <!-- IF S_UP_TO_DATE --> + <div class="successbox"> + <p>{L_VERSION_UP_TO_DATE_ACP}</p> + </div> + <!-- ELSE --> + <div class="errorbox"> + <p>{L_VERSION_NOT_UP_TO_DATE_ACP}</p> + </div> + <!-- ENDIF --> + + <fieldset> + <legend></legend> + <dl> + <dt><label>{L_CURRENT_VERSION}</label></dt> + <dd><b>{CURRENT_VERSION}</b></dd> + </dl> + <dl> + <dt><label>{L_LATEST_VERSION}</label></dt> + <dd><b>{LATEST_VERSION}</b></dd> + </dl> + </fieldset> + + <!-- IF not S_UP_TO_DATE --> + {UPDATE_INSTRUCTIONS} + <br /><br /> + <!-- ENDIF --> + +<!-- ENDIF --> + +<!-- INCLUDE overall_footer.html -->
\ No newline at end of file diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html index 3b6d6388de..1e3fe7190b 100644 --- a/phpBB/adm/style/acp_users.html +++ b/phpBB/adm/style/acp_users.html @@ -15,7 +15,7 @@ <dl> <dt><label for="username">{L_FIND_USERNAME}:</label></dt> <dd><input class="medium" type="text" id="username" name="username" /></dd> - <dd>[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> + <dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> <dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="u" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</dd> </dl> </fieldset> @@ -68,7 +68,7 @@ <form id="mode_select" method="post" action="{U_MODE_SELECT}"> <fieldset class="quick"> - {L_SELECT_FORM}: <select name="mode" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_FORM_OPTIONS}</select> + {L_SELECT_FORM}: <select name="mode" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_FORM_OPTIONS}</select> <input class="button2" type="submit" value="{L_GO}" /> </fieldset> </form> @@ -83,7 +83,7 @@ <legend>{L_ACP_USER_OVERVIEW}</legend> <dl> <dt><label for="user">{L_USERNAME}:</label><br /><span>{L_NAME_CHARS_EXPLAIN}</span></dt> - <dd><input type="text" id="user" name="user" value="{USER}" /></dd> + <dd><input type="text" id="user" name="user" value="{USER}" /><!-- IF S_USER_INACTIVE --> [{L_USER_IS_INACTIVE}]<!-- ENDIF --></dd> <!-- IF U_SWITCH_PERMISSIONS --><dd>[ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]</dd><!-- ENDIF --> </dl> <dl> @@ -168,7 +168,7 @@ <!-- IF PAGINATION --> <div class="pagination"> <!-- IF PAGINATION --> - <a href="javascript:jumpto();" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> + <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> <!-- ELSE --> {S_ON_PAGE} <!-- ENDIF --> @@ -546,22 +546,26 @@ bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->); imageTag = false; - // Helpline messages - b_help = "{LA_BBCODE_B_HELP}"; - i_help = "{LA_BBCODE_I_HELP}"; - u_help = "{LA_BBCODE_U_HELP}"; - q_help = "{LA_BBCODE_Q_HELP}"; - c_help = "{LA_BBCODE_C_HELP}"; - l_help = "{LA_BBCODE_L_HELP}"; - o_help = "{LA_BBCODE_O_HELP}"; - p_help = "{LA_BBCODE_P_HELP}"; - w_help = "{LA_BBCODE_W_HELP}"; - a_help = "{LA_BBCODE_A_HELP}"; - s_help = "{LA_BBCODE_S_HELP}"; - f_help = "{LA_BBCODE_F_HELP}"; - e_help = "{LA_BBCODE_E_HELP}"; - d_help = "{LA_BBCODE_D_HELP}"; - <!-- BEGIN custom_tags -->cb_{custom_tags.BBCODE_ID}_help = "{custom_tags.BBCODE_HELPLINE}";<!-- END custom_tags --> +// Helpline messages +var help_line = { + b: '{LA_BBCODE_B_HELP}', + i: '{LA_BBCODE_I_HELP}', + u: '{LA_BBCODE_U_HELP}', + q: '{LA_BBCODE_Q_HELP}', + c: '{LA_BBCODE_C_HELP}', + l: '{LA_BBCODE_L_HELP}', + o: '{LA_BBCODE_O_HELP}', + p: '{LA_BBCODE_P_HELP}', + w: '{LA_BBCODE_W_HELP}', + a: '{LA_BBCODE_A_HELP}', + s: '{LA_BBCODE_S_HELP}', + f: '{LA_BBCODE_F_HELP}', + e: '{LA_BBCODE_E_HELP}', + d: '{LA_BBCODE_D_HELP}' + <!-- BEGIN custom_tags --> + ,cb_{custom_tags.BBCODE_ID}: '{custom_tags.BBCODE_HELPLINE}' + <!-- END custom_tags --> +} //--> </script> @@ -587,9 +591,15 @@ <input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" /> <input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" /> <input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" /> - <!-- IF S_BBCODE_IMG --><input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /><!-- ENDIF --> - <input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" onmouseover="helpline('d')" /> - <!-- IF S_BBCODE_FLASH --><input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" /><!-- ENDIF --> + <!-- IF S_BBCODE_IMG --> + <input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /> + <!-- ENDIF --> + <!-- IF S_LINKS_ALLOWED --> + <input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" onmouseover="helpline('d')" /> + <!-- ENDIF --> + <!-- IF S_BBCODE_FLASH --> + <input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" /> + <!-- ENDIF --> {L_FONT_SIZE}: <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')"> <option value="7">{L_FONT_TINY}</option> @@ -598,7 +608,7 @@ <option value="18">{L_FONT_LARGE}</option> <option value="24">{L_FONT_HUGE}</option> </select> - <a href="javascript:bbstyle(-1)" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a> + <a href="#" onclick="bbstyle(-1); return false;" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a> <!-- IF .custom_tags --> <br /><br /> <!-- BEGIN custom_tags --> @@ -615,10 +625,16 @@ </dt> <dd style="text-align: left; margin-left: 95px;"><textarea name="signature" rows="10" cols="60" style="width: 80%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></dd> <dd style="text-align: left; margin-left: 95px;"> - <!-- IF S_BBCODE_ALLOWED --><input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} /> {L_DISABLE_BBCODE} <!-- ENDIF --> - <!-- IF S_SMILIES_ALLOWED --><input type="checkbox" class="radio" name="disable_smilies"{S_SMILIES_CHECKED} /> {L_DISABLE_SMILIES} <!-- ENDIF --> - <input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} /> {L_DISABLE_MAGIC_URL} - <br /><br /><strong>{L_OPTIONS}: </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {SMILIES_STATUS} + <!-- IF S_BBCODE_ALLOWED --> + <input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} /> {L_DISABLE_BBCODE} + <!-- ENDIF --> + <!-- IF S_SMILIES_ALLOWED --> + <input type="checkbox" class="radio" name="disable_smilies"{S_SMILIES_CHECKED} /> {L_DISABLE_SMILIES} + <!-- ENDIF --> + <!-- IF S_LINKS_ALLOWED --> + <input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} /> {L_DISABLE_MAGIC_URL} + <!-- ENDIF --> + <br /><br /><strong>{L_OPTIONS}: </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS} </dd> </dl> </fieldset> @@ -669,7 +685,7 @@ <div class="pagination" style="float: right;"> <!-- IF PAGINATION --> - <a href="javascript:jumpto();" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> + <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> <!-- ELSE --> {S_ON_PAGE} <!-- ENDIF --> diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index c1bac3d3c6..49ffae98af 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -18,6 +18,7 @@ html { font-size: 100%; height: 100%; margin-bottom: 1px; + background-color: #E4EDF0; } body { @@ -257,7 +258,7 @@ span.corners-top span, span.corners-bottom span { border-top: 1px solid #FFFFFF; } -#menu li a:hover span, #menu li#activemenu span { +#menu li a:hover span, #menu li#activemenu span, #menu li a:hover { text-decoration: none; background-color: #FFA34F; color: #FFFFFF; @@ -919,7 +920,8 @@ table.pmask td.name { } .errorbox { - background-color: #ECECEC; + background-color: #ECD7DA; + color: #990000; } .successbox h3, .errorbox h3 { diff --git a/phpBB/adm/style/colour_swatch.html b/phpBB/adm/style/colour_swatch.html index 19fa008d00..e7d7d03f14 100644 --- a/phpBB/adm/style/colour_swatch.html +++ b/phpBB/adm/style/colour_swatch.html @@ -1,7 +1,9 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> +<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}"> <head> +<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" /> <meta http-equiv="Content-Style-Type" content="text/css" /> +<meta http-equiv="Content-Language" content="{S_USER_LANG}" /> <meta http-equiv="imagetoolbar" content="no" /> <title>{L_COLOUR_SWATCH}</title> @@ -57,7 +59,7 @@ { color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]); document.write('<td style="background-color: #' + color + ';" onmouseover="this.className=\'over\'" onmouseout="this.className=\'out\'">'); - document.write('<a href="javascript:cell(\'' + color + '\');"><img src="{T_IMAGES_PATH}spacer.gif" width="15" height="12" alt="#' + color + '" title="#' + color + '" \/><\/a>'); + document.write('<a href="#" onclick="cell(\'' + color + '\'); return false;"><img src="{T_IMAGES_PATH}spacer.gif" width="15" height="12" alt="#' + color + '" title="#' + color + '" \/><\/a>'); document.writeln('<\/td>'); } } diff --git a/phpBB/adm/style/editor.js b/phpBB/adm/style/editor.js index 6fff9c0deb..9591fc67d1 100644 --- a/phpBB/adm/style/editor.js +++ b/phpBB/adm/style/editor.js @@ -33,7 +33,7 @@ function getarraysize(thearray) { for (i = 0; i < thearray.length; i++) { - if (thearray[i] == 'undefined' || thearray[i] == '' || thearray[i] == null) + if (typeof thearray[i] == 'undefined' || thearray[i] == '' || thearray[i] == null) { return i; } @@ -208,7 +208,7 @@ function addquote(post_id, username) theSelection = document.selection.createRange().text; } - if (theSelection == '') + if (theSelection == '' || typeof theSelection == 'undefined' || theSelection == null) { if (document.all) { @@ -485,7 +485,7 @@ function colorPalette(dir, width, height) { color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]); document.write('<td style="line-height: ' + height + 'px; background-color:#' + color + '; width: ' + width + 'px; height: ' + height + 'px;">'); - document.write('<a href="javascript:bbfontstyle(\'[color=#' + color + ']\', \'[/color]\');" onmouseover="helpline(\'s\');"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>'); + document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;" onmouseover="helpline(\'s\');"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>'); document.writeln('</td>'); } diff --git a/phpBB/adm/style/install_header.html b/phpBB/adm/style/install_header.html index 7f1d002511..3b1d36776e 100755 --- a/phpBB/adm/style/install_header.html +++ b/phpBB/adm/style/install_header.html @@ -1,9 +1,10 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}"> +<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}"> <head> <meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" /> <meta http-equiv="Content-Style-Type" content="text/css" /> +<meta http-equiv="Content-Language" content="{S_USER_LANG}" /> <meta http-equiv="imagetoolbar" content="no" /> <!-- IF META -->{META}<!-- ENDIF --> <title>{PAGE_TITLE}</title> diff --git a/phpBB/adm/style/install_install.html b/phpBB/adm/style/install_install.html index 07de87fd31..f84f55d7b1 100755 --- a/phpBB/adm/style/install_install.html +++ b/phpBB/adm/style/install_install.html @@ -2,8 +2,8 @@ <form id="install_install" method="post" action="{U_ACTION}"> -<h2>{TITLE}</h2> -<p>{BODY}</p> +<!-- IF TITLE --><h2>{TITLE}</h2><!-- ENDIF --> +<!-- IF BODY --><p>{BODY}</p><!-- ENDIF --> <!-- IF .checks --> <fieldset> diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html new file mode 100644 index 0000000000..16ce338e30 --- /dev/null +++ b/phpBB/adm/style/install_update.html @@ -0,0 +1,278 @@ +<!-- INCLUDE install_header.html --> + +<!-- IF S_ERROR --> + <h1>{L_NOTICE}</h1> + <p style="color: red;">{ERROR_MSG}</p> +<!-- ENDIF --> + +<!-- IF S_INTRO --> + <form id="install_update" method="post" action="{U_ACTION}"> + + <h1>{L_UPDATE_INSTALLATION}</h1> + <p>{L_UPDATE_INSTALLATION_EXPLAIN}</p> + + <fieldset class="submit-buttons"> + <input class="button1" type="submit" name="submit" value="{L_NEXT}" /> + </fieldset> + + </form> + +<!-- ELSEIF S_UPLOAD_SUCCESS --> + + <form id="install_update" method="post" action="{U_ACTION}"> + + <h1>{L_UPDATE_SUCCESS}</h1> + <p>{L_UPDATE_SUCCESS_EXPLAIN}</p> + + <fieldset class="submit-buttons"> + <input class="button1" type="submit" name="submit" value="{L_CHECK_FILES_AGAIN}" /> + </fieldset> + + </form> + +<!-- ENDIF --> + +<!-- IF S_VERSION_CHECK --> + + <h1>{L_VERSION_CHECK}</h1> + + <p>{L_VERSION_CHECK_EXPLAIN}</p> + + <!-- IF S_UP_TO_DATE --> + <div class="successbox"> + <p>{L_VERSION_UP_TO_DATE}</p> + </div> + <!-- ELSE --> + <div class="errorbox"> + <p>{L_VERSION_NOT_UP_TO_DATE}</p> + </div> + <!-- ENDIF --> + + <fieldset> + <legend></legend> + <dl> + <dt><label>{L_CURRENT_VERSION}</label></dt> + <dd><b>{CURRENT_VERSION}</b></dd> + </dl> + <dl> + <dt><label>{L_LATEST_VERSION}</label></dt> + <dd><b>{LATEST_VERSION}</b></dd> + </dl> + </fieldset> + + <!-- IF not S_UP_TO_DATE --> + <form id="install_update" method="post" action="{U_ACTION}"> + + <fieldset class="submit-buttons"> + <p>{L_CHECK_FILES_EXPLAIN}</p> + <input class="button1" type="submit" name="submit" value="{L_CHECK_FILES}" /> + </fieldset> + + </form> + <!-- ELSE --> + <form id="install_update" method="post" action="{U_ACTION}"> + + <fieldset class="submit-buttons"> + <p>{L_CHECK_FILES_UP_TO_DATE}</p> + <input class="button1" type="submit" name="submit" value="{L_CHECK_FILES}" /> + </fieldset> + + </form> + <!-- ENDIF --> + +<!-- ELSEIF S_FILE_CHECK --> + + <h1>{L_COLLECTED_INFORMATIONS}</h1> + + <p>{L_COLLECTED_INFORMATIONS_EXPLAIN}</p> + + <!-- IF S_NO_UPDATE_FILES --> + <div class="errorbox"> + <h3>{L_NO_UPDATE_FILES}</h3> + + <p>{L_NO_UPDATE_FILES_EXPLAIN}</p><br /> + + <strong>{NO_UPDATE_FILES}</strong> + + </div> + <!-- ENDIF --> + + <form id="install_update" method="post" action="{U_UPDATE_ACTION}"> + + <!-- IF .files --> + <!-- BEGIN files --> + <!-- IF files.S_STATUS --> + <!-- IF not files.S_FIRST_ROW --> + </fieldset> + <!-- ENDIF --> + + <h2>{files.TITLE}</h2> + + <p>{files.EXPLAIN}</p> + + <!--table cellspacing="1"> + <col class="row1" /><col class="row2" /><col class="row2" /> + <tbody --> + <fieldset> + <legend><img src="{T_IMAGE_PATH}file_{files.STATUS}.gif" alt="{files.L_STATUS}" /></legend> + <!-- ELSE --> + <dl> + <!-- IF files.STATUS eq 'up_to_date' --> + <dd class="full" style="text-align: left;"><strong>{files.FILENAME}</strong></dd> + <!-- ELSE --> + <dt> + <strong>{files.FILENAME}</strong> + <!-- IF files.S_CUSTOM --> + <br /><span><em>{L_FILE_USED}: </em>{files.CUSTOM_ORIGINAL}</span> + <!-- ENDIF --> + <!-- IF files.NUM_CONFLICTS --> + <br /><span>{L_NUM_CONFLICTS}: {files.NUM_CONFLICTS}</span> + <!-- ENDIF --> + </dt> + <dd>[ <a href="{files.U_SHOW_DIFF}" onclick="popup({files.UA_SHOW_DIFF}, 700, 500);">{files.L_SHOW_DIFF}</a> ]</dd> + <!-- IF files.S_CUSTOM --> + <dd><input type="checkbox" name="no_update[]" value="{files.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</dd> + <!-- ENDIF --> + <!-- IF files.STATUS eq 'conflict' --> + <dd><input type="radio" class="radio" name="conflict[{files.FILENAME}]" value="1" checked="checked" /> {L_MERGE_NEW_FILE_OPTION}<br /><input type="radio" class="radio" name="conflict[{files.FILENAME}]" value="2" /> {L_MERGE_MOD_FILE_OPTION}</dd> + <!-- ENDIF --> + <!-- ENDIF --> + </dl> + <!-- ENDIF --> + <!-- END files --> + + </fieldset> + <!-- ENDIF --> + + <br /> + + <fieldset class="quick"> + <input class="button1" type="submit" name="check_again" value="{L_CHECK_FILES_AGAIN}" /> + </fieldset> + + <br /> + + <!-- IF S_ALL_UP_TO_DATE --> + </form> + + <!-- IF S_VERSION_UP_TO_DATE --> + <p>{L_NO_DATABASE_UPDATE_NEEDED}</p> + <!-- ELSE --> + <form id="install_dbupdate" method="post" action="{U_DB_UPDATE_ACTION}"> + + <fieldset class="submit-buttons"> + <p>{L_ALL_FILES_UP_TO_DATE}</p> + <input class="button1" type="submit" name="db_update" value="{L_UPDATE_DATABASE}" /> + </fieldset> + <!-- ENDIF --> + + <!-- ELSE --> + <h1>{L_UPDATE_METHOD}</h1> + + <p>{L_UPDATE_METHOD_EXPLAIN}</p> + + <fieldset class="submit-buttons"> + <input class="button1" type="submit" name="ftp_upload" value="{L_FTP_UPDATE_METHOD}" /> <input class="button1" type="submit" name="download" value="{L_DOWNLOAD_UPDATE_METHOD}" /> + </fieldset> + + <!-- ENDIF --> + + </form> + +<!-- ELSEIF S_DOWNLOAD_FILES --> + + <h1>{L_SELECT_DOWNLOAD_FORMAT}</h1> + + <p>{L_DOWNLOAD_UPDATE_METHOD_EXPLAIN}</p> + + <p>{L_MAPPING_FILE_STRUCTURE}</p> + + <table cellspacing="1"> + <col class="row1" /><col class="row2" /><col class="row1" /> + <thead> + <tr> + <th style="width: 49%">{L_ARCHIVE_FILE}</th> + <th style="width: 2%"> </th> + <th style="width: 49%">{L_DESTINATION}</th> + </tr> + </thead> + <tbody> + <!-- BEGIN location --> + <tr> + <td>{location.SOURCE}</td> + <td><strong>»</strong></td> + <td>{location.DESTINATION}</td> + </tr> + <!-- END location --> + </tbody> + </table> + + <form id="install_update" method="post" action="{U_ACTION}"> + + <fieldset> + <legend>{L_DOWNLOAD_AS}</legend> + <dl> + <dt><label for="use_method">{L_DOWNLOAD_AS}:</label></dt> + <dd>{RADIO_BUTTONS}</dd> + </dl> + </fieldset> + + <fieldset class="submit-buttons"> + {S_HIDDEN_FIELDS} + <input type="submit" class="button2" value="{L_CHECK_FILES_AGAIN}" name="check_again" /> <input type="submit" class="button1" value="{L_DOWNLOAD}" name="download" /> + </fieldset> + + </form> + +<!-- ELSEIF S_FTP_UPLOAD --> + + <h1>{L_SELECT_FTP_SETTINGS}</h1> + + <form id="install_update" method="post" action="{U_ACTION}"> + + <!-- IF S_CONNECTION_SUCCESS --> + <div class="successbox"> + <p>{L_CONNECTION_SUCCESS}</p> + </div> + <!-- ELSEIF S_CONNECTION_FAILED --> + <div class="errorbox"> + <p>{L_CONNECTION_FAILED}<br />{ERROR_MSG}</p> + </div> + <!-- ENDIF --> + + <fieldset> + <legend>{L_FTP_SETTINGS}</legend> + <dl> + <dt><label>{L_UPLOAD_METHOD}:</label></dt> + <dd><b>{UPLOAD_METHOD}</b></dd> + </dl> + <!-- BEGIN data --> + <dl> + <dt><label for="{data.DATA}">{data.NAME}:</label><br /><span>{data.EXPLAIN}</span></dt> + <dd><input type="text" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" /></dd> + </dl> + <!-- END data --> + </fieldset> + + <fieldset class="submit-buttons"> + {S_HIDDEN_FIELDS} + <input class="button2" type="submit" name="check_again" value="{L_BACK}" /> + <input class="button1" type="submit" name="test_connection" value="{L_TEST_CONNECTION}" /> + <input class="button1" type="submit" name="submit" value="{L_UPDATE_FILES}" /> + </fieldset> + + </form> + +<!-- ELSEIF S_DB_UPDATE --> + + <h1>{L_PERFORM_DATABASE_UPDATE}</h1> + + <p> + {L_PERFORM_DATABASE_UPDATE_EXPLAIN}<br /> + <br /> + <a href="{U_DB_UPDATE}"><strong>» {L_RUN_DATABASE_SCRIPT} «</strong></a> + </p> + +<!-- ENDIF --> + +<!-- INCLUDE install_footer.html --> diff --git a/phpBB/adm/style/install_update_diff.html b/phpBB/adm/style/install_update_diff.html new file mode 100644 index 0000000000..cdc0d8cc21 --- /dev/null +++ b/phpBB/adm/style/install_update_diff.html @@ -0,0 +1,181 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}"> +<head> + +<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" /> +<meta http-equiv="Content-Style-Type" content="text/css" /> +<meta http-equiv="Content-Language" content="{S_USER_LANG}" /> +<meta http-equiv="imagetoolbar" content="no" /> +<!-- IF META -->{META}<!-- ENDIF --> +<title>{PAGE_TITLE}</title> + +<link href="../adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" /> + +<style type="text/css"> +<!-- + +#main { + font-size: 1.25em; + line-height: 0.7em; + margin: 0; + padding: 0; + width: 99%; +} + +<!-- IF not S_DIFF_NEW_FILE --> + +/** +* Unified Diff +*/ +.file { + border: 1px solid #eee; + line-height: .7em; +} + +.diff { + margin: 0; +} + +.added { + background-color: #dfd; +} + +.removed { + background-color: #fdd; +} + +.info { + color: #888; +} + +.context { + background-color: #eee; +} + +/** +* Inline Diff +*/ +.ins { + background-color: #dfd; + text-decoration: underline; +} + +.del { + background-color: #fdd; + text-decoration: line-through; +} + +/** +* Column Diff +*/ +table.hrdiff { + width: 99%; + margin: 0 0 8px 5px; +} + +table.hrdiff th { + text-align: left; + width: 50%; + color: #333; + font-family: Verdana,Helvetica,sans-serif; + font-size: 11px; + border-bottom: 1px solid #999; + background: transparent; +} + +table.hrdiff thead th { + font-weight: bold; + font-size: 110%; + padding: 2px; +} + +table.hrdiff tbody th { + padding: 2em 1px 1px 1px; + font-size: 80%; +} + +table.hrdiff .unmodified { + background: #fff; +} + +table.hrdiff .added { + background: #9f9; +} + +table.hrdiff .added_empty { + background: #cfc; +} + +table.hrdiff .modified { + background: #fd9; +} + +table.hrdiff .removed { + background: #f99; +} + +table.hrdiff .removed_empty { + background: #fcc; +} + +table.hrdiff caption { + caption-side: top; + text-align: left; + margin: 0 0 8px 5px; + font-size: 90%; + font-weight: bold; + padding: 5px; +} + +table.hrdiff caption span { + height: 10px; + width: 10px; + line-height: 10px; + letter-spacing: 10px; + border: 1px solid #000; + margin-left: 0.5em; + vertical-align: baseline; +} + +<!-- ENDIF --> + +//--> +</style> + +</head> + +<body> + +<div id="wrap"> + <div id="page-header"> +<!-- IF S_DIFF_NEW_FILE --> + <h1>{L_VIEWING_FILE_CONTENTS}</h1> +<!-- ELSE --> + <h1>{L_VIEWING_FILE_DIFF}</h1> +<!-- ENDIF --> +<!-- IF not S_DIFF_NEW_FILE --> + <br /> + <form method="post"> + <label for="diff_mode">{L_SELECT_DIFF_MODE}:</label> + <select name="diff_mode" id="diff_mode">{S_DIFF_MODE_OPTIONS}</select> + <input class="button1" type="submit" id="submit" name="submit" value="{L_CHANGE}" /> + </form> +<!-- ENDIF --> + </div> + + <div id="page-body"> + <div class="panel"> + <span class="corners-top"><span></span></span> + <div id="content"> + <div id="main"> +<!-- IF S_DIFF_CONFLICT_FILE --> + <div style="float: right;"><strong>{L_NUM_CONFLICTS}: {NUM_CONFLICTS}</strong></div> +<!-- ENDIF --> + {DIFF_CONTENT} + </div> + </div> + <span class="corners-bottom"><span></span></span> + </div> + </div> + +<!-- INCLUDE simple_footer.html -->
\ No newline at end of file diff --git a/phpBB/adm/style/message_body.html b/phpBB/adm/style/message_body.html index 17db5aca37..5d907e911c 100644 --- a/phpBB/adm/style/message_body.html +++ b/phpBB/adm/style/message_body.html @@ -1,6 +1,6 @@ <!-- INCLUDE overall_header.html --> -<div class="successbox"> +<div <!-- IF S_USER_NOTICE -->class="successbox"<!-- ELSE -->class="errorbox"<!-- ENDIF -->> <h3>{MESSAGE_TITLE}</h3> <p>{MESSAGE_TEXT}</p> </div> diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index 518ce835f2..0cdf9636e8 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -1,9 +1,10 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}"> +<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}"> <head> <meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" /> <meta http-equiv="Content-Style-Type" content="text/css" /> +<meta http-equiv="Content-Language" content="{S_USER_LANG}" /> <meta http-equiv="imagetoolbar" content="no" /> <!-- IF META -->{META}<!-- ENDIF --> <title>{PAGE_TITLE}</title> diff --git a/phpBB/adm/style/permission_mask.html b/phpBB/adm/style/permission_mask.html index c521d7f33d..d841dbd31f 100644 --- a/phpBB/adm/style/permission_mask.html +++ b/phpBB/adm/style/permission_mask.html @@ -160,7 +160,7 @@ <!-- IF not p_mask.S_VIEW --><input type="checkbox" class="radio" name="inherit[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" value="1" /><!-- ELSE --> <!-- ENDIF --> </span> </td> - <td>{p_mask.f_mask.PADDING}<!-- IF p_mask.f_mask.FOLDER_IMAGE --> {p_mask.f_mask.FOLDER_IMAGE} <!-- ENDIF --><a href="javascript:swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '0');">{p_mask.f_mask.NAME}</a></span></td> + <td><span>{p_mask.f_mask.PADDING}<!-- IF p_mask.f_mask.FOLDER_IMAGE --> {p_mask.f_mask.FOLDER_IMAGE} <!-- ENDIF --><a href="#" onclick="swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '0'); return false;">{p_mask.f_mask.NAME}</a></span></td> <td style="text-align: right;"> <!-- IF p_mask.S_VIEW --> @@ -186,7 +186,7 @@ <!-- ELSE --> <td class="preset preset_custom"> <!-- ENDIF --> - <a href="javascript:swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '{p_mask.f_mask.category.S_ROW_COUNT}');"><span></span></a></td> + <a href="#" onclick="swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '{p_mask.f_mask.category.S_ROW_COUNT}'); return false;"><span></span></a></td> <!-- END category --> </tr> <tr class="row3"> @@ -199,9 +199,9 @@ </div> <div style="float: right; text-align: right; width: 35%;"> <p class="small"> - [<a href="javascript: mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'y'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ALL_YES}</a>]<br /> - [<a href="javascript: mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'n'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ALL_NEVER}</a>]<br /> - [<a href="javascript: mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'u'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ALL_NO}</a>] + [<a href="#" onclick="mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'y'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ALL_YES}</a>]<br /> + [<a href="#" onclick="mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'n'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ALL_NEVER}</a>]<br /> + [<a href="#" onclick="mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'u'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ALL_NO}</a>] </p> </div> <!-- ELSE --> @@ -220,16 +220,16 @@ <th scope="col">{L_ACL_YES}</th> <th scope="col">{L_ACL_NEVER}</th> <!-- ELSE --> - <th scope="col"><a href="javascript: mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'y'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ACL_YES}</a></th> - <th scope="col"><a href="javascript: mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'u'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ACL_NO}</a></th> - <th scope="col"><a href="javascript: mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'n'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}');">{L_ACL_NEVER}</a></th> + <th scope="col"><a href="#" onclick="mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'y'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ACL_YES}</a></th> + <th scope="col"><a href="#" onclick="mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'u'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ACL_NO}</a></th> + <th scope="col"><a href="#" onclick="mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'n'); reset_role('role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_ACL_NEVER}</a></th> <!-- ENDIF --> </tr> </thead> <tbody> <!-- BEGIN mask --> <!-- IF p_mask.f_mask.category.mask.S_ROW_COUNT is even --><tr class="row4"><!-- ELSE --><tr class="row3"><!-- ENDIF --> - <th><!-- IF p_mask.f_mask.category.mask.U_TRACE --><a href="#" onclick="javascript:trace('{p_mask.f_mask.category.mask.U_TRACE}')" title="{L_TRACE_SETTING}"><img src="images/icon_trace.gif" alt="{L_TRACE_SETTING}" /></a> <!-- ENDIF -->{p_mask.f_mask.category.mask.PERMISSION}</th> + <th><!-- IF p_mask.f_mask.category.mask.U_TRACE --><a href="#" onclick="trace('{p_mask.f_mask.category.mask.U_TRACE}'); return false;" title="{L_TRACE_SETTING}"><img src="images/icon_trace.gif" alt="{L_TRACE_SETTING}" /></a> <!-- ENDIF -->{p_mask.f_mask.category.mask.PERMISSION}</th> <!-- IF p_mask.S_VIEW --> <td<!-- IF p_mask.f_mask.category.mask.S_YES --> class="yes"<!-- ELSE --> class="no"<!-- ENDIF -->> </td> <td<!-- IF p_mask.f_mask.category.mask.S_NEVER --> class="never"<!-- ELSE --> class="no"<!-- ENDIF -->> </td> diff --git a/phpBB/adm/style/search_index_progress_bar.html b/phpBB/adm/style/progress_bar.html index ef9590119f..ef9590119f 100644 --- a/phpBB/adm/style/search_index_progress_bar.html +++ b/phpBB/adm/style/progress_bar.html diff --git a/phpBB/adm/style/simple_footer.html b/phpBB/adm/style/simple_footer.html index 6ac945912d..bcc3f037eb 100644 --- a/phpBB/adm/style/simple_footer.html +++ b/phpBB/adm/style/simple_footer.html @@ -1,4 +1,4 @@ - <div style="text-align: right;"><a href="#" onclick="javascript: self.close();">{L_CLOSE_WINDOW}</a></div> + <div style="text-align: right;"><a href="#" onclick="self.close(); return false;">{L_CLOSE_WINDOW}</a></div> <br /><br /> </div> diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html index 836c2b8a52..b234ad6456 100644 --- a/phpBB/adm/style/simple_header.html +++ b/phpBB/adm/style/simple_header.html @@ -1,9 +1,10 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}"> +<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}"> <head> <meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" /> <meta http-equiv="Content-Style-Type" content="text/css" /> +<meta http-equiv="Content-Language" content="{S_USER_LANG}" /> <meta http-equiv="imagetoolbar" content="no" /> <!-- IF META -->{META}<!-- ENDIF --> <title>{PAGE_TITLE}</title> diff --git a/phpBB/common.php b/phpBB/common.php index c69ee4395e..73f30e17a5 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -99,7 +99,15 @@ else if (defined('IN_CRON')) { chdir($phpbb_root_path); - $phpbb_root_path = getcwd() . '/'; + if (@function_exists('getcwd')) + { + $phpbb_root_path = getcwd() . '/'; + } + else + { + // This is a best guess + $phpbb_root_path = pathinfo($_SERVER['SCRIPT_FILENAME'], PATHINFO_DIRNAME) . '/'; + } } if (!file_exists($phpbb_root_path . 'config.' . $phpEx)) @@ -170,6 +178,7 @@ require($phpbb_root_path . 'includes/auth.' . $phpEx); require($phpbb_root_path . 'includes/functions.' . $phpEx); require($phpbb_root_path . 'includes/constants.' . $phpEx); require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); +require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); // Set PHP error handler to ours set_error_handler('msg_handler'); @@ -189,7 +198,6 @@ unset($dbpasswd); // Grab global variables, re-cache if necessary $config = $cache->obtain_config(); -$dss_seeded = false; // Disable board if the install/ directory is still present if (file_exists($phpbb_root_path . 'install') && !defined('ADMIN_START')) diff --git a/phpBB/cron.php b/phpBB/cron.php index 38bcd38d3e..99a8b42955 100644 --- a/phpBB/cron.php +++ b/phpBB/cron.php @@ -23,6 +23,15 @@ $auth->acl($user->data); $cron_type = request_var('cron_type', ''); $use_shutdown_function = (@function_exists('register_shutdown_function')) ? true : false; +// Output transparent gif +header('Cache-Control: no-cache'); +header('Content-type: image/gif'); +header('Content-length: 43'); + +echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='); + +flush(); + /** * Run cron-like action * Real cron-based layer will be introduced in 3.2 @@ -217,14 +226,6 @@ else garbage_collection(); } -// Output transparent gif -header('Cache-Control: no-cache'); -header('Content-type: image/gif'); -header('Content-length: 43'); - -echo base64_decode('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='); - -flush(); exit; ?>
\ No newline at end of file diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php index bc8c317c12..d83702f5ad 100644 --- a/phpBB/develop/add_permissions.php +++ b/phpBB/develop/add_permissions.php @@ -371,7 +371,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting) switch ($sql_type) { case 'insert': - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysql': case 'mysql4': diff --git a/phpBB/develop/adjust_bbcodes.php b/phpBB/develop/adjust_bbcodes.php new file mode 100644 index 0000000000..f06f0112ab --- /dev/null +++ b/phpBB/develop/adjust_bbcodes.php @@ -0,0 +1,174 @@ +<?php +/** +* Only adjust bitfields, do not rewrite text... +* All new parsings have the img, flash and quote modes set to true +* +* You should make a backup from your users, posts and privmsgs table in case something goes wrong +* Forum descriptions and rules need to be re-submitted manually. +*/ +die("Please read the first lines of this script for instructions on how to enable it"); + +set_time_limit(0); + +define('IN_PHPBB', true); +$phpbb_root_path = './../'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); +include($phpbb_root_path . 'common.'.$phpEx); +include($phpbb_root_path . 'includes/message_parser.' . $phpEx); + +// Start session management +$user->session_begin(); +$auth->acl($user->data); +$user->setup(); + +$echos = 0; + +// Adjust user signatures +$message_parser = new parse_message(); +$message_parser->mode = 'sig'; +$message_parser->bbcode_init(); + +$sql = 'SELECT user_id, user_sig, user_sig_bbcode_uid, user_sig_bbcode_bitfield + FROM ' . USERS_TABLE; +$result = $db->sql_query($sql); + +while ($row = $db->sql_fetchrow($result)) +{ + // Convert bbcodes back to their normal form + if ($row['user_sig_bbcode_uid'] && $row['user_sig']) + { + decode_message($row['user_sig'], $row['user_sig_bbcode_uid']); + + $message_parser->message = $row['user_sig']; + + $message_parser->prepare_bbcodes(); + $message_parser->parse_bbcode(); + + $bitfield = $message_parser->bbcode_bitfield; + + $sql = 'UPDATE ' . USERS_TABLE . " SET user_sig_bbcode_bitfield = '" . $db->sql_escape($bitfield) . "' + WHERE user_id = " . $row['user_id']; + $db->sql_query($sql); + + if ($echos > 200) + { + echo '<br />' . "\n"; + $echos = 0; + } + + echo '.'; + $echos++; + + flush(); + } + else + { + $sql = 'UPDATE ' . USERS_TABLE . " SET user_sig_bbcode_bitfield = '' + WHERE user_id = " . $row['user_id']; + $db->sql_query($sql); + } +} +$db->sql_freeresult($result); + + +// Now adjust posts + +$message_parser = new parse_message(); +$message_parser->mode = 'post'; +$message_parser->bbcode_init(); + +// Update posts +$sql = 'SELECT post_id, post_text, bbcode_uid, enable_bbcode, enable_smilies, enable_sig + FROM ' . POSTS_TABLE; +$result = $db->sql_query($sql); + +while ($row = $db->sql_fetchrow($result)) +{ + // Convert bbcodes back to their normal form + if ($row['enable_bbcode']) + { + decode_message($row['post_text'], $row['bbcode_uid']); + + $message_parser->message = $row['post_text']; + + $message_parser->prepare_bbcodes(); + $message_parser->parse_bbcode(); + + $bitfield = $message_parser->bbcode_bitfield; + + $sql = 'UPDATE ' . POSTS_TABLE . " SET bbcode_bitfield = '" . $db->sql_escape($bitfield) . "' + WHERE post_id = " . $row['post_id']; + $db->sql_query($sql); + + if ($echos > 200) + { + echo '<br />' . "\n"; + $echos = 0; + } + + echo '.'; + $echos++; + + flush(); + } + else + { + $sql = 'UPDATE ' . POSTS_TABLE . " SET bbcode_bitfield = '' + WHERE post_id = " . $row['post_id']; + $db->sql_query($sql); + } +} +$db->sql_freeresult($result); + +// Now to the private messages +$message_parser = new parse_message(); +$message_parser->mode = 'post'; +$message_parser->bbcode_init(); + +// Update pms +$sql = 'SELECT msg_id, message_text, bbcode_uid, enable_bbcode + FROM ' . PRIVMSGS_TABLE; +$result = $db->sql_query($sql); + +while ($row = $db->sql_fetchrow($result)) +{ + // Convert bbcodes back to their normal form + if ($row['enable_bbcode']) + { + decode_message($row['message_text'], $row['bbcode_uid']); + + $message_parser->message = $row['message_text']; + + $message_parser->prepare_bbcodes(); + $message_parser->parse_bbcode(); + + $bitfield = $message_parser->bbcode_bitfield; + + $sql = 'UPDATE ' . PRIVMSGS_TABLE . " SET bbcode_bitfield = '" . $db->sql_escape($bitfield) . "' + WHERE msg_id = " . $row['msg_id']; + $db->sql_query($sql); + + if ($echos > 200) + { + echo '<br />' . "\n"; + $echos = 0; + } + + echo '.'; + $echos++; + + flush(); + } + else + { + $sql = 'UPDATE ' . PRIVMSGS_TABLE . " SET bbcode_bitfield = '' + WHERE msg_id = " . $row['msg_id']; + $db->sql_query($sql); + } +} +$db->sql_freeresult($result); + +// Done +$db->sql_close(); + +?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_usernames.php b/phpBB/develop/adjust_usernames.php new file mode 100644 index 0000000000..1afa77af16 --- /dev/null +++ b/phpBB/develop/adjust_usernames.php @@ -0,0 +1,52 @@ +<?php +/** +* Adjust username_clean column. +* +* You should make a backup from your users table in case something goes wrong +*/ +die("Please read the first lines of this script for instructions on how to enable it"); + +set_time_limit(0); + +define('IN_PHPBB', true); +$phpbb_root_path = './../'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); +include($phpbb_root_path . 'common.'.$phpEx); + +// Start session management +$user->session_begin(); +$auth->acl($user->data); +$user->setup(); + +$echos = 0; + +$sql = 'SELECT user_id, username + FROM ' . USERS_TABLE; +$result = $db->sql_query($sql); + +while ($row = $db->sql_fetchrow($result)) +{ + $sql = 'UPDATE ' . USERS_TABLE . " + SET username_clean = '" . $db->sql_escape(utf8_clean_string($row['username'])) . "' + WHERE user_id = " . $row['user_id']; + $db->sql_query($sql); + + if ($echos > 200) + { + echo '<br />' . "\n"; + $echos = 0; + } + + echo '.'; + $echos++; + + flush(); +} +$db->sql_freeresult($result); + +echo 'FINISHED'; + +// Done +$db->sql_close(); + +?>
\ No newline at end of file diff --git a/phpBB/develop/benchmark.php b/phpBB/develop/benchmark.php index 2a88818975..5bbe6f53be 100644 --- a/phpBB/develop/benchmark.php +++ b/phpBB/develop/benchmark.php @@ -313,7 +313,7 @@ function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $m else { // Rollback - if(SQL_LAYER == "mysql") + if($db->sql_layer == "mysql") { $sql = "DELETE FROM " . POSTS_TABLE . " WHERE post_id = $new_post_id"; diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 1cc5494e53..b6fe49ced1 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -25,7 +25,7 @@ if (!is_writeable($schema_path)) $schema_data = get_schema_struct(); $dbms_type_map = array( - 'mysql' => array( + 'mysql_41' => array( 'INT:' => 'int(%d)', 'BINT' => 'bigint(20)', 'UINT' => 'mediumint(8) UNSIGNED', @@ -37,13 +37,45 @@ $dbms_type_map = array( 'VCHAR:' => 'varchar(%d)', 'CHAR:' => 'char(%d)', 'XSTEXT' => 'text', + 'XSTEXT_UNI'=> 'varchar(100)', 'STEXT' => 'text', + 'STEXT_UNI' => 'varchar(255)', 'TEXT' => 'text', + 'TEXT_UNI' => 'text', 'MTEXT' => 'mediumtext', + 'MTEXT_UNI' => 'mediumtext', 'TIMESTAMP' => 'int(11) UNSIGNED', 'DECIMAL' => 'decimal(5,2)', - 'VCHAR_BIN' => 'varchar(252) /*!40101 CHARACTER SET utf8 */ BINARY', - 'VCHAR_CI' => 'varchar(252)', + 'VCHAR_UNI' => 'varchar(255)', + 'VCHAR_UNI:'=> 'varchar(%d)', + 'VCHAR_CI' => 'varchar(255)', + 'VARBINARY' => 'varbinary(255)', + ), + + 'mysql_40' => array( + 'INT:' => 'int(%d)', + 'BINT' => 'bigint(20)', + 'UINT' => 'mediumint(8) UNSIGNED', + 'UINT:' => 'int(%d) UNSIGNED', + 'TINT:' => 'tinyint(%d)', + 'USINT' => 'smallint(4) UNSIGNED', + 'BOOL' => 'tinyint(1) UNSIGNED', + 'VCHAR' => 'varchar(255)', + 'VCHAR:' => 'varchar(%d)', + 'CHAR:' => 'char(%d)', + 'XSTEXT' => 'text', + 'XSTEXT_UNI'=> 'text', + 'STEXT' => 'text', + 'STEXT_UNI' => 'text', + 'TEXT' => 'text', + 'TEXT_UNI' => 'text', + 'MTEXT' => 'mediumtext', + 'MTEXT_UNI' => 'mediumtext', + 'TIMESTAMP' => 'int(11) UNSIGNED', + 'DECIMAL' => 'decimal(5,2)', + 'VCHAR_UNI' => 'text', + 'VCHAR_UNI:'=> array('varchar(%d)', 'limit' => array('mult', 3, 255, 'text')), + 'VCHAR_CI' => 'text', 'VARBINARY' => 'varbinary(255)', ), @@ -55,18 +87,23 @@ $dbms_type_map = array( 'TINT:' => 'INTEGER', 'USINT' => 'INTEGER', 'BOOL' => 'INTEGER', - 'VCHAR' => 'VARCHAR(255)', - 'VCHAR:' => 'VARCHAR(%d)', - 'CHAR:' => 'CHAR(%d)', - 'XSTEXT' => 'BLOB SUB_TYPE TEXT', - 'STEXT' => 'BLOB SUB_TYPE TEXT', - 'TEXT' => 'BLOB SUB_TYPE TEXT', - 'MTEXT' => 'BLOB SUB_TYPE TEXT', + 'VCHAR' => 'VARCHAR(255) CHARACTER SET NONE', + 'VCHAR:' => 'VARCHAR(%d) CHARACTER SET NONE', + 'CHAR:' => 'CHAR(%d) CHARACTER SET NONE', + 'XSTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE', + 'STEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE', + 'TEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE', + 'MTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE', + 'XSTEXT_UNI'=> 'VARCHAR(100) CHARACTER SET UTF8', + 'STEXT_UNI' => 'VARCHAR(255) CHARACTER SET UTF8', + 'TEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8', + 'MTEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8', 'TIMESTAMP' => 'INTEGER', 'DECIMAL' => 'DOUBLE PRECISION', - 'VCHAR_BIN' => 'VARCHAR(84) CHARACTER SET UNICODE_FSS', - 'VCHAR_CI' => 'VARCHAR(252)', - 'VARBINARY' => 'CHAR(255)', + 'VCHAR_UNI' => 'VARCHAR(255) CHARACTER SET UTF8', + 'VCHAR_UNI:'=> 'VARCHAR(%d) CHARACTER SET UTF8', + 'VCHAR_CI' => 'VARCHAR(255) CHARACTER SET UTF8', + 'VARBINARY' => 'CHAR(255) CHARACTER SET NONE', ), 'mssql' => array( @@ -84,11 +121,16 @@ $dbms_type_map = array( 'STEXT' => '[varchar] (3000)', 'TEXT' => '[varchar] (8000)', 'MTEXT' => '[text]', + 'XSTEXT_UNI'=> '[varchar] (100)', + 'STEXT_UNI' => '[varchar] (255)', + 'TEXT_UNI' => '[varchar] (4000)', + 'MTEXT_UNI' => '[text]', 'TIMESTAMP' => '[int]', 'DECIMAL' => '[float]', - 'VCHAR_BIN' => '[nvarchar] (252)', - 'VCHAR_CI' => '[varchar] (252)', - 'VARBINARY' => '[varbinary] (255)', + 'VCHAR_UNI' => '[varchar] (255)', + 'VCHAR_UNI:'=> '[varchar] (%d)', + 'VCHAR_CI' => '[varchar] (255)', + 'VARBINARY' => '[varchar] (255)', ), 'oracle' => array( @@ -106,10 +148,15 @@ $dbms_type_map = array( 'STEXT' => 'varchar2(3000)', 'TEXT' => 'clob', 'MTEXT' => 'clob', + 'XSTEXT_UNI'=> 'varchar2(300)', + 'STEXT_UNI' => 'varchar2(765)', + 'TEXT_UNI' => 'clob', + 'MTEXT_UNI' => 'clob', 'TIMESTAMP' => 'number(11)', 'DECIMAL' => 'number(5, 2)', - 'VCHAR_BIN' => 'nvarchar2(252)', - 'VCHAR_CI' => 'varchar2(252)', + 'VCHAR_UNI' => 'varchar2(765)', + 'VCHAR_UNI:'=> array('varchar2(%d)', 'limit' => array('mult', 3, 765, 'clob')), + 'VCHAR_CI' => 'varchar2(255)', 'VARBINARY' => 'raw(255)', ), @@ -128,10 +175,15 @@ $dbms_type_map = array( 'STEXT' => 'text(65535)', 'TEXT' => 'text(65535)', 'MTEXT' => 'mediumtext(16777215)', + 'XSTEXT_UNI'=> 'text(65535)', + 'STEXT_UNI' => 'text(65535)', + 'TEXT_UNI' => 'text(65535)', + 'MTEXT_UNI' => 'mediumtext(16777215)', 'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) UNSIGNED', 'DECIMAL' => 'decimal(5,2)', - 'VCHAR_BIN' => 'nvarchar(252)', - 'VCHAR_CI' => 'varchar(252)', + 'VCHAR_UNI' => 'varchar(255)', + 'VCHAR_UNI:'=> 'varchar(%d)', + 'VCHAR_CI' => 'varchar(255)', 'VARBINARY' => 'blob', ), @@ -150,9 +202,14 @@ $dbms_type_map = array( 'STEXT' => 'varchar(3000)', 'TEXT' => 'varchar(8000)', 'MTEXT' => 'TEXT', + 'XSTEXT_UNI'=> 'varchar(100)', + 'STEXT_UNI' => 'varchar(255)', + 'TEXT_UNI' => 'varchar(4000)', + 'MTEXT_UNI' => 'TEXT', 'TIMESTAMP' => 'INT4', // unsigned 'DECIMAL' => 'decimal(5,2)', - 'VCHAR_BIN' => 'varchar(252)', + 'VCHAR_UNI' => 'varchar(255)', + 'VCHAR_UNI:'=> 'varchar(%d)', 'VCHAR_CI' => 'varchar_ci', 'VARBINARY' => 'bytea', ), @@ -160,7 +217,7 @@ $dbms_type_map = array( // A list of types being unsigned for better reference in some db's $unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP'); -$supported_dbms = array('firebird', 'mssql', 'mysql', 'oracle', 'postgres', 'sqlite'); +$supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite'); foreach ($supported_dbms as $dbms) { @@ -171,7 +228,8 @@ foreach ($supported_dbms as $dbms) // Write Header switch ($dbms) { - case 'mysql': + case 'mysql_40': + case 'mysql_41': $line = "#\n# MySQL Schema for phpBB 3.x - (c) phpBB Group, 2005\n#\n# \$I" . "d: $\n#\n\n"; break; @@ -209,7 +267,8 @@ foreach ($supported_dbms as $dbms) // Write comment about table switch ($dbms) { - case 'mysql': + case 'mysql_40': + case 'mysql_41': case 'firebird': case 'sqlite': fwrite($fp, "# Table: '{$table_name}'\n"); @@ -228,7 +287,8 @@ foreach ($supported_dbms as $dbms) switch ($dbms) { - case 'mysql': + case 'mysql_40': + case 'mysql_41': case 'firebird': case 'oracle': case 'sqlite': @@ -241,6 +301,9 @@ foreach ($supported_dbms as $dbms) break; } + // Table specific so we don't get overlap + $modded_array = array(); + // Write columns one by one... foreach ($table_data['COLUMNS'] as $column_name => $column_data) { @@ -248,14 +311,53 @@ foreach ($supported_dbms as $dbms) if (strpos($column_data[0], ':') !== false) { list($orig_column_type, $column_length) = explode(':', $column_data[0]); + if (!is_array($dbms_type_map[$dbms][$orig_column_type . ':'])) + { + $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'], $column_length); + } + else + { + if (isset($dbms_type_map[$dbms][$orig_column_type . ':']['rule'])) + { + switch ($dbms_type_map[$dbms][$orig_column_type . ':']['rule'][0]) + { + case 'div': + $column_length /= $dbms_type_map[$dbms][$orig_column_type . ':']['rule'][1]; + $column_length = ceil($column_length); + $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'][0], $column_length); + break; + } + } - $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'], $column_length); + if (isset($dbms_type_map[$dbms][$orig_column_type . ':']['limit'])) + { + switch ($dbms_type_map[$dbms][$orig_column_type . ':']['limit'][0]) + { + case 'mult': + $column_length *= $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][1]; + if ($column_length > $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][2]) + { + $column_type = $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][3]; + $modded_array[$column_name] = $column_type; + } + else + { + $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'][0], $column_length); + } + break; + } + } + } $orig_column_type .= ':'; } else { $orig_column_type = $column_data[0]; $column_type = $dbms_type_map[$dbms][$column_data[0]]; + if ($column_type == 'text') + { + $modded_array[$column_name] = $column_type; + } } // Adjust default value if db-dependant specified @@ -266,11 +368,12 @@ foreach ($supported_dbms as $dbms) switch ($dbms) { - case 'mysql': + case 'mysql_40': + case 'mysql_41': $line .= "\t{$column_name} {$column_type} "; // For hexadecimal values do not use single quotes - if (!is_null($column_data[1])) + if (!is_null($column_data[1]) && substr($column_type, -4) !== 'text') { $line .= (strpos($column_data[1], '0x') === 0) ? "DEFAULT {$column_data[1]} " : "DEFAULT '{$column_data[1]}' "; } @@ -308,7 +411,15 @@ foreach ($supported_dbms as $dbms) $line .= 'DEFAULT ' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' '; } - $line .= "NOT NULL,\n"; + $line .= 'NOT NULL'; + + // This is a UNICODE column and thus should be given it's fair share + if (preg_match('/^X?STEXT_UNI|VCHAR_(CI|UNI:?)/', $column_data[0])) + { + $line .= ' COLLATE UNICODE'; + } + + $line .= ",\n"; if (isset($column_data[2]) && $column_data[2] == 'auto_increment') { @@ -412,7 +523,8 @@ foreach ($supported_dbms as $dbms) switch ($dbms) { - case 'mysql': + case 'mysql_40': + case 'mysql_41': case 'postgres': $line .= "\tPRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . "),\n"; break; @@ -493,9 +605,22 @@ foreach ($supported_dbms as $dbms) switch ($dbms) { - case 'mysql': + case 'mysql_40': + case 'mysql_41': $line .= ($key_data[0] == 'INDEX') ? "\tKEY" : ''; $line .= ($key_data[0] == 'UNIQUE') ? "\tUNIQUE" : ''; + foreach ($key_data[1] as $key => $col_name) + { + if (isset($modded_array[$col_name])) + { + switch ($modded_array[$col_name]) + { + case 'text': + $key_data[1][$key] = $col_name . '(255)'; + break; + } + } + } $line .= ' ' . $key_name . ' (' . implode(', ', $key_data[1]) . "),\n"; break; @@ -544,12 +669,18 @@ foreach ($supported_dbms as $dbms) switch ($dbms) { - case 'mysql': + case 'mysql_40': // Remove last line delimiter... $line = substr($line, 0, -2); $line .= "\n);\n\n"; break; + case 'mysql_41': + // Remove last line delimiter... + $line = substr($line, 0, -2); + $line .= "\n) CHARACTER SET `utf8` COLLATE `utf8_bin`;\n\n"; + break; + // Create Generator case 'firebird': if ($generator !== false) @@ -632,7 +763,7 @@ foreach ($supported_dbms as $dbms) * VCHAR:x => varchar(x) * TIMESTAMP => int(11) UNSIGNED * DECIMAL => decimal number (5,2) -* VCHAR_BIN => varchar(252) BINARY +* VCHAR_UNI => varchar(255) BINARY * VCHAR_CI => varchar_ci for postgresql, others VCHAR */ function get_schema_struct() @@ -646,10 +777,11 @@ function get_schema_struct() 'topic_id' => array('UINT', 0), 'in_message' => array('BOOL', 0), 'poster_id' => array('UINT', 0), + 'is_orphan' => array('BOOL', 1), 'physical_filename' => array('VCHAR', ''), 'real_filename' => array('VCHAR', ''), 'download_count' => array('UINT', 0), - 'attach_comment' => array('TEXT', ''), + 'attach_comment' => array('TEXT_UNI', ''), 'extension' => array('VCHAR:100', ''), 'mimetype' => array('VCHAR:100', ''), 'filesize' => array('UINT:20', 0), @@ -662,7 +794,7 @@ function get_schema_struct() 'post_msg_id' => array('INDEX', 'post_msg_id'), 'topic_id' => array('INDEX', 'topic_id'), 'poster_id' => array('INDEX', 'poster_id'), - 'filesize' => array('INDEX', 'filesize'), + 'is_orphan' => array('INDEX', 'is_orphan'), ), ); @@ -697,8 +829,8 @@ function get_schema_struct() $schema_data['phpbb_acl_roles'] = array( 'COLUMNS' => array( 'role_id' => array('UINT', NULL, 'auto_increment'), - 'role_name' => array('VCHAR', ''), - 'role_description' => array('TEXT', ''), + 'role_name' => array('VCHAR_UNI', ''), + 'role_description' => array('TEXT_UNI', ''), 'role_type' => array('VCHAR:10', ''), 'role_order' => array('USINT', 0), ), @@ -737,7 +869,7 @@ function get_schema_struct() 'ban_id' => array('UINT', NULL, 'auto_increment'), 'ban_userid' => array('UINT', 0), 'ban_ip' => array('VCHAR:40', ''), - 'ban_email' => array('VCHAR:100', ''), + 'ban_email' => array('VCHAR_UNI:100', ''), 'ban_start' => array('TIMESTAMP', 0), 'ban_end' => array('TIMESTAMP', 0), 'ban_exclude' => array('BOOL', 0), @@ -759,12 +891,12 @@ function get_schema_struct() 'bbcode_tag' => array('VCHAR:16', ''), 'bbcode_helpline' => array('VCHAR', ''), 'display_on_posting' => array('BOOL', 0), - 'bbcode_match' => array('TEXT', ''), - 'bbcode_tpl' => array('MTEXT', ''), - 'first_pass_match' => array('MTEXT', ''), - 'first_pass_replace' => array('MTEXT', ''), - 'second_pass_match' => array('MTEXT', ''), - 'second_pass_replace' => array('MTEXT', ''), + 'bbcode_match' => array('TEXT_UNI', ''), + 'bbcode_tpl' => array('MTEXT_UNI', ''), + 'first_pass_match' => array('MTEXT_UNI', ''), + 'first_pass_replace' => array('MTEXT_UNI', ''), + 'second_pass_match' => array('MTEXT_UNI', ''), + 'second_pass_replace' => array('MTEXT_UNI', ''), ), 'PRIMARY_KEY' => 'bbcode_id', 'KEYS' => array( @@ -788,7 +920,7 @@ function get_schema_struct() 'COLUMNS' => array( 'bot_id' => array('UINT', NULL, 'auto_increment'), 'bot_active' => array('BOOL', 1), - 'bot_name' => array('STEXT', ''), + 'bot_name' => array('STEXT_UNI', ''), 'user_id' => array('UINT', 0), 'bot_agent' => array('VCHAR', ''), 'bot_ip' => array('VCHAR', ''), @@ -801,7 +933,7 @@ function get_schema_struct() $schema_data['phpbb_config'] = array( 'COLUMNS' => array( - 'config_name' => array('VCHAR:252', ''), + 'config_name' => array('VCHAR:255', ''), 'config_value' => array('VCHAR', ''), 'is_dynamic' => array('BOOL', 0), ), @@ -827,7 +959,7 @@ function get_schema_struct() $schema_data['phpbb_disallow'] = array( 'COLUMNS' => array( 'disallow_id' => array('UINT', NULL, 'auto_increment'), - 'disallow_username' => array('VCHAR:252', ''), + 'disallow_username' => array('VCHAR_UNI:255', ''), ), 'PRIMARY_KEY' => 'disallow_id', ); @@ -839,8 +971,8 @@ function get_schema_struct() 'topic_id' => array('UINT', 0), 'forum_id' => array('UINT', 0), 'save_time' => array('TIMESTAMP', 0), - 'draft_subject' => array('XSTEXT', ''), - 'draft_message' => array('MTEXT', ''), + 'draft_subject' => array('XSTEXT_UNI', ''), + 'draft_message' => array('MTEXT_UNI', ''), ), 'PRIMARY_KEY' => 'draft_id', 'KEYS' => array( @@ -860,7 +992,7 @@ function get_schema_struct() $schema_data['phpbb_extension_groups'] = array( 'COLUMNS' => array( 'group_id' => array('UINT', NULL, 'auto_increment'), - 'group_name' => array('VCHAR', ''), + 'group_name' => array('VCHAR_UNI', ''), 'cat_id' => array('TINT:2', 0), 'allow_group' => array('BOOL', 0), 'download_mode' => array('BOOL', 1), @@ -879,19 +1011,19 @@ function get_schema_struct() 'left_id' => array('UINT', 0), 'right_id' => array('UINT', 0), 'forum_parents' => array('MTEXT', ''), - 'forum_name' => array('STEXT', ''), - 'forum_desc' => array('TEXT', ''), - 'forum_desc_bitfield' => array('VCHAR:252', ''), - 'forum_desc_options' => array('UINT:11', 0), + 'forum_name' => array('STEXT_UNI', ''), + 'forum_desc' => array('TEXT_UNI', ''), + 'forum_desc_bitfield' => array('VCHAR:255', ''), + 'forum_desc_options' => array('UINT:11', 7), 'forum_desc_uid' => array('VCHAR:5', ''), - 'forum_link' => array('VCHAR', ''), - 'forum_password' => array('VCHAR:40', ''), + 'forum_link' => array('VCHAR_UNI', ''), + 'forum_password' => array('VCHAR_UNI:40', ''), 'forum_style' => array('TINT:4', 0), 'forum_image' => array('VCHAR', ''), - 'forum_rules' => array('TEXT', ''), - 'forum_rules_link' => array('VCHAR', ''), - 'forum_rules_bitfield' => array('VCHAR:252', ''), - 'forum_rules_options' => array('UINT:11', 0), + 'forum_rules' => array('TEXT_UNI', ''), + 'forum_rules_link' => array('VCHAR_UNI', ''), + 'forum_rules_bitfield' => array('VCHAR:255', ''), + 'forum_rules_options' => array('UINT:11', 7), 'forum_rules_uid' => array('VCHAR:5', ''), 'forum_topics_per_page' => array('TINT:4', 0), 'forum_type' => array('TINT:4', 0), @@ -901,8 +1033,10 @@ function get_schema_struct() 'forum_topics_real' => array('UINT', 0), 'forum_last_post_id' => array('UINT', 0), 'forum_last_poster_id' => array('UINT', 0), + 'forum_last_post_subject' => array('XSTEXT_UNI', ''), 'forum_last_post_time' => array('TIMESTAMP', 0), - 'forum_last_poster_name'=> array('VCHAR', ''), + 'forum_last_poster_name'=> array('VCHAR_UNI', ''), + 'forum_last_poster_colour'=> array('VCHAR:6', ''), 'forum_flags' => array('TINT:4', 32), 'display_on_index' => array('BOOL', 1), 'enable_indexing' => array('BOOL', 1), @@ -956,9 +1090,9 @@ function get_schema_struct() 'group_id' => array('UINT', NULL, 'auto_increment'), 'group_type' => array('TINT:4', 1), 'group_name' => array('VCHAR_CI', ''), - 'group_desc' => array('TEXT', ''), - 'group_desc_bitfield' => array('VCHAR:252', ''), - 'group_desc_options' => array('UINT:11', 0), + 'group_desc' => array('TEXT_UNI', ''), + 'group_desc_bitfield' => array('VCHAR:255', ''), + 'group_desc_options' => array('UINT:11', 7), 'group_desc_uid' => array('VCHAR:5', ''), 'group_display' => array('BOOL', 0), 'group_avatar' => array('VCHAR', ''), @@ -998,9 +1132,9 @@ function get_schema_struct() 'lang_id' => array('TINT:4', NULL, 'auto_increment'), 'lang_iso' => array('VCHAR:30', ''), 'lang_dir' => array('VCHAR:30', ''), - 'lang_english_name' => array('VCHAR:100', ''), - 'lang_local_name' => array('VCHAR:255', ''), - 'lang_author' => array('VCHAR:255', ''), + 'lang_english_name' => array('VCHAR_UNI:100', ''), + 'lang_local_name' => array('VCHAR_UNI:255', ''), + 'lang_author' => array('VCHAR_UNI:255', ''), ), 'PRIMARY_KEY' => 'lang_id', 'KEYS' => array( @@ -1018,8 +1152,8 @@ function get_schema_struct() 'reportee_id' => array('UINT', 0), 'log_ip' => array('VCHAR:40', ''), 'log_time' => array('TIMESTAMP', 0), - 'log_operation' => array('TEXT', ''), - 'log_data' => array('MTEXT', ''), + 'log_operation' => array('TEXT_UNI', ''), + 'log_data' => array('MTEXT_UNI', ''), ), 'PRIMARY_KEY' => 'log_id', 'KEYS' => array( @@ -1035,9 +1169,9 @@ function get_schema_struct() 'COLUMNS' => array( 'forum_id' => array('UINT', 0), 'user_id' => array('UINT', 0), - 'username' => array('VCHAR:252', ''), + 'username' => array('VCHAR_UNI:255', ''), 'group_id' => array('UINT', 0), - 'group_name' => array('VCHAR', ''), + 'group_name' => array('VCHAR_UNI', ''), 'display_on_index' => array('BOOL', 1), ), 'KEYS' => array( @@ -1072,7 +1206,7 @@ function get_schema_struct() 'COLUMNS' => array( 'poll_option_id' => array('TINT:4', 0), 'topic_id' => array('UINT', 0), - 'poll_option_text' => array('TEXT', ''), + 'poll_option_text' => array('TEXT_UNI', ''), 'poll_option_total' => array('UINT', 0), ), 'KEYS' => array( @@ -1110,17 +1244,16 @@ function get_schema_struct() 'enable_smilies' => array('BOOL', 1), 'enable_magic_url' => array('BOOL', 1), 'enable_sig' => array('BOOL', 1), - 'post_username' => array('VCHAR:252', ''), - 'post_subject' => array('XSTEXT', ''), - 'post_text' => array('MTEXT', ''), + 'post_username' => array('VCHAR_UNI:255', ''), + 'post_subject' => array('XSTEXT_UNI', ''), + 'post_text' => array('MTEXT_UNI', ''), 'post_checksum' => array('VCHAR:32', ''), - 'post_encoding' => array('VCHAR:20', 'iso-8859-1'), 'post_attachment' => array('BOOL', 0), - 'bbcode_bitfield' => array('VCHAR:252', ''), + 'bbcode_bitfield' => array('VCHAR:255', ''), 'bbcode_uid' => array('VCHAR:5', ''), 'post_postcount' => array('BOOL', 1), 'post_edit_time' => array('TIMESTAMP', 0), - 'post_edit_reason' => array('STEXT', ''), + 'post_edit_reason' => array('STEXT_UNI', ''), 'post_edit_user' => array('UINT', 0), 'post_edit_count' => array('USINT', 0), 'post_edit_locked' => array('BOOL', 0), @@ -1132,8 +1265,7 @@ function get_schema_struct() 'poster_ip' => array('INDEX', 'poster_ip'), 'poster_id' => array('INDEX', 'poster_id'), 'post_approved' => array('INDEX', 'post_approved'), - 'post_postcount' => array('INDEX', 'post_postcount'), - 'post_time' => array('INDEX', 'post_time'), + 'tid_post_time' => array('INDEX', array('topic_id', 'post_time')), ), ); @@ -1149,18 +1281,17 @@ function get_schema_struct() 'enable_smilies' => array('BOOL', 1), 'enable_magic_url' => array('BOOL', 1), 'enable_sig' => array('BOOL', 1), - 'message_subject' => array('XSTEXT', ''), - 'message_text' => array('MTEXT', ''), - 'message_edit_reason' => array('STEXT', ''), + 'message_subject' => array('XSTEXT_UNI', ''), + 'message_text' => array('MTEXT_UNI', ''), + 'message_edit_reason' => array('STEXT_UNI', ''), 'message_edit_user' => array('UINT', 0), - 'message_encoding' => array('VCHAR:20', 'iso-8859-1'), 'message_attachment' => array('BOOL', 0), - 'bbcode_bitfield' => array('VCHAR:252', ''), + 'bbcode_bitfield' => array('VCHAR:255', ''), 'bbcode_uid' => array('VCHAR:5', ''), 'message_edit_time' => array('TIMESTAMP', 0), 'message_edit_count' => array('USINT', 0), - 'to_address' => array('TEXT', ''), - 'bcc_address' => array('TEXT', ''), + 'to_address' => array('TEXT_UNI', ''), + 'bcc_address' => array('TEXT_UNI', ''), ), 'PRIMARY_KEY' => 'msg_id', 'KEYS' => array( @@ -1175,7 +1306,7 @@ function get_schema_struct() 'COLUMNS' => array( 'folder_id' => array('UINT', NULL, 'auto_increment'), 'user_id' => array('UINT', 0), - 'folder_name' => array('VCHAR', ''), + 'folder_name' => array('VCHAR_UNI', ''), 'pm_count' => array('UINT', 0), ), 'PRIMARY_KEY' => 'folder_id', @@ -1190,7 +1321,7 @@ function get_schema_struct() 'user_id' => array('UINT', 0), 'rule_check' => array('UINT', 0), 'rule_connection' => array('UINT', 0), - 'rule_string' => array('VCHAR', ''), + 'rule_string' => array('VCHAR_UNI', ''), 'rule_user_id' => array('UINT', 0), 'rule_group_id' => array('UINT', 0), 'rule_action' => array('UINT', 0), @@ -1225,15 +1356,15 @@ function get_schema_struct() $schema_data['phpbb_profile_fields'] = array( 'COLUMNS' => array( 'field_id' => array('UINT', NULL, 'auto_increment'), - 'field_name' => array('VCHAR', ''), + 'field_name' => array('VCHAR_UNI', ''), 'field_type' => array('TINT:4', 0), 'field_ident' => array('VCHAR:20', ''), 'field_length' => array('VCHAR:20', ''), 'field_minlen' => array('VCHAR', ''), 'field_maxlen' => array('VCHAR', ''), - 'field_novalue' => array('VCHAR', ''), - 'field_default_value' => array('VCHAR', ''), - 'field_validation' => array('VCHAR:20', ''), + 'field_novalue' => array('VCHAR_UNI', ''), + 'field_default_value' => array('VCHAR_UNI', ''), + 'field_validation' => array('VCHAR_UNI:20', ''), 'field_required' => array('BOOL', 0), 'field_show_on_reg' => array('BOOL', 0), 'field_hide' => array('BOOL', 0), @@ -1261,7 +1392,7 @@ function get_schema_struct() 'lang_id' => array('UINT', 0), 'option_id' => array('UINT', 0), 'field_type' => array('TINT:4', 0), - 'lang_value' => array('VCHAR', ''), + 'lang_value' => array('VCHAR_UNI', ''), ), 'PRIMARY_KEY' => array('field_id', 'lang_id', 'option_id'), ); @@ -1270,9 +1401,9 @@ function get_schema_struct() 'COLUMNS' => array( 'field_id' => array('UINT', 0), 'lang_id' => array('UINT', 0), - 'lang_name' => array('VCHAR', ''), - 'lang_explain' => array('TEXT', ''), - 'lang_default_value' => array('VCHAR', ''), + 'lang_name' => array('VCHAR_UNI', ''), + 'lang_explain' => array('TEXT_UNI', ''), + 'lang_default_value' => array('VCHAR_UNI', ''), ), 'PRIMARY_KEY' => array('field_id', 'lang_id'), ); @@ -1280,7 +1411,7 @@ function get_schema_struct() $schema_data['phpbb_ranks'] = array( 'COLUMNS' => array( 'rank_id' => array('UINT', NULL, 'auto_increment'), - 'rank_title' => array('VCHAR', ''), + 'rank_title' => array('VCHAR_UNI', ''), 'rank_min' => array('UINT', 0), 'rank_special' => array('BOOL', 0), 'rank_image' => array('VCHAR', ''), @@ -1297,7 +1428,7 @@ function get_schema_struct() 'user_notify' => array('BOOL', 0), 'report_closed' => array('BOOL', 0), 'report_time' => array('TIMESTAMP', 0), - 'report_text' => array('MTEXT', ''), + 'report_text' => array('MTEXT_UNI', ''), ), 'PRIMARY_KEY' => 'report_id', ); @@ -1305,8 +1436,8 @@ function get_schema_struct() $schema_data['phpbb_reports_reasons'] = array( 'COLUMNS' => array( 'reason_id' => array('USINT', NULL, 'auto_increment'), - 'reason_title' => array('VCHAR', ''), - 'reason_description' => array('MTEXT', ''), + 'reason_title' => array('VCHAR_UNI', ''), + 'reason_description' => array('MTEXT_UNI', ''), 'reason_order' => array('USINT', 0), ), 'PRIMARY_KEY' => 'reason_id', @@ -1316,7 +1447,7 @@ function get_schema_struct() 'COLUMNS' => array( 'search_key' => array('VCHAR:32', ''), 'search_time' => array('TIMESTAMP', 0), - 'search_keywords' => array('MTEXT', ''), + 'search_keywords' => array('MTEXT_UNI', ''), 'search_authors' => array('MTEXT', ''), ), 'PRIMARY_KEY' => 'search_key', @@ -1325,7 +1456,7 @@ function get_schema_struct() $schema_data['phpbb_search_wordlist'] = array( 'COLUMNS' => array( 'word_id' => array('UINT', NULL, 'auto_increment'), - 'word_text' => array('VCHAR_BIN', ''), + 'word_text' => array('VCHAR_UNI', ''), 'word_common' => array('BOOL', 0), ), 'PRIMARY_KEY' => 'word_id', @@ -1355,7 +1486,7 @@ function get_schema_struct() 'session_time' => array('TIMESTAMP', 0), 'session_ip' => array('VCHAR:40', ''), 'session_browser' => array('VCHAR:150', ''), - 'session_page' => array('VCHAR', ''), + 'session_page' => array('VCHAR_UNI', ''), 'session_viewonline' => array('BOOL', 1), 'session_autologin' => array('BOOL', 0), 'session_admin' => array('BOOL', 0), @@ -1393,11 +1524,11 @@ function get_schema_struct() $schema_data['phpbb_smilies'] = array( 'COLUMNS' => array( 'smiley_id' => array('UINT', NULL, 'auto_increment'), - 'code' => array('VCHAR:50', ''), - 'emotion' => array('VCHAR:50', ''), + 'code' => array('VCHAR_UNI:50', ''), + 'emotion' => array('VCHAR_UNI:50', ''), 'smiley_url' => array('VCHAR:50', ''), - 'smiley_width' => array('TINT:4', 0), - 'smiley_height' => array('TINT:4', 0), + 'smiley_width' => array('USINT', 0), + 'smiley_height' => array('USINT', 0), 'smiley_order' => array('UINT', 0), 'display_on_posting'=> array('BOOL', 1), ), @@ -1410,8 +1541,8 @@ function get_schema_struct() $schema_data['phpbb_styles'] = array( 'COLUMNS' => array( 'style_id' => array('TINT:4', NULL, 'auto_increment'), - 'style_name' => array('VCHAR:252', ''), - 'style_copyright' => array('VCHAR', ''), + 'style_name' => array('VCHAR_UNI:255', ''), + 'style_copyright' => array('VCHAR_UNI', ''), 'style_active' => array('BOOL', 1), 'template_id' => array('TINT:4', 0), 'theme_id' => array('TINT:4', 0), @@ -1429,10 +1560,10 @@ function get_schema_struct() $schema_data['phpbb_styles_template'] = array( 'COLUMNS' => array( 'template_id' => array('TINT:4', NULL, 'auto_increment'), - 'template_name' => array('VCHAR:252', ''), - 'template_copyright' => array('VCHAR', ''), + 'template_name' => array('VCHAR_UNI:255', ''), + 'template_copyright' => array('VCHAR_UNI', ''), 'template_path' => array('VCHAR:100', ''), - 'bbcode_bitfield' => array('VCHAR:252', 'kNg='), + 'bbcode_bitfield' => array('VCHAR:255', 'kNg='), 'template_storedb' => array('BOOL', 0), ), 'PRIMARY_KEY' => 'template_id', @@ -1447,7 +1578,7 @@ function get_schema_struct() 'template_filename' => array('VCHAR:100', ''), 'template_included' => array('TEXT', ''), 'template_mtime' => array('TIMESTAMP', 0), - 'template_data' => array('MTEXT', ''), + 'template_data' => array('MTEXT_UNI', ''), ), 'KEYS' => array( 'tid' => array('INDEX', 'template_id'), @@ -1458,12 +1589,12 @@ function get_schema_struct() $schema_data['phpbb_styles_theme'] = array( 'COLUMNS' => array( 'theme_id' => array('TINT:4', NULL, 'auto_increment'), - 'theme_name' => array('VCHAR:252', ''), - 'theme_copyright' => array('VCHAR', ''), + 'theme_name' => array('VCHAR_UNI:255', ''), + 'theme_copyright' => array('VCHAR_UNI', ''), 'theme_path' => array('VCHAR:100', ''), 'theme_storedb' => array('BOOL', 0), 'theme_mtime' => array('TIMESTAMP', 0), - 'theme_data' => array('MTEXT', ''), + 'theme_data' => array('MTEXT_UNI', ''), ), 'PRIMARY_KEY' => 'theme_id', 'KEYS' => array( @@ -1474,8 +1605,8 @@ function get_schema_struct() $schema_data['phpbb_styles_imageset'] = array( 'COLUMNS' => array( 'imageset_id' => array('TINT:4', NULL, 'auto_increment'), - 'imageset_name' => array('VCHAR:252', ''), - 'imageset_copyright' => array('VCHAR', ''), + 'imageset_name' => array('VCHAR_UNI:255', ''), + 'imageset_copyright' => array('VCHAR_UNI', ''), 'imageset_path' => array('VCHAR:100', ''), 'site_logo' => array('VCHAR:200', ''), @@ -1601,7 +1732,7 @@ function get_schema_struct() 'topic_attachment' => array('BOOL', 0), 'topic_approved' => array('BOOL', 1), 'topic_reported' => array('BOOL', 0), - 'topic_title' => array('XSTEXT', ''), + 'topic_title' => array('XSTEXT_UNI', ''), 'topic_poster' => array('UINT', 0), 'topic_time' => array('TIMESTAMP', 0), 'topic_time_limit' => array('TIMESTAMP', 0), @@ -1611,16 +1742,19 @@ function get_schema_struct() 'topic_status' => array('TINT:3', 0), 'topic_type' => array('TINT:3', 0), 'topic_first_post_id' => array('UINT', 0), - 'topic_first_poster_name' => array('VCHAR', ''), + 'topic_first_poster_name' => array('VCHAR_UNI', ''), + 'topic_first_poster_colour' => array('VCHAR:6', ''), 'topic_last_post_id' => array('UINT', 0), 'topic_last_poster_id' => array('UINT', 0), - 'topic_last_poster_name' => array('VCHAR', ''), + 'topic_last_poster_name' => array('VCHAR_UNI', ''), + 'topic_last_poster_colour' => array('VCHAR:6', ''), + 'topic_last_post_subject' => array('XSTEXT_UNI', ''), 'topic_last_post_time' => array('TIMESTAMP', 0), 'topic_last_view_time' => array('TIMESTAMP', 0), 'topic_moved_id' => array('UINT', 0), 'topic_bumped' => array('BOOL', 0), 'topic_bumper' => array('UINT', 0), - 'poll_title' => array('XSTEXT', ''), + 'poll_title' => array('XSTEXT_UNI', ''), 'poll_start' => array('TIMESTAMP', 0), 'poll_length' => array('TIMESTAMP', 0), 'poll_max_options' => array('TINT:4', 1), @@ -1632,6 +1766,7 @@ function get_schema_struct() 'forum_id' => array('INDEX', 'forum_id'), 'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')), 'last_post_time' => array('INDEX', 'topic_last_post_time'), + 'topic_approved' => array('INDEX', 'topic_approved'), 'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')), ), ); @@ -1695,25 +1830,28 @@ function get_schema_struct() 'user_ip' => array('VCHAR:40', ''), 'user_regdate' => array('TIMESTAMP', 0), 'username' => array('VCHAR_CI', ''), - 'user_password' => array('VCHAR:40', ''), + 'username_clean' => array('VCHAR_CI', ''), + 'user_password' => array('VCHAR_UNI:40', ''), 'user_passchg' => array('TIMESTAMP', 0), - 'user_email' => array('VCHAR:100', ''), + 'user_email' => array('VCHAR_UNI:100', ''), 'user_email_hash' => array('BINT', 0), 'user_birthday' => array('VCHAR:10', ''), 'user_lastvisit' => array('TIMESTAMP', 0), 'user_lastmark' => array('TIMESTAMP', 0), 'user_lastpost_time' => array('TIMESTAMP', 0), - 'user_lastpage' => array('VCHAR:200', ''), + 'user_lastpage' => array('VCHAR_UNI:200', ''), 'user_last_confirm_key' => array('VCHAR:10', ''), 'user_last_search' => array('TIMESTAMP', 0), 'user_warnings' => array('TINT:4', 0), 'user_last_warning' => array('TIMESTAMP', 0), 'user_login_attempts' => array('TINT:4', 0), + 'user_inactive_reason' => array('TINT:2', 0), + 'user_inactive_time' => array('TIMESTAMP', 0), 'user_posts' => array('UINT', 0), 'user_lang' => array('VCHAR:30', ''), 'user_timezone' => array('DECIMAL', 0), 'user_dst' => array('BOOL', 0), - 'user_dateformat' => array('VCHAR:30', 'd M Y H:i'), + 'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'), 'user_style' => array('TINT:4', 0), 'user_rank' => array('UINT', 0), 'user_colour' => array('VCHAR:6', ''), @@ -1733,36 +1871,35 @@ function get_schema_struct() 'user_notify_pm' => array('BOOL', 1), 'user_notify_type' => array('TINT:4', 0), 'user_allow_pm' => array('BOOL', 1), - 'user_allow_email' => array('BOOL', 1), 'user_allow_viewonline' => array('BOOL', 1), 'user_allow_viewemail' => array('BOOL', 1), 'user_allow_massemail' => array('BOOL', 1), 'user_options' => array('UINT:11', 893), 'user_avatar' => array('VCHAR', ''), 'user_avatar_type' => array('TINT:2', 0), - 'user_avatar_width' => array('TINT:4', 0), - 'user_avatar_height' => array('TINT:4', 0), - 'user_sig' => array('MTEXT', ''), + 'user_avatar_width' => array('USINT', 0), + 'user_avatar_height' => array('USINT', 0), + 'user_sig' => array('MTEXT_UNI', ''), 'user_sig_bbcode_uid' => array('VCHAR:5', ''), - 'user_sig_bbcode_bitfield' => array('VCHAR:252', ''), - 'user_from' => array('VCHAR:100', ''), + 'user_sig_bbcode_bitfield' => array('VCHAR:255', ''), + 'user_from' => array('VCHAR_UNI:100', ''), 'user_icq' => array('VCHAR:15', ''), - 'user_aim' => array('VCHAR', ''), - 'user_yim' => array('VCHAR', ''), - 'user_msnm' => array('VCHAR', ''), - 'user_jabber' => array('VCHAR', ''), - 'user_website' => array('VCHAR:200', ''), - 'user_occ' => array('VCHAR', ''), - 'user_interests' => array('TEXT', ''), + 'user_aim' => array('VCHAR_UNI', ''), + 'user_yim' => array('VCHAR_UNI', ''), + 'user_msnm' => array('VCHAR_UNI', ''), + 'user_jabber' => array('VCHAR_UNI', ''), + 'user_website' => array('VCHAR_UNI:200', ''), + 'user_occ' => array('VCHAR_UNI', ''), + 'user_interests' => array('TEXT_UNI', ''), 'user_actkey' => array('VCHAR:32', ''), - 'user_newpasswd' => array('VCHAR:32', ''), + 'user_newpasswd' => array('VCHAR_UNI:32', ''), ), 'PRIMARY_KEY' => 'user_id', 'KEYS' => array( 'user_birthday' => array('INDEX', 'user_birthday'), 'user_email_hash' => array('INDEX', 'user_email_hash'), 'user_type' => array('INDEX', 'user_type'), - 'username' => array('INDEX', 'username'), + 'username_clean' => array('INDEX', 'username_clean'), ), ); @@ -1780,8 +1917,8 @@ function get_schema_struct() $schema_data['phpbb_words'] = array( 'COLUMNS' => array( 'word_id' => array('UINT', NULL, 'auto_increment'), - 'word' => array('VCHAR', ''), - 'replacement' => array('VCHAR', ''), + 'word' => array('VCHAR_UNI', ''), + 'replacement' => array('VCHAR_UNI', ''), ), 'PRIMARY_KEY' => 'word_id', ); @@ -1858,7 +1995,7 @@ EOF; /* Domain definition */ -CREATE DOMAIN varchar_ci AS varchar(252) NOT NULL DEFAULT ''::character varying; +CREATE DOMAIN varchar_ci AS varchar(255) NOT NULL DEFAULT ''::character varying; /* Operation Functions @@ -1932,27 +2069,6 @@ CREATE OPERATOR =( EOF; break; - - case 'firebird': - return <<<EOF - -# Emulation of STRLEN, might need to be checked out for FB 2.0 -DECLARE EXTERNAL FUNCTION STRLEN CSTRING(32767) -RETURNS INTEGER BY VALUE -ENTRY_POINT 'IB_UDF_strlen' MODULE_NAME 'ib_udf';; - -# Emulation of LOWER, might need to be checked out for FB 2.0 -DECLARE EXTERNAL FUNCTION LOWER CSTRING(80) -RETURNS CSTRING(80) FREE_IT -ENTRY_POINT 'IB_UDF_lower' MODULE_NAME 'ib_udf';; - -# Only used for insertion of binary strings as defaults -DECLARE EXTERNAL FUNCTION ASCII_CHAR INTEGER -RETURNS CSTRING(1) FREE_IT -ENTRY_POINT 'IB_UDF_ascii_char' MODULE_NAME 'ib_udf';; - -EOF; - break; } return ''; diff --git a/phpBB/develop/fill.php b/phpBB/develop/fill.php index 3d01b2478e..2aee3d333f 100644 --- a/phpBB/develop/fill.php +++ b/phpBB/develop/fill.php @@ -12,7 +12,7 @@ // ------------------------------------------------------------- define('IN_PHPBB', true); -$phpbb_root_path = './'; +$phpbb_root_path = './../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); @@ -22,13 +22,13 @@ header('Expires: 0'); ignore_user_abort(true); // number of topics to create -$num_topics = 5000000; +$num_topics = 10000; // number of topics to be generated per call -$batch_size = 100000; +$batch_size = 2000; // max number of posts per topic -$posts_per_topic = 500000; +$posts_per_topic = 500; // general vars @@ -40,7 +40,7 @@ switch ($mode) case 'generate': $user_ids = $forum_ids = $topic_rows = array(); - $sql = 'SELECT user_id FROM ' . USERS_TABLE; + $sql = 'SELECT user_id FROM ' . USERS_TABLE . ' WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') OR user_id = ' . ANONYMOUS; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { @@ -60,7 +60,7 @@ switch ($mode) { $db->sql_query('TRUNCATE TABLE ' . POSTS_TABLE); $db->sql_query('TRUNCATE TABLE ' . TOPICS_TABLE); - $db->sql_query('TRUNCATE TABLE ' . TOPICS_TABLE . '_prefetch'); +// $db->sql_query('TRUNCATE TABLE ' . TOPICS_TABLE . '_prefetch'); } $db->sql_query('LOCK TABLES ' . POSTS_TABLE . ' WRITE, ' . TOPICS_TABLE . ' WRITE'); @@ -86,7 +86,7 @@ switch ($mode) $rows = array(); $post_time = mt_rand(0, time()); - $num_posts = mt_rand(1, $posts_per_topic); + $num_posts = $posts_per_topic; //mt_rand(1, $posts_per_topic); for ($i = 0; $i < $num_posts; ++$i) { $poster_id = $user_ids[array_rand($user_ids)]; @@ -108,18 +108,20 @@ switch ($mode) if ($topic_id >= $num_topics) { - echo '<meta http-equiv="refresh" content="0; url=fill.' . $phpEx . '?mode=sync&' . time() . '">And now for something completely different...'; + echo '<meta http-equiv="refresh" content="10; url=fill.' . $phpEx . '?mode=sync&' . time() . '">And now for something completely different...'; $db->sql_query('ANALYZE TABLES ' . TOPICS_TABLE . ', ' . POSTS_TABLE); + flush(); } else { - echo '<meta http-equiv="refresh" content="0; url=fill.' . $phpEx . '?start=' . $topic_id . '&' . time() . '">To the next page... (' . $topic_id . '/' . $num_topics . ')'; + echo '<meta http-equiv="refresh" content="10; url=fill.' . $phpEx . '?start=' . $topic_id . '&' . time() . '">To the next page... (' . $topic_id . '/' . $num_topics . ')'; + flush(); } break; case 'sync': - error_reporting(E_ALL); +/* error_reporting(E_ALL); $sync_all = TRUE; if ($sync_all) @@ -158,8 +160,11 @@ switch ($mode) { trigger_error('Done'); } + */ } +$db->sql_close(); + function rndm_username() { static $usernames; diff --git a/phpBB/develop/generate_utf_casefold.php b/phpBB/develop/generate_utf_casefold.php new file mode 100644 index 0000000000..68cc83d880 --- /dev/null +++ b/phpBB/develop/generate_utf_casefold.php @@ -0,0 +1,147 @@ +<?php +/** +* +* @package phpBB3 +* @version $Id$ +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +if (php_sapi_name() != 'cli') +{ + die("This program must be run from the command line.\n"); +} + +set_time_limit(0); + +define('IN_PHPBB', true); +$phpbb_root_path = '../'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); + +echo "Checking for required files\n"; +download('http://unicode.org/Public/UNIDATA/CaseFolding.txt'); +echo "\n"; + + +/** +* Load the CaseFolding table +*/ +echo "Loading CaseFolding\n"; +$unidata = file_get_contents('CaseFolding.txt'); + + +function utf8_chr($cp) +{ + if ($cp > 0xFFFF) + { + return chr(0xF0 | ($cp >> 18)) . chr(0x80 | (($cp >> 12) & 0x3F)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F)); + } + else if ($cp > 0x7FF) + { + return chr(0xE0 | ($cp >> 12)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F)); + } + else if ($cp > 0x7F) + { + return chr(0xC0 | ($cp >> 6)) . chr(0x80 | ($cp & 0x3F)); + } + else + { + return chr($cp); + } +} + +preg_match_all('/^([0-9A-F]+); ([CFS]); ([0-9A-F]+(?: [0-9A-F]+)*);/im', $unidata, $array, PREG_SET_ORDER); + +$uniarray = array(); + +foreach ($array as $value) +{ + $uniarray[$value[2]][utf8_chr(hexdec((string)$value[1]))] = implode(array_map('utf8_chr', array_map('hexdec', explode(' ', $value[3])))); +} + +foreach ($uniarray as $idx => $contents) +{ + echo "Writing to case_fold_$idx.$phpEx\n"; + $fp = fopen($phpbb_root_path . 'includes/utf/data/case_fold_' . strtolower($idx) . '.' . $phpEx, 'wb'); + fwrite($fp, '<?php return ' . my_var_export($contents) . ';'); + fclose($fp); +} + +/** +* Return a parsable string representation of a variable +* +* This is function is limited to array/strings/integers +* +* @param mixed $var Variable +* @return string PHP code representing the variable +*/ +function my_var_export($var) +{ + if (is_array($var)) + { + $lines = array(); + + foreach ($var as $k => $v) + { + $lines[] = my_var_export($k) . '=>' . my_var_export($v); + } + + return 'array(' . implode(',', $lines) . ')'; + } + elseif (is_string($var)) + { + return "'" . str_replace(array('\\', "'"), array('\\\\', "\\'"), $var) . "'"; + } + else + { + return $var; + } +} + +/** +* Download a file to the develop/ dir +* +* @param string $url URL of the file to download +* @return void +*/ +function download($url) +{ + global $phpbb_root_path; + + if (file_exists($phpbb_root_path . 'develop/' . basename($url))) + { + return; + } + + echo 'Downloading from ', $url, ' '; + + if (!$fpr = fopen($url, 'rb')) + { + die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai"); + } + + if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb')) + { + die("Can't open develop/" . basename($url) . " for output... please check your permissions or something"); + } + + $i = 0; + $chunk = 32768; + $done = ''; + + while (!feof($fpr)) + { + $i += fwrite($fpw, fread($fpr, $chunk)); + echo str_repeat("\x08", strlen($done)); + + $done = ($i >> 10) . ' KiB'; + echo $done; + } + fclose($fpr); + fclose($fpw); + + echo "\n"; +} + +?>
\ No newline at end of file diff --git a/phpBB/develop/merge_attachment_tables.php b/phpBB/develop/merge_attachment_tables.php index 6e79515319..ae7fe57be4 100644 --- a/phpBB/develop/merge_attachment_tables.php +++ b/phpBB/develop/merge_attachment_tables.php @@ -48,7 +48,7 @@ $sql = "CREATE TABLE {$table_prefix}attachments AND a.post_id = p.post_id"; $db->sql_query($sql); -switch (SQL_LAYER) +switch ($db->sql_layer) { case 'mysql': case 'mysql4': diff --git a/phpBB/develop/merge_post_tables.php b/phpBB/develop/merge_post_tables.php index eb0cf2986a..3567a569c6 100644 --- a/phpBB/develop/merge_post_tables.php +++ b/phpBB/develop/merge_post_tables.php @@ -54,7 +54,7 @@ $sql = "CREATE TABLE {$table_prefix}posts WHERE pt.post_id = p.post_id"; $db->sql_query($sql); -switch (SQL_LAYER) +switch ($db->sql_layer) { case 'mysql': case 'mysql4': @@ -150,7 +150,7 @@ while ($row = $db->sql_fetchrow($result)) } $db->sql_freeresult($result); -switch (SQL_LAYER) +switch ($db->sql_layer) { case 'oracle': $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id diff --git a/phpBB/docs/AUTHORS b/phpBB/docs/AUTHORS index a14d037a96..24072f19b6 100644 --- a/phpBB/docs/AUTHORS +++ b/phpBB/docs/AUTHORS @@ -23,18 +23,21 @@ phpBB Developers : Ashe (Ludovic Arnaud) - [10/2002 - 11/2003, 06/2006 - ] BartVB (Bart van Bragt) - [11/2000 - 03/2006] -Original subSilver by subBlue Design, Tom Beddard, © 2001 phpBB Group +Original subSilver by subBlue Design, Tom Beddard, (c) 2001 phpBB Group phpBB3 contains code from the following applications: LGPL licenced: -Smarty © 2001, 2002 by ispi of Lincoln, Inc, http://smarty.php.net/ -Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff +Smarty (c) 2001, 2002 by ispi of Lincoln, Inc, http://smarty.php.net/ GPL licenced: -phpMyAdmin © 2001,2003 phpMyAdmin Devel team, http://www.phpmyadmin.net/ -Jabber class © 2003 Carlo Zottmann, http://phpjabber.g-blog.net +phpMyAdmin (c) 2001,2003 phpMyAdmin Devel team, http://www.phpmyadmin.net/ +Jabber Class (c) 2004 Nathan Fritz, http://cjphp.netflint.net +Chora (c) 2000-2006, The Horde Project. http://horde.org/chora/ +Horde Project (c) 2000-2006, The Horde Project. http://horde.org/ PHP License, version 3.0: -Pear © 2001-2004 PHP Group, http://pear.php.net +Pear (c) 2001-2004 PHP Group, http://pear.php.net + +Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 5510a28b78..8785ae619d 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -12,7 +12,6 @@ <meta name="author" content="phpBB Group" /> <meta name="copyright" content="phpBB Group" /> <meta name="MSSmartTagsPreventParsing" content="true" /> -<link rel="shortcut icon" href="" /> <style type="text/css"> <!-- @@ -151,6 +150,10 @@ p a { .menu li a { font-size: 100%; } + +.comment { + color: green; +} //--> </style> @@ -179,7 +182,7 @@ body { <a name="top"></a><div id="main"> -<p>These are the phpBB Coding Guidelines for Olympus, all attempts should be made to follow it as closely as possible. This document is (c) 2006 phpBB Group, copying or redistribution is not allowed without permission.</p> +<p>These are the phpBB Coding Guidelines for Olympus, all attempts should be made to follow it as closely as possible.<br />This document is (c) 2006 phpBB Group, copying or redistribution is not allowed without permission.</p> <h1>Coding Guidelines</h1> @@ -214,12 +217,12 @@ body { <div class="paragraph"> <h3>Tabs vs Spaces:</h3> - <p>In order to make this as simple as possible, we will be using tabs, not spaces. Feel free to set how many spaces your editor uses when it <b>displays</b> tabs, but make sure that when you <b>save</b> the file, it's saving tabs and not spaces. This way, we can each have the code be displayed the way we like it, without breaking the layout of the actual files.</p> - <p>Additionally please check your editor for the indent size. If tabs are set to 4 spaces for example, the indent size needs to be 4 too:</p> - + <p>In order to make this as simple as possible, we will be using tabs, not spaces. We enforce 4 (four) spaces for one tab - therefore you need to set your tab width within your editor to 4 spaces. Make sure that when you <b>save</b> the file, it's saving tabs and not spaces. This way, we can each have the code be displayed the way we like it, without breaking the layout of the actual files.</p> + <p>Tabs in front of lines are no problem, but having them within the text can be a problem if you do not set it to the amount of spaces every one of us uses. Here is a short example of how it should look like:</p> + <blockquote><pre> -$mode{TAB}{TAB}= request_var('mode', ''); -$search_id{TAB}= request_var('search_id', ''); +{TAB}$mode{TAB}{TAB}= request_var('mode', ''); +{TAB}$search_id{TAB}= request_var('search_id', ''); </pre></blockquote> <p>If entered with tabs (replace the {TAB}) both equal signs need to be on the same column.</p> @@ -280,9 +283,7 @@ $search_id{TAB}= request_var('search_id', ''); <blockquote><pre> /** -* * {HEADER} -* */ /** @@ -304,31 +305,26 @@ class ... <br /><br /> <div class="paragraph"> - <p>Functions used by more than one page should be placed in functions.php, functions specific to one page should be placed on that page (at the bottom) or within the relevant sections functions file.</p> + <p>Functions used by more than one page should be placed in functions.php, functions specific to one page should be placed on that page (at the bottom) or within the relevant sections functions file. Some files in <code>/includes</code> are holding functions responsible for special sections, for example uploading files, displaying "things", user related functions and so forth.</p> <p>The following packages are defined, and related new features/functions should be placed within the mentioned files/locations, as well as specifying the correct package name. The package names are bold within this list:</p> <ul class="menu"> <li><b>phpBB3</b><br />Core files and all files not assigned to a seperate package</li> - <li><b>acm</b><br /><code>/includes/acm</code><br />Cache System, seperated because of equal class names - <ul> - <li><b>acm_main</b><br /><code>/includes/acm/acm_main.php</code><br />Base caching class. All functions obtaining cached data should be placed into this file</li> - <li><b>acm_db</b><br /><code>/includes/acm/acm_db.php</code><br />Database based caching</li> - <li><b>acm_file</b><br /><code>/includes/acm/acm_file.php</code><br />File based caching</li> - </ul> - </li> + <li><b>acm</b><br /><code>/includes/acm</code>, <code>/includes/cache.php</code><br />Cache System</li> <li><b>acp</b><br /><code>/adm</code>, <code>/includes/acp</code>, <code>/includes/functions_admin.php</code><br />Administration Control Panel</li> <li><b>dbal</b><br /><code>/includes/db</code><br />Database Abstraction Layer.<br />Base class is <code>dbal</code> <ul> - <li><b>dbal_firebird</b><br /><code>/includes/db/firebird.php</code><br />Firebird/Interbase Database Abstraction Layer<br />Minimum Requirement is Firebird 1.5+/Interbase 7.1+</li> - <li><b>dbal_mssql</b><br /><code>/includes/db/msssql.php</code><br />MSSQL Database Abstraction Layer<br />Minimum Requirement is MSSQL 2000+</li> - <li><b>dbal_mssql_odbc</b><br /><code>/includes/db/mssql_odbc.php</code><br />MSSQL ODBC Database Abstraction Layer for MSSQL<br />Minimum Requirement is Version 2000+</li> - <li><b>dbal_mysql</b><br /><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer<br />Minimum Requirement is 3.23+/4.0+/4.1+</li> - <li><b>dbal_mysql4</b><br /><code>/includes/db/mysql4.php</code><br />MySQL4 Database Abstraction Layer<br />Minimum Requirement is 4.0+/4.1+/5.0+</li> - <li><b>dbal_mysqli</b><br /><code>/includes/db/mysqli.php</code><br />MySQLi Database Abstraction Layer<br />Minimum Requirement is MySQLi extension with MySQL 4.1+/5.0+</li> - <li><b>dbal_oracle</b><br /><code>/includes/db/oracle.php</code><br />Oracle Database Abstraction Layer</li> - <li><b>dbal_postgres</b><br /><code>/includes/db/postgres.php</code><br />PostgreSQL Database Abstraction Layer<br />Minimum Requirement is Version 7.3+</li> - <li><b>dbal_sqlite</b><br /><code>/includes/db/sqlite.php</code><br />Sqlite Database Abstraction Layer</li> + <li><code>/includes/db/dbal.php</code><br />Base DBAL class, defining the overall framework as well as common detominators</li> + <li><code>/includes/db/firebird.php</code><br />Firebird/Interbase Database Abstraction Layer</li> + <li><code>/includes/db/msssql.php</code><br />MSSQL Database Abstraction Layer</li> + <li><code>/includes/db/mssql_odbc.php</code><br />MSSQL ODBC Database Abstraction Layer for MSSQL</li> + <li><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer for MySQL 3.x/4.0.x</li> + <li><code>/includes/db/mysql4.php</code><br />MySQL4 Database Abstraction Layer for MySQL 4.1.x/5.x</li> + <li><code>/includes/db/mysqli.php</code><br />MySQLi Database Abstraction Layer</li> + <li><code>/includes/db/oracle.php</code><br />Oracle Database Abstraction Layer</li> + <li><code>/includes/db/postgres.php</code><br />PostgreSQL Database Abstraction Layer</li> + <li><code>/includes/db/sqlite.php</code><br />Sqlite Database Abstraction Layer</li> </ul> </li> <li><b>docs</b><br /><code>/docs</code><br />phpBB Documentation</li> @@ -336,6 +332,7 @@ class ... <li><b>install</b><br /><code>/install</code><br />Installation System</li> <li><b>language</b><br /><code>/language</code><br />All language files</li> <li><b>login</b><br /><code>/includes/auth</code><br />Login Authentication Plugins</li> + <li><b>VC</b><br /><code>/includes/captcha</code><br />CAPTCHA</li> <li><b>mcp</b><br /><code>mcp.php</code>, <code>/includes/mcp</code>, <code>report.php</code><br />Moderator Control Panel</li> <li><b>ucp</b><br /><code>ucp.php</code>, <code>/includes/ucp</code><br />User Control Panel</li> <li><b>search</b><br /><code>/includes/search</code>, <code>search.php</code><br />Search System</li> @@ -350,7 +347,7 @@ class ... <a name="code"></a><h1>2. Code Layout/Guidelines</h1> - <p>Please note that these Guidelines also applies to javascript code.</p> + <p>Please note that these Guidelines applies to all php, html, javascript and css files.</p> <a name="namingvars"></a><b>2.i. Variable/Function Naming</b> <br /><br /> @@ -369,6 +366,7 @@ class ... <h3>Loop Indices:</h3> <p>The <em>only</em> situation where a one-character variable name is allowed is when it's the index for some looping construct. In this case, the index of the outer loop should always be $i. If there's a loop inside that loop, its index should be $j, followed by $k, and so on. If the loop is being indexed by some already-existing variable with a meaningful name, this guideline does not apply, example:</p> + <blockquote><pre> for ($i = 0; $i < $outer_size; $i++) { @@ -404,6 +402,7 @@ for ($i = 0; $i < $outer_size; $i++) <p>This is another case of being too lazy to type 2 extra characters causing problems with code clarity. Even if the body of some construct is only one line long, do <em>not</em> drop the braces. Just don't, examples:</p> <p class="bad">// These are all wrong. </p> + <blockquote><pre> if (condition) do_stuff(); @@ -471,6 +470,7 @@ function do_stuff() <p>This is another simple, easy step that helps keep code readable without much effort. Whenever you write an assignment, expression, etc.. Always leave <em>one</em> space between the tokens. Basically, write code as if it was English. Put spaces between variable names and operators. Don't put spaces just after an opening bracket or before a closing bracket. Don't put spaces just before a comma or a semicolon. This is best shown with a few examples, examples:</p> <p>// Each pair shows the wrong way followed by the right way. </p> + <blockquote><pre> $i=0; $i = 0; @@ -481,8 +481,8 @@ if ($i < 7) ... if ( ($i < 7)&&($j > 8) ) ... if ($i < 7 && $j > 8) ... -do_stuff( $i, "foo", $b ); -do_stuff($i, "foo", $b); +do_stuff( $i, 'foo', $b ); +do_stuff($i, 'foo', $b); for($i=0; $i<$size; $i++) ... for ($i = 0; $i < $size; $i++) ... @@ -552,8 +552,18 @@ $foo = $assoc_array[blah]; $foo = $assoc_array['blah']; </pre></blockquote> + <p class="bad">// wrong</p> + <blockquote><pre> +$foo = $assoc_array["$var"]; + </pre></blockquote> + + <p class="good">// right </p> + <blockquote><pre> +$foo = $assoc_array[$var]; + </pre></blockquote> + <h3>Comments:</h3> - <p>Each complex function should be preceded by a comment that tells a programmer everything they need to know to use that function. The meaning of every parameter, the expected input, and the output are required as a minimal comment. The function's behaviour in error conditions (and what those error conditions are) should also be present.<br /><br />Especially important to document are any assumptions the code makes, or preconditions for its proper operation. Any one of the developers should be able to look at any part of the application and figure out what's going on in a reasonable amount of time. Avoid using <code>/* */</code> comment blocks for one-line comments, <code>//</code> should be used for one/two-liners.</p> + <p>Each complex function should be preceded by a comment that tells a programmer everything they need to know to use that function. The meaning of every parameter, the expected input, and the output are required as a minimal comment. The function's behaviour in error conditions (and what those error conditions are) should also be present - but mostly included within the comment about the output.<br /><br />Especially important to document are any assumptions the code makes, or preconditions for its proper operation. Any one of the developers should be able to look at any part of the application and figure out what's going on in a reasonable amount of time.<br /><br />Avoid using <code>/* */</code> comment blocks for one-line comments, <code>//</code> should be used for one/two-liners.</p> <h3>Magic numbers:</h3> <p>Don't use them. Use named constants for any literal value other than obvious special cases. Basically, it's ok to check if an array has 0 elements by using the literal 0. It's not ok to assign some special meaning to a number and then use it everywhere as a literal. This hurts readability AND maintainability. The constants <code>true</code> and <code>false</code> should be used in place of the literals 1 and 0 -- even though they have the same values (but not type!), it's more obvious what the actual logic is when you use the named constants. Typecast variables where it is needed, do not rely on the correct variable type (PHP is currently very loose on typecasting which can lead to security problems if a developer does not have a very close eye to it).</p> @@ -590,7 +600,7 @@ $min = ($i < $j) ? $i : $j; </pre></blockquote> <h3>Don't use uninitialized variables.</h3> - <p>For phpBB3, we intend to use a higher level of run-time error reporting. This will mean that the use of an uninitialized variable will be reported as a warning. These warnings can be avoided by using the built-in isset() function to check whether a variable has been set, examples:</p> + <p>For phpBB3, we intend to use a higher level of run-time error reporting. This will mean that the use of an uninitialized variable will be reported as a warning. These warnings can be avoided by using the built-in isset() function to check whether a variable has been set - but preferably the variable is always existing. For checking if an array has a key set this can come in handy though, examples:</p> <p class="bad">// Wrong </p> <blockquote><pre> @@ -607,6 +617,8 @@ if (isset($forum)) ... if (isset($forum) && $forum == 5) </pre></blockquote> + <p>The <code>empty()</code> function is useful if you want to check if a variable is not set or being empty (an empty string, 0 as an integer or string, NULL, false, an empty array or a variable declared, but without a value in a class). Therefore empty should be used in favor of <code>isset($array) && sizeof($array) > 0</code> - this can be written in a shorter way as <code>!empty($array)</code>.</p> + <h3>Switch statements:</h3> <p>Switch/case code blocks can get a bit long sometimes. To have some level of notice and being in-line with the opening/closing brace requirement (where they are on the same line for better readability), this also applies to switch/case code blocks and the breaks. An example:</p> @@ -704,7 +716,7 @@ switch ($mode) <div class="paragraph"> <h3>Common SQL Guidelines: </h3> - <p>All SQL should be cross-DB compatible, if DB specific SQL is used alternatives must be provided which work on all supported DB's (MySQL3/4/5, MSSQL (7.0 and 2000), PostgreSQL (7.0+), Firebird, SQLite, Oracle8, ODBC (generalised if possible, otherwise DB2)).</p> + <p>All SQL should be cross-DB compatible, if DB specific SQL is used alternatives must be provided which work on all supported DB's (MySQL3/4/5, MSSQL (7.0 and 2000), PostgreSQL (7.0+), Firebird, SQLite, Oracle8, ODBC (generalised if possible)).</p> <p>All SQL commands should utilise the DataBase Abstraction Layer (DBAL)</p> <h3>SQL code layout:</h3> @@ -731,7 +743,7 @@ $sql = 'SELECT * </pre></blockquote> <h3>SQL Quotes: </h3> - <p>Double quotes where applicable ... examples: </p> + <p>Double quotes where applicable (The variables in these examples are typecasted to integers before) ... examples: </p> <p class="bad">// These are wrong.</p> <blockquote><pre> @@ -752,6 +764,8 @@ $sql = 'SELECT * <h3>Common DBAL methods: </h3> + <h3>sql_escape():</h3> + <p>Always use <code>$db->sql_escape()</code> if you need to check for a string within an SQL statement (even if you are sure the variable can not contain single quotes - never trust your input), for example:</p> <blockquote><pre> @@ -760,7 +774,9 @@ $sql = 'SELECT * WHERE username = '" . $db->sql_escape($username) . "'"; </pre></blockquote> - <p>If you need to UPDATE or INSERT data, make use of the <code>$db->sql_build_array()</code> function. This function already escapes strings and checkes other types, so there is no need to do this here. The data to be inserted should go into an array - <code>$sql_ary</code> - or directly within the statement if one one or two variables needs to be inserted/updated. An example of an insert statement would be:</p> + <h3>sql_build_array():</h3> + + <p>If you need to UPDATE or INSERT data, make use of the <code>$db->sql_build_array()</code> function. This function already escapes strings and checks other types, so there is no need to do this here. The data to be inserted should go into an array - <code>$sql_ary</code> - or directly within the statement if one one or two variables needs to be inserted/updated. An example of an insert statement would be:</p> <blockquote><pre> $sql_ary = array( @@ -782,13 +798,127 @@ $sql_ary = array( ); $sql = 'UPDATE ' . SOME_TABLE . ' - SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " - WHERE user_id = $user_id"; + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . (int) $user_id; $db->sql_query($sql); </pre></blockquote> <p>The <code>$db->sql_build_array()</code> function supports the following modes: <code>INSERT</code> (example above), <code>INSERT_SELECT</code> (building query for <code>INSERT INTO table (...) SELECT value, column ...</code> statements), <code>MULTI_INSERT</code> (for returning extended inserts), <code>UPDATE</code> (example above) and <code>SELECT</code> (for building WHERE statement [AND logic]).</p> + <h3>sql_in_set():</h3> + + <p>The <code>$db->sql_in_set()</code> function should be used for building <code>IN ()</code> and <code>NOT IN ()</code> constructs. Since (specifically) MySQL tend to be faster if for one value to be compared the <code>=</code> and <code><></code> operator is used, we let the DBAL decide what to do. A typical example of doing a positive match against a number of values would be:</p> + + <blockquote><pre> +$sql = 'SELECT * + FROM ' . FORUMS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids); +$db->sql_query($sql); + </pre></blockquote> + + <p>Based on the number of values in $forum_ids, the query can look differently.</p> + + <p class="good">// SQL Statement if $forum_ids = array(1, 2, 3);</p> + + <blockquote><pre> +SELECT FROM phpbb_forums WHERE forum_id IN (1, 2, 3) + </pre></blockquote> + + <p class="good">// SQL Statement if $forum_ids = array(1) or $forum_ids = 1</p> + + <blockquote><pre> +SELECT FROM phpbb_forums WHERE forum_id = 1 + </pre></blockquote> + + <p>Of course the same is possible for doing a negative match against a number of values:</p> + + <blockquote><pre> +$sql = 'SELECT * + FROM ' . FORUMS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids, <strong>true</strong>); +$db->sql_query($sql); + </pre></blockquote> + + <p>Based on the number of values in $forum_ids, the query can look differently here too.</p> + + <p class="good">// SQL Statement if $forum_ids = array(1, 2, 3);</p> + + <blockquote><pre> +SELECT FROM phpbb_forums WHERE forum_id <strong>NOT</strong> IN (1, 2, 3) + </pre></blockquote> + + <p class="good">// SQL Statement if $forum_ids = array(1) or $forum_ids = 1</p> + + <blockquote><pre> +SELECT FROM phpbb_forums WHERE forum_id <strong><></strong> 1 + </pre></blockquote> + + <p>If the given array is empty, an error will be produced.</p> + + <h3>sql_build_query():</h3> + <p>The <code>$db->sql_build_query()</code> function is responsible for building sql statements for select and select distinct queries if you need to JOIN on more than one table or retrieving data from more than one table while doing a JOIN. This needs to be used to make sure the resulting statement is working on all supported db's. Instead of explaining every possible combination, i will give a short example:</p> + + <blockquote><pre> +$sql_array = array( + 'SELECT' => 'f.*, ft.mark_time', + + 'FROM' => array( + FORUMS_WATCH_TABLE => 'fw', + FORUMS_TABLE => 'f' + ), + + 'LEFT_JOIN' => array( + array( + 'FROM' => array(FORUMS_TRACK_TABLE => 'ft'), + 'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id' + ) + ); + + 'WHERE' => 'fw.user_id = ' . $user->data['user_id'] . ' + AND f.forum_id = fw.forum_id', + + 'ORDER_BY' => 'left_id' +); + +$sql = $db->sql_build_query('SELECT', $sql_array); + </pre></blockquote> + + <p>The possible first parameter for sql_build_query() is SELECT or SELECT_DISTINCT. As you can see, the logic is pretty self-explaining. For the LEFT_JOIN key, just add another array if you want to join on to tables for example. The added benefit of using this construct is that you are able to easily build the query statement based on conditions - for example the above LEFT_JOIN is only necessary if server side topic tracking is enabled; a slight adjustement would be:</p> + + <blockquote><pre> +$sql_array = array( + 'SELECT' => 'f.*', + + 'FROM' => array( + FORUMS_WATCH_TABLE => 'fw', + FORUMS_TABLE => 'f' + ), + + 'WHERE' => 'fw.user_id = ' . $user->data['user_id'] . ' + AND f.forum_id = fw.forum_id', + + 'ORDER_BY' => 'left_id' +); + +if ($config['load_db_lastread']) +{ + $sql_array['LEFT_JOIN'] = array( + array( + 'FROM' => array(FORUMS_TRACK_TABLE => 'ft'), + 'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id' + ) + ); + + $sql_array['SELECT'] .= ', ft.mark_time '; +} +else +{ + // Here we read the cookie data +} + +$sql = $db->sql_build_query('SELECT', $sql_array); + </pre></blockquote> + </div> <a href="#top">Top</a> <br /><br /> @@ -818,7 +948,7 @@ for ($i = 0, $size = sizeof($post_data); $i < $size; $i++) </pre></blockquote> <h3>Use of in_array(): </h3> - <p>Try to avoid using in_array() on huge arrays, and try to not place them into loops if the array to check consist of more than 20 entries. in_array() can be very time consuming and uses a lot of cpu processing time. For little checks it is not noticable, but if checked against a huge array within a loop those checks alone can be a bunch of seconds.</p> + <p>Try to avoid using in_array() on huge arrays, and try to not place them into loops if the array to check consist of more than 20 entries. in_array() can be very time consuming and uses a lot of cpu processing time. For little checks it is not noticable, but if checked against a huge array within a loop those checks alone can be a bunch of seconds. If you need this functionality, try using isset() on the arrays keys instead, actually shifting the values into keys and vice versa. A call to <code>isset($array[$var])</code> is a lot faster than <code>in_array($var, array_keys($array))</code> for example.</p> </div> <a href="#top">Top</a> @@ -830,9 +960,11 @@ for ($i = 0, $size = sizeof($post_data); $i < $size; $i++) <div class="paragraph"> <h3>General things:</h3> - <p>Never trust user input.</p> - <p>The auth class should be used for all authorisation checking</p> - <p>No attempt should be made to remove any copyright information (either contained within the source or displayed interactively when the source is run/compiled), neither should the copyright information be altered in any way (it may be added to)</p> + <p>Never trust user input (this also applies to server variables as well as cookies).</p> + <p>Try to sanitize values returned from a function.</p> + <p>Try to sanitize given function variables within your function.</p> + <p>The auth class should be used for all authorisation checking.</p> + <p>No attempt should be made to remove any copyright information (either contained within the source or displayed interactively when the source is run/compiled), neither should the copyright information be altered in any way (it may be added to).</p> <h3>Variables: </h3> <p>Make use of the <code>request_var()</code> function for anything except for submit or single checking params. </p> @@ -868,7 +1000,7 @@ $action_ary = request_var('action', array('' => 0)); <h3>Login checks/redirection: </h3> <p>To show a forum login box use <code>login_forum_box($forum_data)</code>, else use the <code>login_box()</code> function.</p> - <p>The <code>login_box()</code> function could have a redirect as the first parameter. As a thumb of rule, specify an empty string if you want to redirect to the users current location, else do not add the <code>$SID</code> to the redirect string (for example within the ucp/login we redirect to the board index because else the user would be redirected to the login screen).</p> + <p>The <code>login_box()</code> function can have a redirect as the first parameter. As a thumb of rule, specify an empty string if you want to redirect to the users current location, else do not add the <code>$SID</code> to the redirect string (for example within the ucp/login we redirect to the board index because else the user would be redirected to the login screen).</p> <h3>Sensitive Operations: </h3> <p>For sensitive operations always let the user confirm the action. For the confirmation screens, make use of the <code>confirm_box()</code> function.</p> @@ -882,22 +1014,36 @@ $auth->acl($user->data); $user->setup(); </pre></blockquote> - <p>The <code>$user->setup()</code> call can be used to pass on additional language definitions and a custom style (used in viewforum).</p> + <p>The <code>$user->setup()</code> call can be used to pass on additional language definition and a custom style (used in viewforum).</p> <h3>Errors and messages: </h3> - <p>All messages/errors should be output by calling <code>trigger_error()</code> using the appropriate message type and language string. Example:</p> + <p>All messages/errors should be outputed by calling <code>trigger_error()</code> using the appropriate message type and language string. Example:</p> <blockquote><pre> trigger_error('NO_FORUM'); </pre></blockquote> + <blockquote><pre> +trigger_error($user->lang['NO_FORUM']); + </pre></blockquote> + + <blockquote><pre> +trigger_error('NO_APPROPIATE_MODE', E_USER_ERROR); + </pre></blockquote> + <h3>Url formatting</h3> - <p>All urls pointing to internal files need to be prepended by the <code>$phpbb_root_path</code> variable. Within the administration control panel all urls pointing to internal files need to be prepended by the <code>$phpbb_admin_path</code> variable. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended.</p> - + <p>All urls pointing to internal files need to be prepended by the <code>$phpbb_root_path</code> variable. Within the administration control panel all urls pointing to internal files need to be prepended by the <code>$phpbb_admin_path</code> variable. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended (though some links will fail and the code need to be slightly adjusted).</p> + + <p>The <code>append_sid()</code> function from 2.0.x is available too, though does not handle url alterations automatically. Please have a look at the code documentation if you want to get more details on how to use append_sid(). A sample call to append_sid() can look like this:</p> + + <blockquote><pre> +append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) + </pre></blockquote> + <h3>General function usage: </h3> - <p>Some of these functions are only chosen over others because of a personal preference and are having no other benefit than to be consistant over the code.</p> + <p>Some of these functions are only chosen over others because of personal preference and having no other benefit than to be consistant over the code.</p> <ul> <li> @@ -909,6 +1055,12 @@ trigger_error('NO_FORUM'); <li> <p>Use <code>else if</code> instead of <code>elseif</code></p> </li> + <li> + <p>Use <code>false</code> (lowercase) instead of <code>FALSE</code></p> + </li> + <li> + <p>Use <code>true</code> (lowercase) instead of <code>TRUE</code></p> + </li> </ul> </div> @@ -921,7 +1073,7 @@ trigger_error('NO_FORUM'); <div class="paragraph"> <h3>General things</h3> -<p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms).</p> +<p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms). Please also note that the intendation and coding guidelines also apply to templates where possible.</p> <p>The outer table class <code>forumline</code> has gone and is replaced with <code>tablebg</code>.</p> <p>When writing <code><table></code> the order <code><table class="" cellspacing="" cellpadding="" border="" align=""></code> creates consistency and allows everyone to easily see which table produces which "look". The same applies to most other tags for which additional parameters can be set, consistency is the major aim here.</p> @@ -945,33 +1097,33 @@ trigger_error('NO_FORUM'); <p>Use a standard cellpadding of 2 and cellspacing of 0 on outer tables. Inner tables can vary from 0 to 3 or even 4 depending on the need.</p> -<p>Use div container for styling and table for data representation</p> +<p><strong>Use div container/css for styling and table for data representation.</strong></p> <p>The seperate catXXXX and thXXX classes are gone. When defining a header cell just use <code><th></code> rather than <code><th class="thHead"></code> etc. Similarly for cat, don't use <code><td class="catLeft"></code> use <code><td class="cat"></code> etc.</p> -<p>Try to retain consistency of basic layout and class useage, i.e. _EXPLAIN text should generally be placed below the title it explains, e.g. <code>{L_POST_USERNAME}<br /><span class="gensmall">{L_POST_USERNAME_EXPLAIN}</span></code> is the typical way of handling this ... there may be exceptions and this isn't a hard and fast rule</p> +<p>Try to retain consistency of basic layout and class useage, i.e. _EXPLAIN text should generally be placed below the title it explains, e.g. <code>{L_POST_USERNAME}<br /><span class="gensmall">{L_POST_USERNAME_EXPLAIN}</span></code> is the typical way of handling this ... there may be exceptions and this isn't a hard and fast rule.</p> <p>Try to keep template conditional and other statements tabbed in line with the block to which they refer.</p> -<p class="bad">this is incorrect</p> +<p class="good">this is correct</p> <blockquote><pre> -<!-- BEGIN test --> +<span class="comment"><!-- BEGIN test --></span> <tr> <td>{test.TEXT}</td> </tr> -<!-- END test --> +<span class="comment"><!-- END test --></span> </pre></blockquote> -<p class="good">this is correct:</p> +<p class="good">this is also correct:</p> <blockquote><pre> -<!-- BEGIN test --> +<span class="comment"><!-- BEGIN test --></span> <tr> <td>{test.TEXT}</td> </tr> -<!-- END test --> +<span class="comment"><!-- END test --></span> </pre></blockquote> -<p>it gives immediate feedback on exactly what is looping.</p> +<p>it gives immediate feedback on exactly what is looping - decide which way to use based on the readability.</p> </div> <a href="#top">Top</a> @@ -986,50 +1138,26 @@ trigger_error('NO_FORUM'); <p>Firstly templates now take the suffix ".html" rather than ".tpl". This was done simply to make the lifes of some people easier wrt syntax highlighting, etc.</p> <h3>Variables</h3> -<p>All template variables should be named appropriately (using underscores for spaces), language entries should be prefixed with L_, system data with S_, urls with U_, all other variables should be presented 'as is'.</p> +<p>All template variables should be named appropriately (using underscores for spaces), language entries should be prefixed with L_, system data with S_, urls with U_, javascript urls with UA_, language to be put in javascript statements with LA_, all other variables should be presented 'as is'.</p> -<p>Note that unlike 2.0.x most language strings are not assigned from the source. When a language variable is found {L_YYYYYY} phpBB first looks if an assigned variable exists with that name. If it does, it uses that. If not it looks if an exsting string defined in the language file exists. This should reduce the need to assign loads of new lang vars in Mods.</p> +<p>L_* template variables are automatically tried to be mapped to the corresponding language entry if the code does not set (and therefore overwrite) this variable specifically. For example <code>{L_USERNAME}</code> maps to <code>$user->lang['USERNAME']</code>. The LA_* template variables are handled within the same way, but properly escaped to be put in javascript code. This should reduce the need to assign loads of new lang vars in Mods. +</p> -<h3>Blocks</h3> +<h3>Blocks/Loops</h3> <p>The basic block level loop remains and takes the form:</p> <blockquote><pre> -<!-- BEGIN loopname --> -markup, {loopname.X_YYYYY}, etc. -<!-- END loopname --> -</pre></blockquote> - -<p>However this has now been extended with the following additions. Firstly you can set the start and end points of the loop. For example:</p> - -<blockquote><pre> -<!-- BEGIN loopname(2) --> -markup -<!-- END loopname --> +<span class="comment"><!-- BEGIN loopname --></span> + markup, {loopname.X_YYYYY}, etc. +<span class="comment"><!-- END loopname --></span> </pre></blockquote> -<p>Will start the loop on the third entry (note that indexes start at zero). Extensions of this are: -<br /><br /> -<code>loopname(2,4)</code>: Starts loop on third values, ends on fourth<br /> -<code>loopname(-4)</code>: Starts loop fourth from last value<br /> -<code>loopname(2, -4)</code>: Starts loop on third value, ends four from end<br /> -<br />Note that the indexing method may change since it's not really consistent at this time :)</p> - -<p>A further extension to begin is BEGINELSE:</p> - -<blockquote><pre> -<!-- BEGIN loop --> -markup -<!-- BEGINELSE --> -markup -<!-- END loop --> -</pre></blockquote> - -<p>This will cause the markup between <code>BEGINELSE</code> and <code>END</code> to be output if the loop contains no values. This is useful for forums with no topics (for example) ... in some ways it replaces "bits of" the existing "switch_" type control (the rest being replaced by conditionals, see below).</p> +<p>A bit later loops will be explained further. To not irretate you we will explain conditionals as well as other statements first.</p> <h3>Including files</h3> <p>Something that existed in 2.0.x which no longer exists in 3.0.x is the ability to assign a template to a variable. This was used (for example) to output the jumpbox. Instead (perhaps better, perhaps not but certainly more flexible) we now have INCLUDE. This takes the simple form:</p> <blockquote><pre> -<!-- INCLUDE filename --> +<span class="comment"><!-- INCLUDE filename --></span> </pre></blockquote> <p>You will note in the 3.0 templates the major sources start with <code><!-- INCLUDE overall_header.html --></code> or <code><!-- INCLUDE simple_header.html --></code>, etc. In 2.0.x control of "which" 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 "menu" bar or some such. No need to modify loads of files as with 2.0.x.</p> @@ -1038,15 +1166,15 @@ markup <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> <blockquote><pre> -<!-- PHP --> -echo "hello!"; -<!-- ENDPHP --> +<span class="comment"><!-- PHP --></span> + echo "hello!"; +<span class="comment"><!-- ENDPHP --></span> </pre></blockquote> <p>You may also include PHP from an external file using:</p> <blockquote><pre> -<!-- INCLUDEPHP somefile.php --> +<span class="comment"><!-- INCLUDEPHP somefile.php --></span> </pre></blockquote> <p>it will be included and executed inline.<br /><br />A note, it is very much encouraged that template designers do not include PHP. The ability to include raw PHP was introduced primarily to allow end users to include banner code, etc. without modifying multiple files (as with 2.0.x). It was not intended for general use ... hence <!-- w --><a href="http://www.phpbb.com">www.phpbb.com</a><!-- w --> will <strong>not</strong> make available template sets which include PHP. And by default templates will have PHP disabled (the admin will need to specifically activate PHP for a template).</p> @@ -1055,18 +1183,20 @@ echo "hello!"; <p>The most significant addition to 3.0.x are conditions or control structures, "if something then do this else do that". The system deployed is very similar to Smarty. This may confuse some people at first but it offers great potential and great flexibility with a little imagination. In their most simple form these constructs take the form:</p> <blockquote><pre> -<!-- IF expr --><br />markup<br /><!-- ENDIF --> +<span class="comment"><!-- IF expr --></span> + markup +<span class="comment"><!-- ENDIF --></span> </pre></blockquote> <p>expr can take many forms, for example:</p> <blockquote><pre> -<!-- IF loop.S_ROW_COUNT is even --> -markup -<!-- ENDIF --> +<span class="comment"><!-- IF loop.S_ROW_COUNT is even --></span> + markup +<span class="comment"><!-- ENDIF --></span> </pre></blockquote> -<p>This will output the markup if the S_ROW_COUNT variable in the current iteration of loop is an even value (i.e. the expr is TRUE). You can use various comparison methods (standard as well as equivalent textual versions noted in square brackets) including:</p> +<p>This will output the markup if the S_ROW_COUNT variable in the current iteration of loop is an even value (i.e. the expr is TRUE). You can use various comparison methods (standard as well as equivalent textual versions noted in square brackets) including (<code>not, or, and, eq, neq, is</code> should be used if possible for better readability):</p> <blockquote><pre> == [eq] @@ -1086,6 +1216,7 @@ markup - * / +, << (bitwise shift left) >> (bitwise shift right) | (bitwise or) @@ -1106,29 +1237,29 @@ div <p>Beyond the simple use of IF you can also do a sequence of comparisons using the following:</p> <blockquote><pre> -<!-- IF expr1 --> -markup -<!-- ELSEIF expr2 --> -markup -. -. -. -<!-- ELSEIF exprN --> -markup -<!-- ELSE --> -markup -<!-- ENDIF --> +<span class="comment"><!-- IF expr1 --></span> + markup +<span class="comment"><!-- ELSEIF expr2 --></span> + markup + . + . + . +<span class="comment"><!-- ELSEIF exprN --></span> + markup +<span class="comment"><!-- ELSE --></span> + markup +<span class="comment"><!-- ENDIF --></span> </pre></blockquote> <p>Each statement will be tested in turn and the relevant output generated when a match (if a match) is found. It is not necessary to always use ELSEIF, ELSE can be used alone to match "everything else".<br /><br />So what can you do with all this? Well take for example the colouration of rows in viewforum. In 2.0.x row colours were predefined within the source as either row color1, row color2 or row class1, row class2. In 3.0.x this is moved to the template, it may look a little daunting at first but remember control flows from top to bottom and it's not too difficult:</p> <blockquote><pre> <table> - <!-- IF loop.S_ROW_COUNT is even --> - <tr class="row1"> - <!-- ELSE --> - <tr class="row2"> - <!-- ENDIF --> + <span class="comment"><!-- IF loop.S_ROW_COUNT is even --></span> + <tr class="row1"> + <span class="comment"><!-- ELSE --></span> + <tr class="row2"> + <span class="comment"><!-- ENDIF --></span> <td>HELLO!</td> </tr> </table> @@ -1138,15 +1269,15 @@ markup <blockquote><pre> <table> - <!-- IF loop.S_ROW_COUNT > 10 --> - <tr bgcolor="#FF0000"> - <!-- ELSEIF loop.S_ROW_COUNT > 5 --> - <tr bgcolor="#00FF00"> - <!-- ELSEIF loop.S_ROW_COUNT > 2 --> - <tr bgcolor="#0000FF"> - <!-- ELSE --> - <tr bgcolor="#FF00FF"> - <!-- ENDIF --> + <span class="comment"><!-- IF loop.S_ROW_COUNT > 10 --></span> + <tr bgcolor="#FF0000"> + <span class="comment"><!-- ELSEIF loop.S_ROW_COUNT > 5 --></span> + <tr bgcolor="#00FF00"> + <span class="comment"><!-- ELSEIF loop.S_ROW_COUNT > 2 --></span> + <tr bgcolor="#0000FF"> + <span class="comment"><!-- ELSE --></span> + <tr bgcolor="#FF00FF"> + <span class="comment"><!-- ENDIF --></span> <td>hello!</td> </tr> </table> @@ -1155,13 +1286,229 @@ markup <p>This will output the row cell in purple for the first two rows, blue for rows 2 to 5, green for rows 5 to 10 and red for remainder. So, you could produce a "nice" gradient effect, for example.<br /><br />What else can you do? Well, you could use IF to do common checks on for example the login state of a user:</p> <blockquote><pre> -<!-- IF S_USER_LOGGED_IN --> -markup -<!-- ENDIF --> +<span class="comment"><!-- IF S_USER_LOGGED_IN --></span> + markup +<span class="comment"><!-- ENDIF --></span> </pre></blockquote> <p>This replaces the existing (fudged) method in 2.0.x using a zero length array and BEGIN/END.</p> +<h3>Extended syntax for Blocks/Loops</h3> + +<p>Back to our loops - they had been extended with the following additions. Firstly you can set the start and end points of the loop. For example:</p> + +<blockquote><pre> +<span class="comment"><!-- BEGIN loopname(2) --></span> + markup +<span class="comment"><!-- END loopname --></span> +</pre></blockquote> + +<p>Will start the loop on the third entry (note that indexes start at zero). Extensions of this are: +<br /><br /> +<code>loopname(2)</code>: Will start the loop on the 3rd entry<br /> +<code>loopname(-2)</code>: Will start the loop two entries from the end<br /> +<code>loopname(3,4)</code>: Will start the loop on the fourth entry and end it on the fifth<br /> +<code>loopname(3,-4)</code>: Will start the loop on the fourth entry and end it four from last<br /> +</p> + +<p>A further extension to begin is BEGINELSE:</p> + +<blockquote><pre> +<span class="comment"><!-- BEGIN loop --></span> + markup +<span class="comment"><!-- BEGINELSE --></span> + markup +<span class="comment"><!-- END loop --></span> +</pre></blockquote> + +<p>This will cause the markup between <code>BEGINELSE</code> and <code>END</code> to be output if the loop contains no values. This is useful for forums with no topics (for example) ... in some ways it replaces "bits of" the existing "switch_" type control (the rest being replaced by conditionals).</p> + +<p>Another way of checking if a loop contains values is by prefixing the loops name with a dot:</p> + +<blockquote><pre> +<span class="comment"><!-- IF .loop --></span> + <span class="comment"><!-- BEGIN loop --></span> + markup + <span class="comment"><!-- END loop --></span> +<span class="comment"><!-- ELSE --></span> + markup +<span class="comment"><!-- ENDIF --></span> +</pre></blockquote> + +<p>You are even able to check the number of items within a loop by comparing it with values within the IF condition:</p> + +<blockquote><pre> +<span class="comment"><!-- IF .loop > 2 --></span> + <span class="comment"><!-- BEGIN loop --></span> + markup + <span class="comment"><!-- END loop --></span> +<span class="comment"><!-- ELSE --></span> + markup +<span class="comment"><!-- ENDIF --></span> +</pre></blockquote> + +<p>Nesting loops cause the conditionals needing prefixed with all loops from the outer one to the inner most. An illustration of this:</p> + +<blockquote><pre> +<span class="comment"><!-- BEGIN firstloop --></span> + {firstloop.MY_VARIABLE_FROM_FIRSTLOOP} + + <span class="comment"><!-- BEGIN secondloop --></span> + {firstloop.secondloop.MY_VARIABLE_FROM_SECONDLOOP} + <span class="comment"><!-- END secondloop --></span> +<span class="comment"><!-- END firstloop --></span> +</pre></blockquote> + +<p>Sometimes it is necessary to break out of nested loops to be able to call another loop within the current iteration. This sounds a little bit confusing and it is not used very often. The following (rather complex) example shows this quite good - it also shows how you test for the first and last row in a loop (i will explain the example in detail further down):</p> + +<blockquote><pre> +<span class="comment"><!-- BEGIN l_block1 --></span> + <span class="comment"><!-- IF l_block1.S_SELECTED --></span> + <strong>{l_block1.L_TITLE}</strong> + <span class="comment"><!-- IF S_PRIVMSGS --></span> + + <span class="comment"><!-- the ! at the beginning of the loop name forces the loop to be not a nested one of l_block1 --></span> + <span class="comment"><!-- BEGIN !folder --></span> + <span class="comment"><!-- IF folder.S_FIRST_ROW --></span> + <ul class="nav"> + <span class="comment"><!-- ENDIF --></span> + + <li><a href="{folder.U_FOLDER}">{folder.FOLDER_NAME}</a></li> + + <span class="comment"><!-- IF folder.S_LAST_ROW --></span> + </ul> + <span class="comment"><!-- ENDIF --></span> + <span class="comment"><!-- END !folder --></span> + + <span class="comment"><!-- ENDIF --></span> + + <ul class="nav"> + <span class="comment"><!-- BEGIN l_block2 --></span> + <li> + <span class="comment"><!-- IF l_block1.l_block2.S_SELECTED --></span> + <strong>{l_block1.l_block2.L_TITLE}</strong> + <span class="comment"><!-- ELSE --></span> + <a href="{l_block1.l_block2.U_TITLE}">{l_block1.l_block2.L_TITLE}</a> + <span class="comment"><!-- ENDIF --></span> + </li> + <span class="comment"><!-- END l_block2 --></span> + </ul> + <span class="comment"><!-- ELSE --></span> + <a class="nav" href="{l_block1.U_TITLE}">{l_block1.L_TITLE}</a> + <span class="comment"><!-- ENDIF --></span> +<span class="comment"><!-- END l_block1 --></span> +</pre></blockquote> + +<p>Let us first concentrate on this part of the example:</p> + +<blockquote><pre> +<span class="comment"><!-- BEGIN l_block1 --></span> + <span class="comment"><!-- IF l_block1.S_SELECTED --></span> + markup + <span class="comment"><!-- ELSE --></span> + <a class="nav" href="{l_block1.U_TITLE}">{l_block1.L_TITLE}</a> + <span class="comment"><!-- ENDIF --></span> +<span class="comment"><!-- END l_block1 --></span> +</pre></blockquote> + +<p>Here we open the loop l_block1 and doing some things if the value S_SELECTED within the current loop iteration is true, else we write the blocks link and title. Here, you see <code>{l_block1.L_TITLE}</code> referenced - you remember that L_* variables get automatically assigned the corresponding language entry? This is true, but not within loops. The L_TITLE variable within the loop l_block1 is assigned within the code itself.</p> + +<p>Let's have a closer look to the markup:</p> + +<blockquote><pre> +<span class="comment"><!-- BEGIN l_block1 --></span> +. +. + <span class="comment"><!-- IF S_PRIVMSGS --></span> + + <span class="comment"><!-- BEGIN !folder --></span> + <span class="comment"><!-- IF folder.S_FIRST_ROW --></span> + <ul class="nav"> + <span class="comment"><!-- ENDIF --></span> + + <li><a href="{folder.U_FOLDER}">{folder.FOLDER_NAME}</a></li> + + <span class="comment"><!-- IF folder.S_LAST_ROW --></span> + </ul> + <span class="comment"><!-- ENDIF --></span> + <span class="comment"><!-- END !folder --></span> + + <span class="comment"><!-- ENDIF --></span> +. +. +<span class="comment"><!-- END l_block1 --></span> +</pre></blockquote> + +<p>The <code><!-- IF S_PRIVMSGS --></code> statement clearly checks a global variable and not one within the loop, since the loop is not given here. So, if S_PRIVMSGS is true we execute the shown markup. Now, you see the <code><!-- BEGIN !folder --></code> statement. The exclamation mark is responsible for instructing the template engine to iterate through the main loop folder. So, we are now within the loop folder - with <code><!-- BEGIN folder --></code> we would have been within the loop <code>l_block1.folder</code> automatically as is the case with l_block2:</p> + +<blockquote><pre> +<span class="comment"><!-- BEGIN l_block1 --></span> +. +. + <ul class="nav"> + <span class="comment"><!-- BEGIN l_block2 --></span> + <li> + <span class="comment"><!-- IF l_block1.l_block2.S_SELECTED --></span> + <strong>{l_block1.l_block2.L_TITLE}</strong> + <span class="comment"><!-- ELSE --></span> + <a href="{l_block1.l_block2.U_TITLE}">{l_block1.l_block2.L_TITLE}</a> + <span class="comment"><!-- ENDIF --></span> + </li> + <span class="comment"><!-- END l_block2 --></span> + </ul> +. +. +<span class="comment"><!-- END l_block1 --></span> +</pre></blockquote> + +<p>You see the difference? The loop l_block2 is a member of the loop l_block1 but the loop folder is a main loop.</p> + +<p>Now back to our folder loop:</p> + +<blockquote><pre> +<span class="comment"><!-- IF folder.S_FIRST_ROW --></span> + <ul class="nav"> +<span class="comment"><!-- ENDIF --></span> + +<li><a href="{folder.U_FOLDER}">{folder.FOLDER_NAME}</a></li> + +<span class="comment"><!-- IF folder.S_LAST_ROW --></span> + </ul> +<span class="comment"><!-- ENDIF --></span> +</pre></blockquote> + +<p>You may have wondered what the comparison to S_FIRST_ROW and S_LAST_ROW is about. If you haven't guessed already - it is checking for the first iteration of the loop with <code>S_FIRST_ROW</code> and the last iteration with <code>S_LAST_ROW</code>. This can come in handy quite often if you want to open or close design elements, like the above list. Let us imagine a folder loop build with three iterations, it would go this way:</p> + +<blockquote><pre> +<ul class="nav"> <span class="comment"><!-- written on first iteration --></span> + <li>first element</li> <span class="comment"><!-- written on first iteration --></span> + <li>second element</li> <span class="comment"><!-- written on second iteration --></span> + <li>third element</li> <span class="comment"><!-- written on third iteration --></span> +</ul> <span class="comment"><!-- written on third iteration --></span> +</pre></blockquote> + +<p>As you can see, all three elements are written down as well as the markup for the first iteration and the last one. Sometimes you want to omit writing the general markup - for example:</p> + +<blockquote><pre> +<span class="comment"><!-- IF folder.S_FIRST_ROW --></span> + <ul class="nav"> +<span class="comment"><!-- ELSEIF folder.S_LAST_ROW --></span> + </ul> +<span class="comment"><!-- ELSE --></span> + <li><a href="{folder.U_FOLDER}">{folder.FOLDER_NAME}</a></li> +<span class="comment"><!-- ENDIF --></span> +</pre></blockquote> + +<p>would result in the following markup:</p> + +<blockquote><pre> +<ul class="nav"> <span class="comment"><!-- written on first iteration --></span> + <li>second element</li> <span class="comment"><!-- written on second iteration --></span> +</ul> <span class="comment"><!-- written on third iteration --></span> +</pre></blockquote> + +<p>Just always remember that processing is taking place from up to down.</p> + </div> <a href="#top">Top</a> <br /><br /> @@ -1171,6 +1518,17 @@ markup <a name="changes"></a><h1>5. Guidelines Changelog</h1> <div class="paragraph"> +<h2>Revision 1.8</h2> + +<ul class="menu"> + <li>Some adjustements to wordings</li> + <li>Updated paragraph <a href="#locations">1.iii. File Locations</a> to reflect recent changes</li> + <li>Extended paragraph <a href="#codelayout">2.ii. Code Layout</a>.</li> + <li>Added sql_in_set and sql_build_query explanation to <a href="#sql">2.iii. SQL/SQL Layout</a>.</li> + <li>Updated paragraph <a href="#styling">3. Styling</a>.</li> + <li>Updated paragraph <a href="#templating">4. Templating</a> to explain loop checking, loop breaking and other changes we recently made.</li> +</ul> + <h2>Revision 1.5</h2> <ul class="menu"> diff --git a/phpBB/download.php b/phpBB/download.php index 86cfed7292..64d147fa79 100644 --- a/phpBB/download.php +++ b/phpBB/download.php @@ -34,7 +34,7 @@ if (!$config['allow_attachments'] && !$config['allow_pm_attach']) trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED'); } -$sql = 'SELECT attach_id, in_message, post_msg_id, extension +$sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id FROM ' . ATTACHMENTS_TABLE . " WHERE attach_id = $download_id"; $result = $db->sql_query_limit($sql, 1); @@ -52,59 +52,75 @@ if ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachmen } $row = array(); -if (!$attachment['in_message']) + +if ($attachment['is_orphan']) { - // - $sql = 'SELECT p.forum_id, f.forum_password, f.parent_id - FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f - WHERE p.post_id = ' . $attachment['post_msg_id'] . ' - AND p.forum_id = f.forum_id'; - $result = $db->sql_query_limit($sql, 1); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - // Global announcement? - if (!$row) + // We allow admins having attachment permissions to see orphan attachments... + $own_attachment = ($auth->acl_get('a_attach') || $attachment['poster_id'] == $user->data['user_id']) ? true : false; + + if (!$own_attachment || ($attachment['in_message'] && !$auth->acl_get('u_pm_download')) || (!$attachment['in_message'] && !$auth->acl_get('u_download'))) { - $forum_id = request_var('f', 0); + trigger_error('ERROR_NO_ATTACHMENT'); + } - $sql = 'SELECT forum_id, forum_password, parent_id - FROM ' . FORUMS_TABLE . ' - WHERE forum_id = ' . $forum_id; - $result = $db->sql_query($sql); + $extensions = $cache->obtain_attach_extensions(); +} +else +{ + if (!$attachment['in_message']) + { + // + $sql = 'SELECT p.forum_id, f.forum_password, f.parent_id + FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f + WHERE p.post_id = ' . $attachment['post_msg_id'] . ' + AND p.forum_id = f.forum_id'; + $result = $db->sql_query_limit($sql, 1); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - } - if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id'])) - { - if ($row['forum_password']) + // Global announcement? + if (!$row) { - // Do something else ... ? - login_forum_box($row); + $forum_id = request_var('f', 0); + + $sql = 'SELECT forum_id, forum_password, parent_id + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $forum_id; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + + if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id'])) + { + if ($row['forum_password']) + { + // Do something else ... ? + login_forum_box($row); + } + } + else + { + trigger_error('SORRY_AUTH_VIEW_ATTACH'); } } else { - trigger_error('SORRY_AUTH_VIEW_ATTACH'); + $row['forum_id'] = 0; + if (!$auth->acl_get('u_pm_download')) + { + trigger_error('SORRY_AUTH_VIEW_ATTACH'); + } } -} -else -{ - $row['forum_id'] = 0; - if (!$auth->acl_get('u_pm_download')) + + // disallowed ? + $extensions = array(); + if (!extension_allowed($row['forum_id'], $attachment['extension'], $extensions)) { - trigger_error('SORRY_AUTH_VIEW_ATTACH'); + trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension'])); } } -// disallowed ? -$extensions = array(); -if (!extension_allowed($row['forum_id'], $attachment['extension'], $extensions)) -{ - trigger_error(sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension'])); -} - if (!download_allowed()) { trigger_error($user->lang['LINKAGE_FORBIDDEN']); @@ -113,7 +129,7 @@ if (!download_allowed()) $download_mode = (int) $extensions[$attachment['extension']]['download_mode']; // Fetching filename here to prevent sniffing of filename -$sql = 'SELECT attach_id, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype +$sql = 'SELECT attach_id, is_orphan, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype FROM ' . ATTACHMENTS_TABLE . " WHERE attach_id = $download_id"; $result = $db->sql_query_limit($sql, 1); @@ -125,7 +141,6 @@ if (!$attachment) trigger_error('ERROR_NO_ATTACHMENT'); } - $attachment['physical_filename'] = basename($attachment['physical_filename']); $display_cat = $extensions[$attachment['extension']]['display_cat']; @@ -133,7 +148,7 @@ if ($thumbnail) { $attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename']; } -else if ($display_cat == ATTACHMENT_CATEGORY_NONE) +else if (($display_cat == ATTACHMENT_CATEGORY_NONE || $display_cat == ATTACHMENT_CATEGORY_IMAGE) && !$attachment['is_orphan']) { // Update download count $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' @@ -176,7 +191,7 @@ function send_file_to_browser($attachment, $upload_dir, $category) // Correct the mime type - we force application/octetstream for all files, except images // Please do not change this, it is a security precaution - if ($category == ATTACHMENT_CATEGORY_NONE && strpos($attachment['mimetype'], 'image') === false) + if (strpos($attachment['mimetype'], 'image') !== 0) { $attachment['mimetype'] = (strpos(strtolower($user->browser), 'msie') !== false || strpos(strtolower($user->browser), 'opera') !== false) ? 'application/octetstream' : 'application/octet-stream'; } @@ -189,15 +204,11 @@ function send_file_to_browser($attachment, $upload_dir, $category) // Now send the File Contents to the Browser $size = @filesize($filename); - // Might not be ideal to store the contents, but file_get_contents is binary-safe as well as the recommended method // To correctly display further errors we need to make sure we are using the correct headers for both (unsetting content-length may not work) - $contents = @file_get_contents($filename); // Check if headers already sent or not able to get the file contents. - if (headers_sent() || $contents === false) + if (headers_sent() || !@file_exists($filename) || !@is_readable($filename)) { - unset($contents); - // PHP track_errors setting On? if (!empty($php_errormsg)) { @@ -210,21 +221,54 @@ function send_file_to_browser($attachment, $upload_dir, $category) // Now the tricky part... let's dance header('Pragma: public'); - // Send out the Headers - header('Content-type: ' . $attachment['mimetype'] . '; name="' . $attachment['real_filename'] . '"'); - header('Content-Disposition: inline; filename="' . $attachment['real_filename'] . '"'); + /** + * Commented out X-Sendfile support. To not expose the physical filename within the header if xsendfile is absent we need to look into methods of checking it's status. + * + * Try X-Sendfile since it is much more server friendly - only works if the path is *not* outside of the root path... + * lighttpd has core support for it. An apache2 module is available at http://celebnamer.celebworld.ws/stuff/mod_xsendfile/ + * + * Not really ideal, but should work fine... + * <code> + * if (strpos($upload_dir, '/') !== 0 && strpos($upload_dir, '../') === false) + * { + * header('X-Sendfile: ' . $filename); + * } + * </code> + */ + + // Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer. + header('Content-Type: ' . $attachment['mimetype']); + header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename($attachment['real_filename'])); if ($size) { - header("Content-length: $size"); + header("Content-Length: $size"); } - echo $contents; - unset($contents); + + // Might not be ideal to store the contents, but file_get_contents is binary-safe as well as the recommended method + echo @file_get_contents($filename); flush(); exit; } +/* +* Get a browser friendly UTF-8 encoded filename +*/ +function header_filename($file) +{ + // There be dragons here... + // IE follows no RFC, follow the RFC for extended filename for the rest + if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) + { + return "filename=" . rawurlencode($file); + } + else + { + return "filename*=UTF-8''" . rawurlencode($file); + } +} + /** * Check if downloading item is allowed */ diff --git a/phpBB/images/avatars/gallery/index.htm b/phpBB/images/avatars/gallery/index.htm new file mode 100644 index 0000000000..ee1f723a7d --- /dev/null +++ b/phpBB/images/avatars/gallery/index.htm @@ -0,0 +1,10 @@ +<html> +<head> +<title></title> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> +</head> + +<body bgcolor="#FFFFFF" text="#000000"> + +</body> +</html> diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index 175ef0ad81..b6af055399 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -80,6 +80,16 @@ class acm @flock($fp, LOCK_UN); fclose($fp); } + else + { + // Now, this occurred how often? ... phew, just tell the user then... + if (!@is_writeable($this->cache_dir)) + { + trigger_error($this->cache_dir . ' is NOT writeable.', E_USER_ERROR); + } + + trigger_error('Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx, E_USER_ERROR); + } $this->is_modified = false; } @@ -132,7 +142,7 @@ class acm */ function get($var_name) { - if ($var_name{0} == '_') + if ($var_name[0] == '_') { global $phpEx; @@ -155,7 +165,7 @@ class acm */ function put($var_name, $var, $ttl = 31536000) { - if ($var_name{0} == '_') + if ($var_name[0] == '_') { global $phpEx; @@ -176,6 +186,32 @@ class acm } /** + * Purge cache data + */ + function purge() + { + // Purge all phpbb cache files + $dir = opendir($this->cache_dir); + while (($entry = readdir($dir)) !== false) + { + if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0) + { + continue; + } + + @unlink($this->cache_dir . $entry); + } + @closedir($dir); + + unset($this->vars); + unset($this->var_expires); + unset($this->sql_rowset); + unset($this->sql_row_pointer); + + $this->is_modified = false; + } + + /** * Destroy cache data */ function destroy($var_name, $table = '') @@ -213,7 +249,7 @@ class acm return; } - if ($var_name{0} == '_') + if ($var_name[0] == '_') { @unlink($this->cache_dir . 'data' . $var_name . ".$phpEx"); } @@ -233,7 +269,7 @@ class acm */ function _exists($var_name) { - if ($var_name{0} == '_') + if ($var_name[0] == '_') { global $phpEx; return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx"); @@ -345,7 +381,7 @@ class acm } $db->sql_freeresult($query_result); - fwrite($fp, "<?php\n\n/*\n$query\n*/\n\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$this->sql_rowset[\$query_id] = array(" . implode(',', $lines) . ') ?>'); + fwrite($fp, "<?php\n\n/*\n" . str_replace('*/', '*\/', $query) . "\n*/\n\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$this->sql_rowset[\$query_id] = array(" . implode(',', $lines) . ') ?>'); @flock($fp, LOCK_UN); fclose($fp); @@ -375,14 +411,6 @@ class acm } /** - * Fetch the number of rows from cache (database) - */ - function sql_numrows($query_id) - { - return sizeof($this->sql_rowset[$query_id]); - } - - /** * Fetch a field from the current row of a cached database result (database) */ function sql_fetchfield($query_id, $field) @@ -398,7 +426,7 @@ class acm /** * Seek a specific row in an a cached database result (database) */ - function sql_rowseek($query_id, $rownum) + function sql_rowseek($rownum, $query_id) { if ($rownum >= sizeof($this->sql_rowset[$query_id])) { diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 1089a06152..59694b294e 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -46,7 +46,8 @@ class acp_attachments break; default: - trigger_error('NO_MODE'); + trigger_error('NO_MODE', E_USER_ERROR); + break; } $this->tpl_name = 'acp_attachments'; @@ -86,31 +87,42 @@ class acp_attachments 'img_max_width' => false, 'img_max_height' => false, 'img_link_width' => false, 'img_link_height' => false, 'legend1' => 'ACP_ATTACHMENT_SETTINGS', - 'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false), - 'upload_path' => array('lang' => 'UPLOAD_DIR', 'type' => 'text:25:100', 'explain' => true), - 'display_order' => array('lang' => 'DISPLAY_ORDER', 'type' => 'custom', 'method' => 'display_order', 'explain' => true), - 'attachment_quota' => array('lang' => 'ATTACH_QUOTA', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), - 'max_filesize' => array('lang' => 'ATTACH_MAX_FILESIZE', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), - 'max_filesize_pm' => array('lang' => 'ATTACH_MAX_PM_FILESIZE','type' => 'custom', 'method' => 'max_filesize', 'explain' => true), - 'max_attachments' => array('lang' => 'MAX_ATTACHMENTS', 'type' => 'text:3:3', 'explain' => false), - 'max_attachments_pm' => array('lang' => 'MAX_ATTACHMENTS_PM', 'type' => 'text:3:3', 'explain' => false), - 'secure_downloads' => array('lang' => 'SECURE_DOWNLOADS', 'type' => 'radio:yes_no', 'explain' => true), - 'secure_allow_deny' => array('lang' => 'SECURE_ALLOW_DENY', 'type' => 'custom', 'method' => 'select_allow_deny', 'explain' => true), - 'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERRER', 'type' => 'radio:yes_no', 'explain' => true), + '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), + 'upload_path' => array('lang' => 'UPLOAD_DIR', 'validate' => 'wpath', 'type' => 'text:25:100', 'explain' => true), + 'display_order' => array('lang' => 'DISPLAY_ORDER', 'validate' => 'bool', 'type' => 'custom', 'method' => 'display_order', 'explain' => true), + 'attachment_quota' => array('lang' => 'ATTACH_QUOTA', 'validate' => 'int', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), + 'max_filesize' => array('lang' => 'ATTACH_MAX_FILESIZE', 'validate' => 'int', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), + 'max_filesize_pm' => array('lang' => 'ATTACH_MAX_PM_FILESIZE','validate' => 'int', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), + 'max_attachments' => array('lang' => 'MAX_ATTACHMENTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => false), + 'max_attachments_pm' => array('lang' => 'MAX_ATTACHMENTS_PM', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => false), + 'secure_downloads' => array('lang' => 'SECURE_DOWNLOADS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'secure_allow_deny' => array('lang' => 'SECURE_ALLOW_DENY', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_allow_deny', 'explain' => true), + 'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERRER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'legend2' => $l_legend_cat_images, - 'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'type' => 'radio:yes_no', 'explain' => true), - 'img_create_thumbnail' => array('lang' => 'CREATE_THUMBNAIL', 'type' => 'radio:yes_no', 'explain' => true), - 'img_min_thumb_filesize' => array('lang' => 'MIN_THUMB_FILESIZE', 'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']), - 'img_imagick' => array('lang' => 'IMAGICK_PATH', 'type' => 'text:20:200', 'explain' => true, 'append' => ' <span>[ <a href="' . $this->u_action . '&action=imgmagick">' . $user->lang['SEARCH_IMAGICK'] . '</a> ]</span>'), - 'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'type' => 'dimension:3:4', 'explain' => true), - 'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'type' => 'dimension:3:4', 'explain' => true), + 'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'img_create_thumbnail' => array('lang' => 'CREATE_THUMBNAIL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'img_max_thumb_width' => array('lang' => 'MAX_THUMB_WIDTH', 'validate' => 'int', 'type' => 'text:7:15', 'explain' => true, 'append' => ' px'), + 'img_min_thumb_filesize' => array('lang' => 'MIN_THUMB_FILESIZE', 'validate' => 'int', 'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']), + 'img_imagick' => array('lang' => 'IMAGICK_PATH', 'validate' => 'string', 'type' => 'text:20:200', 'explain' => true, 'append' => ' <span>[ <a href="' . $this->u_action . '&action=imgmagick">' . $user->lang['SEARCH_IMAGICK'] . '</a> ]</span>'), + 'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true), + 'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true), ) ); $this->new_config = $config; $cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => '')) : $this->new_config; + $error = array(); + + // We validate the complete config if whished + validate_config_vars($display_vars['vars'], $cfg_array, $error); + + // Do not write values if there is an error + if (sizeof($error)) + { + $submit = false; + } // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... foreach ($display_vars['vars'] as $config_name => $null) @@ -197,7 +209,9 @@ class acp_attachments $template->assign_vars(array( 'S_SECURE_DOWNLOADS' => $this->new_config['secure_downloads'], 'S_DEFINED_IPS' => ($defined_ips != '') ? true : false, + 'S_WARNING' => (sizeof($error)) ? true : false, + 'WARNING_MSG' => implode('<br />', $error), 'DEFINED_IPS' => $defined_ips, 'L_SECURE_TITLE' => $user->lang['DEFINE_' . $allow_deny . '_IPS'], @@ -403,12 +417,12 @@ class acp_attachments if ($action != 'add' && $action != 'edit') { - trigger_error('WRONG_MODE'); + trigger_error('NO_MODE', E_USER_ERROR); } if (!$group_id && $action == 'edit') { - trigger_error('NO_EXT_GROUP_SPECIFIED'); + trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); } if ($group_id) @@ -437,7 +451,7 @@ class acp_attachments { $sql = 'SELECT group_id FROM ' . EXTENSION_GROUPS_TABLE . " - WHERE LOWER(group_name) = '" . $db->sql_escape(strtolower($new_group_name)) . "'"; + WHERE LOWER(group_name) = '" . $db->sql_escape(utf8_strtolower($new_group_name)) . "'"; $result = $db->sql_query($sql); if ($db->sql_fetchrow($result)) @@ -521,15 +535,16 @@ class acp_attachments } $cat_lang = array( - ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'], - ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'], - ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'], - ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'] + ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'], + ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'], + ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'], + ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'], + ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'], + ATTACHMENT_CATEGORY_QUICKTIME => $user->lang['CAT_QUICKTIME_FILES'], ); $group_id = request_var('g', 0); $action = (isset($_POST['add'])) ? 'add' : $action; -// $action = (($action == 'add' || $action == 'edit') && $submit && !sizeof($error)) ? 'show' : $action; switch ($action) { @@ -578,7 +593,7 @@ class acp_attachments if (!$group_id) { - trigger_error($user->lang['NO_EXTENSION_GROUP'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'SELECT * @@ -770,7 +785,7 @@ class acp_attachments if (!$group_id) { - trigger_error($user->lang['NO_EXTENSION_GROUP'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' @@ -823,24 +838,45 @@ class acp_attachments $add_files = (isset($_POST['add'])) ? array_keys(request_var('add', array('' => 0))) : array(); $post_ids = request_var('post_id', array('' => 0)); - foreach ($delete_files as $delete) + if (sizeof($delete_files)) { - phpbb_unlink($delete); - phpbb_unlink($delete, 'thumbnail'); + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', $delete_files) . ' + AND is_orphan = 1'; + $result = $db->sql_query($sql); + + $delete_files = array(); + while ($row = $db->sql_fetchrow($result)) + { + phpbb_unlink($row['physical_filename']); + + if ($row['thumbnail']) + { + phpbb_unlink($row['physical_filename'], 'thumbnail'); + } + + $delete_files[$row['attach_id']] = $row['real_filename']; + } + $db->sql_freeresult($result); } if (sizeof($delete_files)) { + $sql = 'DELETE FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', array_keys($delete_files)); + $db->sql_query($sql); + add_log('admin', 'LOG_ATTACH_ORPHAN_DEL', implode(', ', $delete_files)); $notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode(', ', $delete_files)); } $upload_list = array(); - foreach ($add_files as $file) + foreach ($add_files as $attach_id) { - if (!in_array($file, $delete_files) && $post_ids[$file]) + if (!in_array($attach_id, array_keys($delete_files)) && !empty($post_ids[$attach_id])) { - $upload_list[$post_ids[$file]] = $file; + $upload_list[$attach_id] = $post_ids[$attach_id]; } } unset($add_files); @@ -849,13 +885,10 @@ class acp_attachments { $template->assign_var('S_UPLOADING_FILES', true); - include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx); - $message_parser = new parse_message(); - $sql = 'SELECT forum_id, forum_name FROM ' . FORUMS_TABLE; $result = $db->sql_query($sql); - + $forum_names = array(); while ($row = $db->sql_fetchrow($result)) { @@ -863,30 +896,67 @@ class acp_attachments } $db->sql_freeresult($result); - $sql = 'SELECT forum_id, topic_id, post_id + $sql = 'SELECT forum_id, topic_id, post_id, poster_id FROM ' . POSTS_TABLE . ' - WHERE ' . $db->sql_in_set('post_id', array_keys($upload_list)); + WHERE ' . $db->sql_in_set('post_id', $upload_list); + $result = $db->sql_query($sql); + + $post_info = array(); + while ($row = $db->sql_fetchrow($result)) + { + $post_info[$row['post_id']] = $row; + } + $db->sql_freeresult($result); + + // Select those attachments we want to change... + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', array_keys($upload_list)) . ' + AND is_orphan = 1'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - $return = true; + $post_row = $post_info[$upload_list[$row['attach_id']]]; - if ($auth->acl_get('f_attach', $row['forum_id'])) + $template->assign_block_vars('upload', array( + 'FILE_INFO' => sprintf($user->lang['UPLOADING_FILE_TO'], $row['real_filename'], $post_row['post_id']), + 'S_DENIED' => (!$auth->acl_get('f_attach', $post_row['forum_id'])) ? true : false, + 'L_DENIED' => (!$auth->acl_get('f_attach', $post_row['forum_id'])) ? sprintf($user->lang['UPLOAD_DENIED_FORUM'], $forum_names[$row['forum_id']]) : '') + ); + + if (!$auth->acl_get('f_attach', $post_row['forum_id'])) { - $return = $this->upload_file($row['post_id'], $row['topic_id'], $row['forum_id'], $config['upload_path'], $upload_list[$row['post_id']]); + continue; } - $template->assign_block_vars('upload', array( - 'FILE_INFO' => sprintf($user->lang['UPLOADING_FILE_TO'], $upload_list[$row['post_id']], $row['post_id']), - 'S_DENIED' => (!$auth->acl_get('f_attach', $row['forum_id'])) ? true : false, - 'L_DENIED' => (!$auth->acl_get('f_attach', $row['forum_id'])) ? sprintf($user->lang['UPLOAD_DENIED_FORUM'], $forum_names[$row['forum_id']]) : '', - 'ERROR_MSG' => ($return === true) ? false : $return) + // Adjust attachment entry + $sql_ary = array( + 'in_message' => 0, + 'is_orphan' => 0, + 'poster_id' => $post_row['poster_id'], + 'post_msg_id' => $post_row['post_id'], + 'topic_id' => $post_row['topic_id'], ); + + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE attach_id = ' . $row['attach_id']; + $db->sql_query($sql); + + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET post_attachment = 1 + WHERE post_id = ' . $post_row['post_id']; + $db->sql_query($sql); + + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_attachment = 1 + WHERE topic_id = ' . $post_row['topic_id']; + $db->sql_query($sql); + + add_log('admin', 'LOG_ATTACH_FILEUPLOAD', $post_row['post_id'], $row['real_filename']); } $db->sql_freeresult($result); - - unset($message_parser); } } @@ -894,43 +964,31 @@ class acp_attachments 'S_ORPHAN' => true) ); - $attach_filelist = array(); - - $dir = @opendir($phpbb_root_path . $config['upload_path']); - while (($file = @readdir($dir)) !== false) - { - if (is_file($phpbb_root_path . $config['upload_path'] . '/' . $file) && filesize($phpbb_root_path . $config['upload_path'] . '/' . $file) && $file{0} != '.' && $file != 'index.htm' && !preg_match('#^thumb\_#', $file)) - { - $attach_filelist[$file] = $file; - } - } - @closedir($dir); - - $sql = 'SELECT physical_filename - FROM ' . ATTACHMENTS_TABLE; + // Just get the files with is_orphan set and older than 3 hours + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE is_orphan = 1 + AND filetime < ' . (time() - 3*60*60) . ' + ORDER BY filetime DESC'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - unset($attach_filelist[$row['physical_filename']]); - } - $db->sql_freeresult($result); - - $i = 0; - foreach ($attach_filelist as $file) - { - $filesize = @filesize($phpbb_root_path . $config['upload_path'] . '/' . $file); - $size_lang = ($filesize >= 1048576) ? $user->lang['MB'] : ( ($filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); - $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); + $size_lang = ($row['filesize'] >= 1048576) ? $user->lang['MB'] : (($row['filesize'] >= 1024) ? $user->lang['KB'] : $user->lang['BYTES']); + $row['filesize'] = ($row['filesize'] >= 1048576) ? round((round($row['filesize'] / 1048576 * 100) / 100), 2) : (($row['filesize'] >= 1024) ? round((round($row['filesize'] / 1024 * 100) / 100), 2) : $row['filesize']); $template->assign_block_vars('orphan', array( - 'FILESIZE' => $filesize . ' ' . $size_lang, - 'U_FILE' => $phpbb_root_path . $config['upload_path'] . '/' . $file, - 'FILE' => $file, - 'POST_IDS' => (!empty($post_ids[$file])) ? $post_ids[$file] : '') + 'FILESIZE' => $row['filesize'] . ' ' . $size_lang, + 'FILETIME' => $user->format_date($row['filetime']), + 'REAL_FILENAME' => basename($row['real_filename']), + 'PHYSICAL_FILENAME' => 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.' . $phpEx, 'id=' . $row['attach_id'])) ); } - + $db->sql_freeresult($result); + break; } @@ -959,10 +1017,12 @@ class acp_attachments global $db, $user; $types = array( - ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'], - ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'], - ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'], - ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'] + ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'], + ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'], + ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'], + ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'], + ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'], + ATTACHMENT_CATEGORY_QUICKTIME => $user->lang['CAT_QUICKTIME_FILES'], ); if ($group_id) @@ -1079,70 +1139,6 @@ class acp_attachments return $group_select; } - /** - * Upload already uploaded file... huh? are you kidding? - */ - function upload_file($post_id, $topic_id, $forum_id, $upload_dir, $filename) - { - global $message_parser, $db, $user, $phpbb_root_path; - - $message_parser->attachment_data = array(); - - $message_parser->filename_data['filecomment'] = ''; - $message_parser->filename_data['filename'] = $phpbb_root_path . $upload_dir . '/' . basename($filename); - - $filedata = upload_attachment('local', $forum_id, true, $phpbb_root_path . $upload_dir . '/' . basename($filename)); - - if ($filedata['post_attach'] && !sizeof($filedata['error'])) - { - $message_parser->attachment_data = array( - 'post_msg_id' => $post_id, - 'poster_id' => $user->data['user_id'], - 'topic_id' => $topic_id, - 'in_message' => 0, - 'physical_filename' => $filedata['physical_filename'], - 'real_filename' => $filedata['real_filename'], - 'attach_comment' => $message_parser->filename_data['filecomment'], - 'extension' => $filedata['extension'], - 'mimetype' => $filedata['mimetype'], - 'filesize' => $filedata['filesize'], - 'filetime' => $filedata['filetime'], - 'thumbnail' => $filedata['thumbnail'] - ); - - $message_parser->filename_data['filecomment'] = ''; - $filedata['post_attach'] = false; - - // Submit Attachment - $attach_sql = $message_parser->attachment_data; - - $db->sql_transaction('begin'); - - $sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $attach_sql); - $db->sql_query($sql); - - $sql = 'UPDATE ' . POSTS_TABLE . " - SET post_attachment = 1 - WHERE post_id = $post_id"; - $db->sql_query($sql); - - $sql = 'UPDATE ' . TOPICS_TABLE . " - SET topic_attachment = 1 - WHERE topic_id = $topic_id"; - $db->sql_query($sql); - - $db->sql_transaction('commit'); - - add_log('admin', 'LOG_ATTACH_FILEUPLOAD', $post_id, $filename); - - return true; - } - else if (sizeof($filedata['error'])) - { - return sprintf($user->lang['ADMIN_UPLOAD_ERROR'], implode('<br />', $filedata['error'])); - } - } - /** * Search Imagick */ @@ -1369,7 +1365,7 @@ class acp_attachments add_log('admin', $log_entry, $ip_list_log); } - trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS']); + trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS'] . adm_back_link($this->u_action)); } else if (isset($_POST['unsecuresubmit'])) { @@ -1398,7 +1394,7 @@ class acp_attachments add_log('admin', 'LOG_DOWNLOAD_REMOVE_IP', $l_unip_list); } - trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS']); + trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS'] . adm_back_link($this->u_action)); } } diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php index 420deb975f..a4e860b7bc 100644 --- a/phpBB/includes/acp/acp_ban.php +++ b/phpBB/includes/acp/acp_ban.php @@ -189,7 +189,7 @@ class acp_ban $template->assign_block_vars('ban_reason', array( 'BAN_ID' => $ban_id, 'REASON' => $reason, - 'A_REASON' => addslashes(html_entity_decode($reason))) + 'A_REASON' => addslashes(htmlspecialchars_decode($reason))) ); } } @@ -201,7 +201,7 @@ class acp_ban $template->assign_block_vars('ban_give_reason', array( 'BAN_ID' => $ban_id, 'REASON' => $reason, - 'A_REASON' => addslashes(html_entity_decode($reason))) + 'A_REASON' => addslashes(htmlspecialchars_decode($reason))) ); } } diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index cdfe8e42eb..e4ea02ad4d 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -47,13 +47,13 @@ class acp_bbcodes if (!$row) { - trigger_error('BBCODE_NOT_EXIST'); + trigger_error($user->lang['BBCODE_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING); } $bbcode_match = $row['bbcode_match']; $bbcode_tpl = htmlspecialchars($row['bbcode_tpl']); $display_on_posting = $row['display_on_posting']; - $bbcode_helpline = html_entity_decode($row['bbcode_helpline']); + $bbcode_helpline = $row['bbcode_helpline']; break; case 'modify': @@ -66,7 +66,7 @@ class acp_bbcodes if (!$row) { - trigger_error('BBCODE_NOT_EXIST'); + trigger_error($user->lang['BBCODE_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING); } // No break here @@ -75,8 +75,8 @@ class acp_bbcodes $display_on_posting = request_var('display_on_posting', 0); $bbcode_match = request_var('bbcode_match', ''); - $bbcode_tpl = html_entity_decode(request_var('bbcode_tpl', '')); - $bbcode_helpline = htmlspecialchars(request_var('bbcode_helpline', '')); + $bbcode_tpl = htmlspecialchars_decode(request_var('bbcode_tpl', '')); + $bbcode_helpline = request_var('bbcode_helpline', ''); break; } @@ -127,9 +127,11 @@ class acp_bbcodes $info = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if ($info['test'] === '1' || in_array(strtolower($data['bbcode_tag']), $hard_coded)) + // Grab the end, interrogate the last closing tag + preg_match('#\[/([^[]*)]$#', $bbcode_match, $regs); + if ($info['test'] === '1' || in_array(strtolower($data['bbcode_tag']), $hard_coded) || in_array(strtolower($regs[1]), $hard_coded)) { - trigger_error('BBCODE_INVALID_TAG_NAME'); + trigger_error($user->lang['BBCODE_INVALID_TAG_NAME'] . adm_back_link($this->u_action), E_USER_WARNING); } } @@ -170,12 +172,13 @@ class acp_bbcodes if ($bbcode_id > 1511) { - trigger_error('TOO_MANY_BBCODES'); + trigger_error($user->lang['TOO_MANY_BBCODES'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql_ary['bbcode_id'] = (int) $bbcode_id; $db->sql_query('INSERT INTO ' . BBCODES_TABLE . $db->sql_build_array('INSERT', $sql_ary)); + $cache->destroy('sql', BBCODES_TABLE); $lang = 'BBCODE_ADDED'; $log_action = 'LOG_BBCODE_ADD'; @@ -186,6 +189,7 @@ class acp_bbcodes SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE bbcode_id = ' . $bbcode_id; $db->sql_query($sql); + $cache->destroy('sql', BBCODES_TABLE); $lang = 'BBCODE_EDITED'; $log_action = 'LOG_BBCODE_EDIT'; @@ -208,8 +212,21 @@ class acp_bbcodes if ($row) { - $db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id"); - add_log('admin', 'LOG_BBCODE_DELETE', $row['bbcode_tag']); + if (confirm_box(true)) + { + $db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id"); + $cache->destroy('sql', BBCODES_TABLE); + add_log('admin', 'LOG_BBCODE_DELETE', $row['bbcode_tag']); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'bbcode' => $bbcode_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action)) + ); + } } break; @@ -290,7 +307,7 @@ class acp_bbcodes if (preg_match_all('/(?<!\\\\)\$([0-9]+)/', $replace, $repad)) { $repad = $pad + sizeof(array_unique($repad[0])); - $replace = preg_replace('/(?<!\\\\)\$([0-9]+)/e', "'\$' . (\$1 + \$pad)", $replace); + $replace = preg_replace('/(?<!\\\\)\$([0-9]+)/e', "'\${' . (\$1 + \$pad) . '}'", $replace); $pad = $repad; } @@ -320,7 +337,7 @@ class acp_bbcodes $fp_replace = str_replace($token, $replace, $fp_replace); $sp_match = str_replace(preg_quote($token, '!'), '(.*?)', $sp_match); - $sp_replace = str_replace($token, '$' . ($n + 1), $sp_replace); + $sp_replace = str_replace($token, '${' . ($n + 1) . '}', $sp_replace); } $fp_match = '!' . $fp_match . '!' . $modifiers; diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 49e4b1eb1c..84cc8ddd1c 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -27,6 +27,7 @@ class acp_board $action = request_var('action', ''); $submit = (isset($_POST['submit'])) ? true : false; + // Validation types are: string, int, bool, rpath (relative), rwpath (realtive, writeable), path (relative path, but able to escape the root), wpath (writeable) switch ($mode) { case 'settings': @@ -34,19 +35,19 @@ class acp_board 'title' => 'ACP_BOARD_SETTINGS', 'vars' => array( 'legend1' => 'ACP_BOARD_SETTINGS', - 'sitename' => array('lang' => 'SITE_NAME', 'type' => 'text:40:255', 'explain' => false), - 'site_desc' => array('lang' => 'SITE_DESC', 'type' => 'text:40:255', 'explain' => false), - 'board_disable' => array('lang' => 'DISABLE_BOARD', 'type' => 'custom', 'method' => 'board_disable', 'explain' => true), + 'sitename' => array('lang' => 'SITE_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false), + 'site_desc' => array('lang' => 'SITE_DESC', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false), + 'board_disable' => array('lang' => 'DISABLE_BOARD', 'validate' => 'bool', 'type' => 'custom', 'method' => 'board_disable', 'explain' => true), 'board_disable_msg' => false, - 'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false), - 'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true), - 'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false), - 'board_dst' => array('lang' => 'SYSTEM_DST', 'type' => 'radio:yes_no', 'explain' => false), - 'default_style' => array('lang' => 'DEFAULT_STYLE', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false), - 'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'type' => 'radio:yes_no', 'explain' => true), + 'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'string', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false), + 'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true), + 'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false), + 'board_dst' => array('lang' => 'SYSTEM_DST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false), + 'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'legend2' => 'WARNINGS', - 'warnings_expire_days' => array('lang' => 'WARNINGS_EXPIRE', 'type' => 'text:3:4', 'explain' => true), + 'warnings_expire_days' => array('lang' => 'WARNINGS_EXPIRE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true), ) ); break; @@ -56,29 +57,25 @@ class acp_board 'title' => 'ACP_BOARD_FEATURES', 'vars' => array( 'legend1' => 'ACP_BOARD_FEATURES', - 'allow_privmsg' => array('lang' => 'BOARD_PM', 'type' => 'radio:yes_no', 'explain' => true), - 'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_sig' => array('lang' => 'ALLOW_SIG', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_sig_bbcode' => array('lang' => 'ALLOW_SIG_BBCODE', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_sig_img' => array('lang' => 'ALLOW_SIG_IMG', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_sig_flash' => array('lang' => 'ALLOW_SIG_FLASH', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_sig_smilies' => array('lang' => 'ALLOW_SIG_SMILIES', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'type' => 'radio:yes_no', 'explain' => true), - 'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_privmsg' => array('lang' => 'BOARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + '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_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), 'legend2' => 'ACP_LOAD_SETTINGS', - 'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'type' => 'radio:yes_no', 'explain' => false), - 'load_moderators' => array('lang' => 'YES_MODERATORS', 'type' => 'radio:yes_no', 'explain' => false), - 'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'type' => 'radio:yes_no', 'explain' => false), - 'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'type' => 'radio:yes_no', 'explain' => false), - 'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'type' => 'radio:yes_no', 'explain' => false), - 'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'type' => 'radio:yes_no', 'explain' => false), + 'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_moderators' => array('lang' => 'YES_MODERATORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + '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), ) ); break; @@ -90,14 +87,14 @@ class acp_board 'legend1' => 'ACP_AVATAR_SETTINGS', 'avatar_min_height' => false, 'avatar_min_width' => false, 'avatar_max_height' => false, 'avatar_max_width' => false, - 'allow_avatar_local' => array('lang' => 'ALLOW_LOCAL', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'type' => 'radio:yes_no', 'explain' => true), - 'allow_avatar_upload' => array('lang' => 'ALLOW_UPLOAD', 'type' => 'radio:yes_no', 'explain' => false), - 'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']), - 'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'type' => 'dimension:3:4', 'explain' => true), - 'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'type' => 'dimension:3:4', 'explain' => true), - 'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'type' => 'text:20:255', 'explain' => true), - 'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'type' => 'text:20:255', '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), + 'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']), + 'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true), + 'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true), + 'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'validate' => 'rwpath', 'type' => 'text:20:255', 'explain' => true), + 'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true) ) ); break; @@ -108,23 +105,23 @@ class acp_board 'lang' => 'ucp', 'vars' => array( 'legend1' => 'GENERAL_SETTINGS', - 'allow_privmsg' => array('lang' => 'BOARD_PM', 'type' => 'radio:yes_no', 'explain' => true), - 'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'type' => 'text:4:4', 'explain' => true), - 'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'type' => 'text:4:4', 'explain' => true), - 'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true), - 'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), + 'allow_privmsg' => array('lang' => 'BOARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), + 'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), + 'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'validate' => 'int', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true), + 'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), 'legend2' => 'GENERAL_OPTIONS', - 'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_bbcode_pm' => array('lang' => 'ALLOW_BBCODE_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_smilies_pm' => array('lang' => 'ALLOW_SMILIES_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_sig_pm' => array('lang' => 'ALLOW_SIG_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'print_pm' => array('lang' => 'ALLOW_PRINT_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'forward_pm' => array('lang' => 'ALLOW_FORWARD_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_img_pm' => array('lang' => 'ALLOW_IMG_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_flash_pm' => array('lang' => 'ALLOW_FLASH_PM', 'type' => 'radio:yes_no', 'explain' => false), - 'enable_pm_icons' => array('lang' => 'ENABLE_PM_ICONS', 'type' => 'radio:yes_no', 'explain' => false) + 'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'auth_bbcode_pm' => array('lang' => 'ALLOW_BBCODE_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'auth_smilies_pm' => array('lang' => 'ALLOW_SMILIES_PM', '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_sig_pm' => array('lang' => 'ALLOW_SIG_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'print_pm' => array('lang' => 'ALLOW_PRINT_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + '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' => false), + 'enable_pm_icons' => array('lang' => 'ENABLE_PM_ICONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false) ) ); break; @@ -134,31 +131,32 @@ class acp_board 'title' => 'ACP_POST_SETTINGS', 'vars' => array( 'legend1' => 'GENERAL_OPTIONS', - 'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'type' => 'radio:yes_no', 'explain' => true), - 'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'type' => 'radio:yes_no', 'explain' => true), - 'enable_post_confirm' => array('lang' => 'VISUAL_CONFIRM_POST', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + '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_post_links' => array('lang' => 'ALLOW_POST_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + '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), 'legend2' => 'POSTING', 'bump_type' => false, - 'edit_time' => array('lang' => 'EDIT_TIME', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), - 'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'type' => 'radio:yes_no', 'explain' => true), - 'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'type' => 'text:3:4', 'explain' => true), - 'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true), - 'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'type' => 'text:3:4', 'explain' => false), - 'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'type' => 'text:3:4', 'explain' => false), - 'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'type' => 'text:3:4', 'explain' => false), - 'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'type' => 'text:4:4', 'explain' => false), - 'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'type' => 'text:4:6', 'explain' => true), - 'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'type' => 'text:4:4', 'explain' => true), - 'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'type' => 'text:5:4', 'explain' => true), - 'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'type' => 'text:5:4', 'explain' => true), - 'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'type' => 'text:4:4', 'explain' => true), - 'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'type' => 'text:5:4', 'explain' => true), - 'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'type' => 'text:5:4', 'explain' => true), + 'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int', 'type' => 'text:3:3', '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', 'type' => 'text:3:4', 'explain' => true), + 'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true), + 'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false), + 'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false), + 'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false), + 'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => false), + 'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int', 'type' => 'text:4:6', 'explain' => true), + 'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), + 'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), + 'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), + 'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), + 'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), + 'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), ) ); break; @@ -168,19 +166,20 @@ class acp_board 'title' => 'ACP_SIGNATURE_SETTINGS', 'vars' => array( 'legend1' => 'GENERAL_OPTIONS', - 'allow_sig' => array('lang' => 'ALLOW_SIG', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_sig_bbcode' => array('lang' => 'ALLOW_SIG_BBCODE', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_sig_img' => array('lang' => 'ALLOW_SIG_IMG', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_sig_flash' => array('lang' => 'ALLOW_SIG_FLASH', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_sig_smilies' => array('lang' => 'ALLOW_SIG_SMILIES', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_sig' => array('lang' => 'ALLOW_SIG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_sig_bbcode' => array('lang' => 'ALLOW_SIG_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_sig_img' => array('lang' => 'ALLOW_SIG_IMG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_sig_flash' => array('lang' => 'ALLOW_SIG_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_sig_smilies' => array('lang' => 'ALLOW_SIG_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_sig_links' => array('lang' => 'ALLOW_SIG_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'legend2' => 'GENERAL_SETTINGS', - 'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'type' => 'text:5:4', 'explain' => true), - 'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'type' => 'text:5:4', 'explain' => true), - 'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'type' => 'text:5:4', 'explain' => true), - 'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'type' => 'text:5:4', 'explain' => true), - 'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'type' => 'text:5:4', 'explain' => true), - 'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'type' => 'text:5:4', 'explain' => true), + 'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), + 'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), + 'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), + 'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), + 'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), + 'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), ) ); break; @@ -193,24 +192,24 @@ class acp_board 'max_name_chars' => false, 'max_pass_chars' => false, - 'require_activation' => array('lang' => 'ACC_ACTIVATION', 'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true), - 'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'type' => 'custom', 'method' => 'username_length', 'explain' => true), - 'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'type' => 'custom', 'method' => 'password_length', 'explain' => true), - 'allow_name_chars' => array('lang' => 'USERNAME_CHARS', 'type' => 'select', 'method' => 'select_username_chars', 'explain' => true), - 'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true), - 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'type' => 'text:3:3', 'explain' => true), + 'require_activation' => array('lang' => 'ACC_ACTIVATION', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true), + 'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int', 'type' => 'custom', 'method' => 'username_length', 'explain' => true), + 'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int', 'type' => 'custom', 'method' => 'password_length', 'explain' => true), + 'allow_name_chars' => array('lang' => 'USERNAME_CHARS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_username_chars', 'explain' => true), + 'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true), + 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'legend2' => 'GENERAL_OPTIONS', - 'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'type' => 'radio:yes_no', 'explain' => false), - 'allow_emailreuse' => array('lang' => 'ALLOW_EMAIL_REUSE', 'type' => 'radio:yes_no', 'explain' => true), - 'enable_confirm' => array('lang' => 'VISUAL_CONFIRM_REG', 'type' => 'radio:yes_no', 'explain' => true), - 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'type' => 'text:3:3', 'explain' => true), - 'max_reg_attempts' => array('lang' => 'REG_LIMIT', 'type' => 'text:4:4', 'explain' => true), + 'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_emailreuse' => array('lang' => 'ALLOW_EMAIL_REUSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'enable_confirm' => array('lang' => 'VISUAL_CONFIRM_REG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'max_reg_attempts' => array('lang' => 'REG_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), 'legend3' => 'COPPA', - 'coppa_enable' => array('lang' => 'ENABLE_COPPA', 'type' => 'radio:yes_no', 'explain' => true), - 'coppa_mail' => array('lang' => 'COPPA_MAIL', 'type' => 'textarea:5:40', 'explain' => true), - 'coppa_fax' => array('lang' => 'COPPA_FAX', 'type' => 'text:25:100', 'explain' => false), + '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), ) ); break; @@ -220,10 +219,10 @@ class acp_board 'title' => 'ACP_COOKIE_SETTINGS', 'vars' => array( 'legend1' => 'ACP_COOKIE_SETTINGS', - 'cookie_domain' => array('lang' => 'COOKIE_DOMAIN', 'type' => 'text::255', 'explain' => false), - 'cookie_name' => array('lang' => 'COOKIE_NAME', 'type' => 'text::16', 'explain' => false), - 'cookie_path' => array('lang' => 'COOKIE_PATH', 'type' => 'text::255', 'explain' => false), - 'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'type' => 'radio:disabled_enabled', 'explain' => true) + 'cookie_domain' => array('lang' => 'COOKIE_DOMAIN', 'validate' => 'string', 'type' => 'text::255', 'explain' => false), + 'cookie_name' => array('lang' => 'COOKIE_NAME', 'validate' => 'string', 'type' => 'text::16', 'explain' => false), + 'cookie_path' => array('lang' => 'COOKIE_PATH', 'validate' => 'string', 'type' => 'text::255', 'explain' => false), + 'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'validate' => 'bool', 'type' => 'radio:disabled_enabled', 'explain' => true) ) ); break; @@ -233,28 +232,28 @@ class acp_board 'title' => 'ACP_LOAD_SETTINGS', 'vars' => array( 'legend1' => 'GENERAL_SETTINGS', - 'limit_load' => array('lang' => 'LIMIT_LOAD', 'type' => 'text:4:4', 'explain' => true), - 'session_length' => array('lang' => 'SESSION_LENGTH', 'type' => 'text:5:5', 'explain' => true), - 'active_sessions' => array('lang' => 'LIMIT_SESSIONS', 'type' => 'text:4:4', 'explain' => true), - 'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'type' => 'text:4:3', 'explain' => true), + 'limit_load' => array('lang' => 'LIMIT_LOAD', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), + 'session_length' => array('lang' => 'SESSION_LENGTH', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true), + 'active_sessions' => array('lang' => 'LIMIT_SESSIONS', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), + 'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'validate' => 'int', 'type' => 'text:4:3', 'explain' => true), 'legend2' => 'GENERAL_OPTIONS', - 'load_db_track' => array('lang' => 'YES_POST_MARKING', 'type' => 'radio:yes_no', 'explain' => true), - 'load_db_lastread' => array('lang' => 'YES_READ_MARKING', 'type' => 'radio:yes_no', 'explain' => true), - 'load_anon_lastread' => array('lang' => 'YES_ANON_READ_MARKING', 'type' => 'radio:yes_no', 'explain' => true), - 'load_online' => array('lang' => 'YES_ONLINE', 'type' => 'radio:yes_no', 'explain' => true), - 'load_online_guests' => array('lang' => 'YES_ONLINE_GUESTS', 'type' => 'radio:yes_no', 'explain' => true), - 'load_onlinetrack' => array('lang' => 'YES_ONLINE_TRACK', 'type' => 'radio:yes_no', 'explain' => true), - 'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'type' => 'radio:yes_no', 'explain' => false), - 'load_moderators' => array('lang' => 'YES_MODERATORS', 'type' => 'radio:yes_no', 'explain' => false), - 'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'type' => 'radio:yes_no', 'explain' => false), - 'load_user_activity' => array('lang' => 'LOAD_USER_ACTIVITY', 'type' => 'radio:yes_no', 'explain' => true), - 'load_tplcompile' => array('lang' => 'RECOMPILE_TEMPLATES', 'type' => 'radio:yes_no', 'explain' => true), + 'load_db_track' => array('lang' => 'YES_POST_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_db_lastread' => array('lang' => 'YES_READ_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_anon_lastread' => array('lang' => 'YES_ANON_READ_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_online' => array('lang' => 'YES_ONLINE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_online_guests' => array('lang' => 'YES_ONLINE_GUESTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_onlinetrack' => array('lang' => 'YES_ONLINE_TRACK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_moderators' => array('lang' => 'YES_MODERATORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'load_user_activity' => array('lang' => 'LOAD_USER_ACTIVITY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_tplcompile' => array('lang' => 'RECOMPILE_TEMPLATES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'legend3' => 'CUSTOM_PROFILE_FIELDS', - 'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'type' => 'radio:yes_no', 'explain' => false), - 'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'type' => 'radio:yes_no', 'explain' => false), - 'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'type' => 'radio:yes_no', 'explain' => false), + '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), ) ); break; @@ -264,7 +263,7 @@ class acp_board 'title' => 'ACP_AUTH_SETTINGS', 'vars' => array( 'legend1' => 'ACP_AUTH_SETTINGS', - 'auth_method' => array('lang' => 'AUTH_METHOD', 'type' => 'select', 'method' => 'select_auth_method', 'explain' => false) + 'auth_method' => array('lang' => 'AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'select_auth_method', 'explain' => false) ) ); break; @@ -274,20 +273,20 @@ class acp_board 'title' => 'ACP_SERVER_SETTINGS', 'vars' => array( 'legend1' => 'ACP_SERVER_SETTINGS', - 'send_encoding' => array('lang' => 'SEND_ENCODING', 'type' => 'radio:yes_no', 'explain' => true), - 'gzip_compress' => array('lang' => 'ENABLE_GZIP', 'type' => 'radio:yes_no', 'explain' => false), + 'send_encoding' => array('lang' => 'SEND_ENCODING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'gzip_compress' => array('lang' => 'ENABLE_GZIP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'legend2' => 'PATH_SETTINGS', - 'smilies_path' => array('lang' => 'SMILIES_PATH', 'type' => 'text:20:255', 'explain' => true), - 'icons_path' => array('lang' => 'ICONS_PATH', 'type' => 'text:20:255', 'explain' => true), - 'upload_icons_path' => array('lang' => 'UPLOAD_ICONS_PATH', 'type' => 'text:20:255', 'explain' => true), - 'ranks_path' => array('lang' => 'RANKS_PATH', 'type' => 'text:20:255', 'explain' => true), + 'smilies_path' => array('lang' => 'SMILIES_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true), + 'icons_path' => array('lang' => 'ICONS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true), + 'upload_icons_path' => array('lang' => 'UPLOAD_ICONS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true), + 'ranks_path' => array('lang' => 'RANKS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true), 'legend3' => 'SERVER_URL_SETTINGS', - 'force_server_vars' => array('lang' => 'FORCE_SERVER_VARS', 'type' => 'radio:yes_no', 'explain' => true), - 'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'type' => 'text:10:10', 'explain' => true), - 'server_name' => array('lang' => 'SERVER_NAME', 'type' => 'text:40:255', 'explain' => true), - 'server_port' => array('lang' => 'SERVER_PORT', 'type' => 'text:5:5', 'explain' => true), + 'force_server_vars' => array('lang' => 'FORCE_SERVER_VARS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true), + 'server_name' => array('lang' => 'SERVER_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), + 'server_port' => array('lang' => 'SERVER_PORT', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true), ) ); break; @@ -297,14 +296,16 @@ class acp_board 'title' => 'ACP_SECURITY_SETTINGS', 'vars' => array( 'legend1' => 'ACP_SECURITY_SETTINGS', - 'allow_autologin' => array('lang' => 'ALLOW_AUTOLOGIN', 'type' => 'radio:yes_no', 'explain' => true), - 'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'type' => 'text:5:5', 'explain' => true), - 'ip_check' => array('lang' => 'IP_VALID', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true), - 'browser_check' => array('lang' => 'BROWSER_VALID', 'type' => 'radio:yes_no', 'explain' => true), - 'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true), - 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'type' => 'text:3:3', 'explain' => true), - 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'type' => 'text:3:3', 'explain' => true), - 'tpl_allow_php' => array('lang' => 'TPL_ALLOW_PHP', 'type' => 'radio:yes_no', 'explain' => true), + 'allow_autologin' => array('lang' => 'ALLOW_AUTOLOGIN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true), + 'ip_check' => array('lang' => 'IP_VALID', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true), + 'browser_check' => array('lang' => 'BROWSER_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'check_dnsbl' => array('lang' => 'CHECK_DNSBL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'email_check_mx' => array('lang' => 'EMAIL_CHECK_MX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true), + 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'tpl_allow_php' => array('lang' => 'TPL_ALLOW_PHP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), ) ); break; @@ -314,28 +315,29 @@ class acp_board 'title' => 'ACP_EMAIL_SETTINGS', 'vars' => array( 'legend1' => 'GENERAL_SETTINGS', - 'email_enable' => array('lang' => 'ENABLE_EMAIL', 'type' => 'radio:enabled_disabled', 'explain' => true), - 'board_email_form' => array('lang' => 'BOARD_EMAIL_FORM', 'type' => 'radio:enabled_disabled', 'explain' => true), - 'email_function_name' => array('lang' => 'EMAIL_FUNCTION_NAME', 'type' => 'text:20:50', 'explain' => true), - 'email_package_size' => array('lang' => 'EMAIL_PACKAGE_SIZE', 'type' => 'text:5:5', 'explain' => true), - 'board_contact' => array('lang' => 'CONTACT_EMAIL', 'type' => 'text:25:100', 'explain' => true), - 'board_email' => array('lang' => 'ADMIN_EMAIL', 'type' => 'text:25:100', 'explain' => true), - 'board_email_sig' => array('lang' => 'EMAIL_SIG', 'type' => 'textarea:5:30', 'explain' => true), - 'board_hide_emails' => array('lang' => 'BOARD_HIDE_EMAILS', 'type' => 'radio:yes_no', 'explain' => true), + 'email_enable' => array('lang' => 'ENABLE_EMAIL', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), + 'board_email_form' => array('lang' => 'BOARD_EMAIL_FORM', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), + 'email_function_name' => array('lang' => 'EMAIL_FUNCTION_NAME', 'validate' => 'string', 'type' => 'text:20:50', 'explain' => true), + 'email_package_size' => array('lang' => 'EMAIL_PACKAGE_SIZE', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true), + 'board_contact' => array('lang' => 'CONTACT_EMAIL', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true), + 'board_email' => array('lang' => 'ADMIN_EMAIL', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true), + 'board_email_sig' => array('lang' => 'EMAIL_SIG', 'validate' => 'string', 'type' => 'textarea:5:30', 'explain' => true), + 'board_hide_emails' => array('lang' => 'BOARD_HIDE_EMAILS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'legend2' => 'SMTP_SETTINGS', - 'smtp_delivery' => array('lang' => 'USE_SMTP', 'type' => 'radio:yes_no', 'explain' => true), - 'smtp_host' => array('lang' => 'SMTP_SERVER', 'type' => 'text:25:50', 'explain' => false), - 'smtp_port' => array('lang' => 'SMTP_PORT', 'type' => 'text:4:5', 'explain' => true), - 'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true), - 'smtp_username' => array('lang' => 'SMTP_USERNAME', 'type' => 'text:25:255', 'explain' => true), - 'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'type' => 'password:25:255', 'explain' => true) + 'smtp_delivery' => array('lang' => 'USE_SMTP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'smtp_host' => array('lang' => 'SMTP_SERVER', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => false), + 'smtp_port' => array('lang' => 'SMTP_PORT', 'validate' => 'int', '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) ) ); break; default: - trigger_error('NO_MODE'); + trigger_error('NO_MODE', E_USER_ERROR); + break; } if (isset($display_vars['lang'])) @@ -345,6 +347,20 @@ class acp_board $this->new_config = $config; $cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => ''), true) : $this->new_config; + if (isset($_REQUEST['config'])) + { + utf8_normalize_nfc(&$cfg_array); + } + $error = array(); + + // We validate the complete config if whished + validate_config_vars($display_vars['vars'], $cfg_array, $error); + + // Do not write values if there is an error + if (sizeof($error)) + { + $submit = false; + } // We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to... foreach ($display_vars['vars'] as $config_name => $null) @@ -448,14 +464,14 @@ class acp_board { set_config($config_name, $config_value); } - trigger_error($error . adm_back_link($this->u_action)); + trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING); } } set_config('auth_method', $cfg_array['auth_method']); } else { - trigger_error('NO_AUTH_PLUGIN'); + trigger_error('NO_AUTH_PLUGIN', E_USER_ERROR); } } } @@ -473,6 +489,10 @@ class acp_board $template->assign_vars(array( 'L_TITLE' => $user->lang[$display_vars['title']], 'L_TITLE_EXPLAIN' => $user->lang[$display_vars['title'] . '_EXPLAIN'], + + 'S_ERROR' => (sizeof($error)) ? true : false, + 'ERROR_MSG' => implode('<br />', $error), + 'U_ACTION' => $this->u_action) ); diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php index f24a6b7b12..2dbcc463e9 100644 --- a/phpBB/includes/acp/acp_bots.php +++ b/phpBB/includes/acp/acp_bots.php @@ -142,6 +142,12 @@ class acp_bots } $bot_row['bot_ip'] = str_replace(' ', '', $bot_row['bot_ip']); + // Make sure the admin is not adding a bot with an user agent similar to his one + if ($bot_row['bot_agent'] && substr($user->data['session_browser'], 0, 149) === substr($bot_row['bot_agent'], 0, 149)) + { + $error[] = $user->lang['ERR_BOT_AGENT_MATCHES_UA']; + } + if (!sizeof($error)) { $db->sql_transaction('begin'); @@ -159,7 +165,7 @@ class acp_bots if (!$group_row) { - trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action")); + trigger_error($user->lang['NO_BOT_GROUP'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"), E_USER_WARNING); } $user_id = user_add(array( @@ -197,7 +203,7 @@ class acp_bots if (!$row) { - trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action")); + trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"), E_USER_WARNING); } $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array( @@ -237,7 +243,7 @@ class acp_bots if (!$bot_row) { - trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action")); + trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"), E_USER_WARNING); } $bot_row['bot_lang'] = $bot_row['user_lang']; diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php index 3ac354004a..7cef658e93 100644 --- a/phpBB/includes/acp/acp_captcha.php +++ b/phpBB/includes/acp/acp_captcha.php @@ -21,91 +21,37 @@ class acp_captcha $user->add_lang('acp/board'); - $config_vars = array('enable_confirm' => 'REG_ENABLE', - 'enable_post_confirm' => 'POST_ENABLE', - 'policy_overlap' => 'OVERLAP_ENABLE', - 'policy_overlap_noise_pixel' => 'OVERLAP_NOISE_PIXEL', - 'policy_overlap_noise_line' => 'OVERLAP_NOISE_LINE_ENABLE', - 'policy_entropy' => 'ENTROPY_ENABLE', - 'policy_entropy_noise_pixel' => 'ENTROPY_NOISE_PIXEL', - 'policy_entropy_noise_line' => 'ENTROPY_NOISE_LINE_ENABLE', - 'policy_shape' => 'SHAPE_ENABLE', - 'policy_shape_noise_pixel' => 'SHAPE_NOISE_PIXEL', - 'policy_shape_noise_line' => 'SHAPE_NOISE_LINE_ENABLE', - 'policy_3dbitmap' => 'THREEDBITMAP_ENABLE', - 'policy_cells' => 'CELLS_ENABLE', - 'policy_stencil' => 'STENCIL_ENABLE', - 'policy_composite' => 'COMPOSITE_ENABLE' - ); - - $policy_modules = array('policy_entropy', 'policy_3dbitmap', 'policy_overlap', 'policy_shape', 'policy_cells', 'policy_stencil', 'policy_composite'); - - switch ($mode) + $config_vars = array( + 'enable_confirm' => 'REG_ENABLE', + 'enable_post_confirm' => 'POST_ENABLE', + 'captcha_gd' => 'CAPTCHA_GD', + 'captcha_gd_noise' => 'CAPTCHA_GD_NOISE', + ); + + $this->tpl_name = 'acp_captcha'; + $this->page_title = 'ACP_VC_SETTINGS'; + $submit = request_var('submit', ''); + if ($submit) { - case 'visual': - $this->tpl_name = 'acp_captcha'; - $this->page_title = 'ACP_VC_SETTINGS'; - $submit = request_var('submit', ''); - if ($submit) - { - $config_vars = array_keys($config_vars); - foreach ($config_vars as $config_var) - { - set_config($config_var, request_var($config_var, '')); - } - trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action)); - } - else - { - $array = array(); - - foreach ($config_vars as $config_var => $template_var) - { - $array[$template_var] = $config[$config_var]; - } - $template->assign_vars($array); - - - if (@extension_loaded('gd')) - { - $template->assign_var('GD', true); - foreach ($policy_modules as $module_name) - { - $template->assign_var('U_' . strtoupper($module_name), sprintf($user->lang['CAPTCHA_EXPLAIN'], '<a href="' . append_sid("{$phpbb_root_path}adm/index.$phpEx", 'i=captcha&mode=img&policy=' . $module_name) . '" target="_blank">', '</a>')); - } - if (function_exists('imagettfbbox') && function_exists('imagettftext')) - { - $template->assign_var('TTF', true); - } - } - } - break; - - case 'img': - $policy = request_var('policy', ''); - - if (!@extension_loaded('gd')) - { - trigger_error($user->lang['NO_GD']); - } - - if (!($policy === 'policy_entropy' || $policy === 'policy_3dbitmap') && (!function_exists('imagettfbbox') || !function_exists('imagettftext'))) - { - trigger_error($user->lang['NO_TTF']); - } - - if (!in_array($policy, $policy_modules)) - { - trigger_error($user->lang['BAD_POLICY']); - } - - $user->add_lang('ucp'); - - include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx); - - $captcha = new captcha(); - $captcha->execute(gen_rand_string(), $policy); - break; + $config_vars = array_keys($config_vars); + foreach ($config_vars as $config_var) + { + set_config($config_var, request_var($config_var, '')); + } + trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action)); + } + else + { + $array = array(); + + if (@extension_loaded('gd') && function_exists('imagettfbbox') && function_exists('imagettftext')) + { + $template->assign_var('GD', true); + } + foreach ($config_vars as $config_var => $template_var) + { + $template->assign_var($template_var, $config[$config_var]); + } } } } diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 59ccb342fd..cbd654fbcc 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -68,7 +68,9 @@ class acp_database @set_time_limit(1200); - $filename = 'backup_' . time(); + $time = time(); + + $filename = 'backup_' . $time; // We set up the info needed for our on-the-fly creation :D switch ($format) @@ -111,7 +113,7 @@ class acp_database if (!$fp) { - trigger_error('Unable to write temporary file to storage folder'); + trigger_error('Unable to write temporary file to storage folder', E_USER_ERROR); } } @@ -128,10 +130,10 @@ class acp_database $sql_data .= "#\n"; $sql_data .= "# phpBB Backup Script\n"; $sql_data .= "# Dump of tables for $table_prefix\n"; - $sql_data .= "# DATE : " . gmdate("d-m-Y H:i:s", $filename) . " GMT\n"; + $sql_data .= "# DATE : " . gmdate("d-m-Y H:i:s", $time) . " GMT\n"; $sql_data .= "#\n"; - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'sqlite': $sql_data .= "BEGIN TRANSACTION;\n"; @@ -149,12 +151,37 @@ class acp_database break; } + if ($structure && $db->sql_layer == 'firebird') + { + $sql = 'SELECT RDB$FUNCTION_NAME, RDB$DESCRIPTION + FROM RDB$FUNCTIONS + ORDER BY RDB$FUNCTION_NAME'; + $result = $db->sql_query($sql); + + $rows = array(); + while ($row = $db->sql_fetchrow($result)) + { + $sql = 'SELECT F.RDB$FUNCTION_NAME, F.RDB$MODULE_NAME, F.RDB$ENTRYPOINT, F.RDB$RETURN_ARGUMENT, F.RDB$DESCRIPTION, FA.RDB$ARGUMENT_POSITION, FA.RDB$MECHANISM, FA.RDB$FIELD_TYPE, FA.RDB$FIELD_SCALE, FA.RDB$FIELD_LENGTH, FA.RDB$FIELD_SUB_TYPE, C.RDB$BYTES_PER_CHARACTER, C.RDB$CHARACTER_SET_NAME ,FA.RDB$FIELD_PRECISION + FROM RDB$FUNCTIONS F + LEFT JOIN RDB$FUNCTION_ARGUMENTS FA ON F.RDB$FUNCTION_NAME = FA.RDB$FUNCTION_NAME + LEFT JOIN RDB$CHARACTER_SETS C ON FA.RDB$CHARACTER_SET_ID = C.RDB$CHARACTER_SET_ID + WHERE (F.RDB$FUNCTION_NAME = ' . $row['FUNCTION_NAME'] . ') + ORDER BY FA.RDB$ARGUMENT_POSITION'; + $result2 = $db->sql_query($sql); + while ($row2 = $db->sql_fetchrow($result2)) + { + } + $db->sql_freeresult($result2); + } + $db->sql_freeresult($result); + } + foreach ($table as $table_name) { // Get the table structure if ($structure) { - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysqli': case 'mysql4': @@ -197,27 +224,12 @@ class acp_database } $sql_data .= $this->get_table_structure($table_name); } - // We might wanna empty out all that junk :D else { - switch (SQL_LAYER) - { - case 'mysqli': - case 'mysql4': - case 'mysql': - case 'mssql': - case 'mssql_odbc': - case 'oracle': - case 'postgres': - case 'firebird': - $sql_data .= 'TRUNCATE TABLE ' . $table_name . ";\n"; - break; - - case 'sqlite': - $sql_data .= 'DELETE FROM ' . $table_name . ";\n"; - break; - } + // We might wanna empty out all that junk :D + $sql_data .= (($db->sql_layer == 'sqlite') ? 'DELETE FROM ' : 'TRUNCATE TABLE ') . $table_name . ";\n"; } + // Now write the data for the first time. :) if ($store == true) { @@ -243,7 +255,7 @@ class acp_database { $sql_data .= "\n"; - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysqli': @@ -263,8 +275,8 @@ class acp_database $field_set[$j] = $field[$j]->name; } - $search = array('\\', "'", "\x00", "\x0a", "\x0d", "\x1a"); - $replace = array('\\\\\\\\', "''", '\0', '\n', '\r', '\Z'); + $search = array("\\", "'", "\x00", "\x0a", "\x0d", "\x1a", '"'); + $replace = array("\\\\", "\\'", '\0', '\n', '\r', '\Z', '\\"'); $fields = implode(', ', $field_set); $values = array(); $schema_insert = 'INSERT INTO ' . $table_name . ' (' . $fields . ') VALUES ('; @@ -336,8 +348,8 @@ class acp_database $field_set[$j] = $field[$j]->name; } - $search = array('\\', "'", "\x00", "\x0a", "\x0d", "\x1a"); - $replace = array('\\\\\\\\', "''", '\0', '\n', '\r', '\Z'); + $search = array("\\", "'", "\x00", "\x0a", "\x0d", "\x1a", '"'); + $replace = array("\\\\", "\\'", '\0', '\n', '\r', '\Z', '\\"'); $fields = implode(', ', $field_set); $schema_insert = 'INSERT INTO ' . $table_name . ' (' . $fields . ') VALUES ('; @@ -406,7 +418,7 @@ class acp_database $column_list = array(); $table_cols = explode(',', trim($matches[1])); - foreach($table_cols as $declaration) + foreach ($table_cols as $declaration) { $entities = preg_split('#\s+#', trim($declaration)); $column_name = preg_replace('/"?([^"]+)"?/', '\1', $entities[0]); @@ -442,7 +454,7 @@ class acp_database { $row_data = "''"; } - else if (strpos($col_types[$row_name], 'text') !== false || strpos($col_types[$row_name], 'char') !== false) + else if (strpos($col_types[$row_name], 'text') !== false || strpos($col_types[$row_name], 'char') !== false || strpos($col_types[$row_name], 'blob') !== false) { $row_data = "'" . $row_data . "'"; } @@ -516,7 +528,7 @@ class acp_database { $str_val = $row[$ary_name[$i]]; - if (preg_match('#char|text|bool#i', $ary_type[$i])) + if (preg_match('#char|text|bool|bytea#i', $ary_type[$i])) { $str_quote = "'"; $str_empty = ''; @@ -637,7 +649,7 @@ class acp_database { $str_val = $row[$ary_name[$i]]; - if (preg_match('#char|text|bool#i', $ary_type[$i])) + if (preg_match('#char|text|bool|varbinary#i', $ary_type[$i])) { $str_quote = "'"; $str_empty = ''; @@ -748,7 +760,7 @@ class acp_database { $str_val = $row[$ary_name[$i]]; - if (preg_match('#char|text|bool#i', $ary_type[$i])) + if (preg_match('#char|text|bool|varbinary#i', $ary_type[$i])) { $str_quote = "'"; $str_empty = ''; @@ -843,7 +855,7 @@ class acp_database { $str_val = $row[strtolower($ary_name[$i])]; - if (preg_match('#char|text|bool#i', $ary_type[$i])) + if (preg_match('#char|text|bool|varbinary#i', $ary_type[$i])) { $str_quote = "'"; $str_empty = ''; @@ -927,7 +939,7 @@ class acp_database { $str_val = $row[$ary_name[$i]]; - if (preg_match('#char|text|bool#i', $ary_type[$i])) + if (preg_match('#char|text|bool|raw#i', $ary_type[$i])) { $str_quote = "'"; $str_empty = ''; @@ -989,7 +1001,7 @@ class acp_database } } - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'sqlite': case 'postgres': @@ -1024,12 +1036,12 @@ class acp_database unset($sql_data); add_log('admin', 'LOG_DB_BACKUP'); - trigger_error($user->lang['BACKUP_SUCCESS']); + trigger_error($user->lang['BACKUP_SUCCESS'] . adm_back_link($this->u_action)); break; default: $tables = array(); - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'sqlite': $sql = "SELECT name @@ -1167,13 +1179,13 @@ class acp_database if (!(file_exists($file_name) && is_readable($file_name))) { - trigger_error($user->lang['BACKUP_INVALID']); + trigger_error($user->lang['BACKUP_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); } if ($delete) { unlink($file_name); - trigger_error($user->lang['BACKUP_DELETE']); + trigger_error($user->lang['BACKUP_DELETE'] . adm_back_link($this->u_action)); } $data = file_get_contents($file_name); @@ -1220,13 +1232,13 @@ class acp_database remove_remarks($data); // SQLite gets improved performance when you shove all of these disk write queries at once :D - if (SQL_LAYER == 'sqlite') + if ($db->sql_layer == 'sqlite') { $db->sql_query($data); } else { - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'firebird': $delim = ';;'; @@ -1263,7 +1275,7 @@ class acp_database } } add_log('admin', 'LOG_DB_RESTORE'); - trigger_error($user->lang['RESTORE_SUCCESS']); + trigger_error($user->lang['RESTORE_SUCCESS'] . adm_back_link($this->u_action)); break; default: @@ -1324,7 +1336,7 @@ class acp_database $sql_data = ''; - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysqli': case 'mysql4': @@ -1370,11 +1382,22 @@ class acp_database { $kname = $row['Key_name']; - if ($kname != 'PRIMARY' && $row['Non_unique'] == 0) + if ($kname != 'PRIMARY') { - $kname = "UNIQUE|$kname"; + if ($row['Index_type'] == 'FULLTEXT') + { + $kname = "FULLTEXT|$kname"; + } + else if ($row['Non_unique'] == 0) + { + $kname = "UNIQUE|$kname"; + } } + if ($row['Sub_part']) + { + $row['Column_name'] .= '(' . $row['Sub_part'] . ')'; + } $index[$kname][] = $row['Column_name']; } $db->sql_freeresult($result); @@ -1391,6 +1414,10 @@ class acp_database { $line .= 'UNIQUE ' . substr($key, 7) . ' (' . implode(', ', $columns) . ')'; } + else if (strpos($key, 'FULLTEXT') === 0) + { + $line .= 'FULLTEXT ' . substr($key, 9) . ' (' . implode(', ', $columns) . ')'; + } else { $line .= "KEY $key (" . implode(', ', $columns) . ')'; diff --git a/phpBB/includes/acp/acp_disallow.php b/phpBB/includes/acp/acp_disallow.php index 1fdc2f8551..adb7270332 100644 --- a/phpBB/includes/acp/acp_disallow.php +++ b/phpBB/includes/acp/acp_disallow.php @@ -37,12 +37,14 @@ class acp_disallow if (!$disallowed_user) { - trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'INSERT INTO ' . DISALLOW_TABLE . ' ' . $db->sql_build_array('INSERT', array('disallow_username' => $disallowed_user)); $db->sql_query($sql); + $cache->destroy('disallowed_usernames'); + $message = $user->lang['DISALLOW_SUCCESSFUL']; add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user)); @@ -54,16 +56,18 @@ class acp_disallow if (!$disallowed_id) { - trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); } - $sql = 'DELETE FROM ' . DISALLOW_TABLE . " - WHERE disallow_id = $disallowed_id"; + $sql = 'DELETE FROM ' . DISALLOW_TABLE . ' + WHERE disallow_id = ' . $disallowed_id; $db->sql_query($sql); + $cache->destroy('disallowed_usernames'); + add_log('admin', 'LOG_DISALLOW_DELETE'); - trigger_error($user->lang['DISALLOWED_DELETED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['DISALLOWED_DELETED'] . adm_back_link($this->u_action), E_USER_WARNING); } // Grab the current list of disallowed usernames... diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index c20640bd54..5b79451634 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -28,7 +28,7 @@ class acp_email $submit = (isset($_POST['submit'])) ? true : false; $error = array(); - $usernames = request_var('usernames', ''); + $usernames = request_var('usernames', '', true); $group_id = request_var('g', 0); $subject = request_var('subject', '', true); $message = request_var('message', '', true); @@ -57,7 +57,7 @@ class acp_email { $sql = 'SELECT username, user_email, user_jabber, user_notify_type, user_lang FROM ' . USERS_TABLE . ' - WHERE ' . $db->sql_in_set('username', explode("\n", $usernames)) . ' + WHERE ' . $db->sql_in_set('username_clean', array_map('utf8_clean_string', explode("\n", $usernames))) . ' AND user_allow_massemail = 1 ORDER BY user_lang, user_notify_type'; // , SUBSTRING(user_email FROM INSTR(user_email, '@')) } @@ -87,7 +87,7 @@ class acp_email if (!$row) { $db->sql_freeresult($result); - trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING); } $i = $j = 0; @@ -150,15 +150,13 @@ class acp_email $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']); $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); - $messenger->subject(html_entity_decode($subject)); + $messenger->subject(htmlspecialchars_decode($subject)); $messenger->replyto($config['board_email']); $messenger->set_mail_priority($priority); $messenger->assign_vars(array( - 'SITENAME' => $config['sitename'], 'CONTACT_EMAIL' => $config['board_contact'], - 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), - 'MESSAGE' => html_entity_decode($message)) + 'MESSAGE' => htmlspecialchars_decode($message)) ); if (!($messenger->send($used_method))) @@ -185,12 +183,13 @@ class acp_email if (!$errored) { $message = ($use_queue) ? $user->lang['EMAIL_SENT_QUEUE'] : $user->lang['EMAIL_SENT']; + trigger_error($message . adm_back_link($this->u_action)); } else { $message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&mode=critical') . '">', '</a>'); + trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING); } - trigger_error($message . adm_back_link($this->u_action)); } } @@ -216,6 +215,7 @@ class acp_email 'S_GROUP_OPTIONS' => $select_list, 'USERNAMES' => $usernames, 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_email&field=usernames'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_email&field=usernames', false), 'SUBJECT' => $subject, 'MESSAGE' => $message, 'S_PRIORITY_OPTIONS' => $s_priority_options) diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 5964a285e7..7f4dde7211 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -36,11 +36,19 @@ class acp_forums // Check additional permissions switch ($action) { + case 'progress_bar': + $start = request_var('start', 0); + $total = request_var('total', 0); + + $this->display_progress_bar($start, $total); + exit; + break; + case 'delete': if (!$auth->acl_get('a_forumdel')) { - trigger_error($user->lang['NO_PERMISSION_FORUM_DELETE'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); + trigger_error($user->lang['NO_PERMISSION_FORUM_DELETE'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } break; @@ -49,7 +57,7 @@ class acp_forums if (!$auth->acl_get('a_forumadd')) { - trigger_error($user->lang['NO_PERMISSION_FORUM_ADD'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); + trigger_error($user->lang['NO_PERMISSION_FORUM_ADD'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } break; @@ -94,23 +102,24 @@ class acp_forums 'forum_type' => request_var('forum_type', FORUM_POST), 'type_action' => request_var('type_action', ''), 'forum_status' => request_var('forum_status', ITEM_UNLOCKED), + 'forum_parents' => '', 'forum_name' => request_var('forum_name', '', true), 'forum_link' => request_var('forum_link', ''), 'forum_link_track' => request_var('forum_link_track', false), 'forum_desc' => request_var('forum_desc', '', true), 'forum_desc_uid' => '', - 'forum_desc_options' => 0, + 'forum_desc_options' => 7, 'forum_desc_bitfield' => '', 'forum_rules' => request_var('forum_rules', '', true), 'forum_rules_uid' => '', - 'forum_rules_options' => 0, + 'forum_rules_options' => 7, 'forum_rules_bitfield' => '', 'forum_rules_link' => request_var('forum_rules_link', ''), 'forum_image' => request_var('forum_image', ''), 'forum_style' => request_var('forum_style', 0), 'display_on_index' => request_var('display_on_index', false), 'forum_topics_per_page' => request_var('topics_per_page', 0), - 'enable_indexing' => request_var('enable_indexing',true), + 'enable_indexing' => request_var('enable_indexing', true), 'enable_icons' => request_var('enable_icons', false), 'enable_prune' => request_var('enable_prune', false), 'enable_post_review' => request_var('enable_post_review', true), @@ -202,34 +211,8 @@ class acp_forums $db->sql_freeresult($result); // Now insert the data - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - if (sizeof($users_sql_ary)) - { - $db->sql_query('INSERT INTO ' . ACL_USERS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $users_sql_ary)); - } - - if (sizeof($groups_sql_ary)) - { - $db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $groups_sql_ary)); - } - break; - - default: - foreach ($users_sql_ary as $ary) - { - $db->sql_query('INSERT INTO ' . ACL_USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - - foreach ($groups_sql_ary as $ary) - { - $db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; - } + $db->sql_multi_insert(ACL_USERS_TABLE, $users_sql_ary); + $db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary); } $auth->acl_clear_prefetch(); @@ -265,7 +248,7 @@ class acp_forums if (!$forum_id) { - trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); + trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } $sql = 'SELECT * @@ -277,7 +260,7 @@ class acp_forums if (!$row) { - trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); + trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } $move_forum_name = $this->move_forum_by($row, $action, 1); @@ -293,7 +276,7 @@ class acp_forums case 'sync': if (!$forum_id) { - trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); + trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } $sql = 'SELECT forum_name, forum_type @@ -305,10 +288,76 @@ class acp_forums if (!$row) { - trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); + trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); + } + + sync('forum', 'forum_id', $forum_id, false, true); + $cache->destroy('sql', FORUMS_TABLE); + + $url = $this->u_action . "&parent_id={$this->parent_id}&f=$forum_id&action=sync_topic"; + meta_refresh(0, $url); + + $sql = 'SELECT forum_topics_real + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'U_PROGRESS_BAR' => $this->u_action . '&action=progress_bar', + 'UA_PROGRESS_BAR' => str_replace('&', '&', $this->u_action) . '&action=progress_bar', + 'S_CONTINUE_SYNC' => true, + 'L_PROGRESS_EXPLAIN' => sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], 0, $row['forum_topics_real'])) + ); + +// add_log('admin', 'LOG_FORUM_SYNC', $row['forum_name']); + + return; + + break; + + case 'sync_topic': + + @set_time_limit(0); + + $sql = 'SELECT forum_name, forum_topics_real + FROM ' . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row['forum_topics_real']) + { + $start = request_var('start', 0); + + $batch_size = 3000; + $end = $start + $batch_size; + + // Sync all topics in batch mode... + sync('topic_approved', 'range', 'topic_id BETWEEN ' . $start . ' AND ' . $end, true, false); + sync('topic', 'range', 'topic_id BETWEEN ' . $start . ' AND ' . $end, true, true); + + if ($end < $row['forum_topics_real']) + { + $start += $batch_size; + + $url = $this->u_action . "&parent_id={$this->parent_id}&f=$forum_id&action=sync_topic&start=$start&total={$row['forum_topics_real']}"; + + meta_refresh(0, $url); + + $template->assign_vars(array( + 'U_PROGRESS_BAR' => $this->u_action . "&action=progress_bar&start=$start&total={$row['forum_topics_real']}", + 'UA_PROGRESS_BAR' => str_replace('&', '&', $this->u_action) . "&action=progress_bar&start=$start&total={$row['forum_topics_real']}", + 'S_CONTINUE_SYNC' => true, + 'L_PROGRESS_EXPLAIN' => sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], $start, $row['forum_topics_real'])) + ); + + return; + } } - sync('forum', 'forum_id', $forum_id); add_log('admin', 'LOG_FORUM_SYNC', $row['forum_name']); $cache->destroy('sql', FORUMS_TABLE); @@ -322,12 +371,12 @@ class acp_forums if ($update) { $forum_data['forum_flags'] = 0; - $forum_data['forum_flags'] += (request_var('forum_link_track', false)) ? 1 : 0; - $forum_data['forum_flags'] += (request_var('prune_old_polls', false)) ? 2 : 0; - $forum_data['forum_flags'] += (request_var('prune_announce', false)) ? 4 : 0; - $forum_data['forum_flags'] += (request_var('prune_sticky', false)) ? 8 : 0; - $forum_data['forum_flags'] += ($forum_data['show_active']) ? 16 : 0; - $forum_data['forum_flags'] += (request_var('enable_post_review', true)) ? 32 : 0; + $forum_data['forum_flags'] += (request_var('forum_link_track', false)) ? FORUM_FLAG_LINK_TRACK : 0; + $forum_data['forum_flags'] += (request_var('prune_old_polls', false)) ? FORUM_FLAG_PRUNE_POLL : 0; + $forum_data['forum_flags'] += (request_var('prune_announce', false)) ? FORUM_FLAG_PRUNE_ANNOUNCE : 0; + $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; } // Show form to create/modify a forum @@ -389,7 +438,7 @@ class acp_forums 'prune_days' => 7, 'prune_viewed' => 7, 'prune_freq' => 1, - 'forum_flags' => 0, + 'forum_flags' => FORUM_FLAG_POST_REVIEW, 'forum_password' => '', 'forum_password_confirm'=> '', ); @@ -543,12 +592,12 @@ class acp_forums 'S_TOPIC_ICONS' => ($forum_data['enable_icons']) ? true : false, 'S_DISPLAY_ON_INDEX' => ($forum_data['display_on_index']) ? true : false, 'S_PRUNE_ENABLE' => ($forum_data['enable_prune']) ? true : false, - 'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & 1) ? true : false, - 'S_PRUNE_OLD_POLLS' => ($forum_data['forum_flags'] & 2) ? true : false, - 'S_PRUNE_ANNOUNCE' => ($forum_data['forum_flags'] & 4) ? true : false, - 'S_PRUNE_STICKY' => ($forum_data['forum_flags'] & 8) ? true : false, - 'S_DISPLAY_ACTIVE_TOPICS' => ($forum_data['forum_flags'] & 16) ? true : false, - 'S_ENABLE_POST_REVIEW' => ($forum_data['forum_flags'] & 32) ? true : false, + 'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? true : false, + 'S_PRUNE_OLD_POLLS' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_POLL) ? true : false, + 'S_PRUNE_ANNOUNCE' => ($forum_data['forum_flags'] & FORUM_FLAG_PRUNE_ANNOUNCE) ? true : false, + '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, ) ); @@ -560,7 +609,7 @@ class acp_forums if (!$forum_id) { - trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); + trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } $forum_data = $this->get_forum_info($forum_id); @@ -634,7 +683,7 @@ class acp_forums // Jumpbox $forum_box = make_forum_select($this->parent_id, false, false, false, false); //make_forum_select($this->parent_id); - if ($action == 'sync') + if ($action == 'sync' || $action == 'sync_topic') { $template->assign_var('S_RESYNCED', true); } @@ -677,6 +726,8 @@ class acp_forums $template->assign_block_vars('forums', array( 'FOLDER_IMAGE' => $folder_image, + 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="" />' : '', + 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'FORUM_NAME' => $row['forum_name'], 'FORUM_DESCRIPTION' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), 'FORUM_TOPICS' => $row['forum_topics'], @@ -716,7 +767,10 @@ class acp_forums 'NAVIGATION' => $navigation, 'FORUM_BOX' => $forum_box, 'U_SEL_ACTION' => $this->u_action, - 'U_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id) + 'U_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id, + + 'U_PROGRESS_BAR' => $this->u_action . '&action=progress_bar', + 'UA_PROGRESS_BAR' => str_replace('&', '&', $this->u_action) . '&action=progress_bar') ); } @@ -779,12 +833,12 @@ class acp_forums // 16 = show active topics // 32 = enable post review $forum_data['forum_flags'] = 0; - $forum_data['forum_flags'] += ($forum_data['forum_link_track']) ? 1 : 0; - $forum_data['forum_flags'] += ($forum_data['prune_old_polls']) ? 2 : 0; - $forum_data['forum_flags'] += ($forum_data['prune_announce']) ? 4 : 0; - $forum_data['forum_flags'] += ($forum_data['prune_sticky']) ? 8 : 0; - $forum_data['forum_flags'] += ($forum_data['show_active']) ? 16 : 0; - $forum_data['forum_flags'] += ($forum_data['enable_post_review']) ? 32 : 0; + $forum_data['forum_flags'] += ($forum_data['forum_link_track']) ? FORUM_FLAG_LINK_TRACK : 0; + $forum_data['forum_flags'] += ($forum_data['prune_old_polls']) ? FORUM_FLAG_PRUNE_POLL : 0; + $forum_data['forum_flags'] += ($forum_data['prune_announce']) ? FORUM_FLAG_PRUNE_ANNOUNCE : 0; + $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; // Unset data that are not database fields $forum_data_sql = $forum_data; @@ -821,7 +875,7 @@ class acp_forums if (!$row) { - trigger_error($user->lang['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&' . $this->parent_id)); + trigger_error($user->lang['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&' . $this->parent_id), E_USER_WARNING); } $sql = 'UPDATE ' . FORUMS_TABLE . ' @@ -885,7 +939,8 @@ class acp_forums return array($user->lang['NO_FORUM_ACTION']); } - $forum_data_sql['forum_posts'] = $forum_data_sql['forum_topics'] = $forum_data_sql['forum_topics_real'] = 0; + $forum_data_sql['forum_posts'] = $forum_data_sql['forum_topics'] = $forum_data_sql['forum_topics_real'] = $forum_data_sql['forum_last_post_id'] = $forum_data_sql['forum_last_poster_id'] = $forum_data_sql['forum_last_post_time'] = 0; + $forum_data_sql['forum_last_poster_name'] = $forum_data_sql['forum_last_poster_colour'] = ''; } if (sizeof($errors)) @@ -1018,7 +1073,7 @@ class acp_forums { global $db; - $table_ary = array(ACL_GROUPS_TABLE, ACL_USERS_TABLE, LOG_TABLE, POSTS_TABLE, TOPICS_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE); + $table_ary = array(LOG_TABLE, POSTS_TABLE, TOPICS_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE); foreach ($table_ary as $table) { @@ -1121,6 +1176,14 @@ class acp_forums $sql = 'DELETE FROM ' . FORUMS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $forum_ids); $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids); + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_USERS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids); + $db->sql_query($sql); } else if ($action_subforums == 'move') { @@ -1167,6 +1230,14 @@ class acp_forums $sql = 'DELETE FROM ' . FORUMS_TABLE . " WHERE forum_id = $forum_id"; $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . " + WHERE forum_id = $forum_id"; + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_USERS_TABLE . " + WHERE forum_id = $forum_id"; + $db->sql_query($sql); } } @@ -1181,6 +1252,14 @@ class acp_forums $sql = 'DELETE FROM ' . FORUMS_TABLE . " WHERE forum_id = $forum_id"; $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . " + WHERE forum_id = $forum_id"; + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_USERS_TABLE . " + WHERE forum_id = $forum_id"; + $db->sql_query($sql); } // Resync tree @@ -1290,7 +1369,21 @@ class acp_forums delete_attachments('topic', $topic_ids, false); - switch (SQL_LAYER) + // Before we remove anything we make sure we are able to adjust the post counts later. ;) + $sql = 'SELECT poster_id + FROM ' . POSTS_TABLE . ' + WHERE forum_id = ' . $forum_id . ' + AND post_postcount = 1'; + $result = $db->sql_query($sql); + + $post_counts = array(); + while ($row = $db->sql_fetchrow($result)) + { + $post_counts[$row['poster_id']] = (!empty($post_counts[$row['poster_id']])) ? $post_counts[$row['poster_id']] + 1 : 1; + } + $db->sql_freeresult($result); + + switch ($db->sql_layer) { case 'mysql4': case 'mysqli': @@ -1365,18 +1458,18 @@ class acp_forums foreach ($tables as $table) { - $db->sql_query("DELETE FROM $table WHERE " . $db->sql_in_set($field, $id_list)); + $db->sql_query("DELETE FROM $table WHERE " . $db->sql_in_set($field, $ids)); } } } while ($row); } - unset($ids, $id_list); + unset($ids); break; } - $table_ary = array(ACL_GROUPS_TABLE, ACL_USERS_TABLE, FORUMS_ACCESS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, LOG_TABLE, MODERATOR_CACHE_TABLE, POSTS_TABLE, TOPICS_TABLE, TOPICS_TRACK_TABLE); + $table_ary = array(FORUMS_ACCESS_TABLE, FORUMS_TRACK_TABLE, FORUMS_WATCH_TABLE, LOG_TABLE, MODERATOR_CACHE_TABLE, POSTS_TABLE, TOPICS_TABLE, TOPICS_TRACK_TABLE); foreach ($table_ary as $table) { @@ -1391,6 +1484,18 @@ class acp_forums $db->sql_query("UPDATE $table SET forum_id = 0 WHERE forum_id = $forum_id"); } + // Adjust users post counts + if (sizeof($post_counts)) + { + foreach ($post_counts as $poster_id => $substract) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_posts = user_posts - ' . $substract . ' + WHERE user_id = ' . $poster_id; + $db->sql_query($sql); + } + } + $db->sql_transaction('commit'); // Make sure the overall post/topic count is correct... @@ -1513,6 +1618,27 @@ class acp_forums return $target['forum_name']; } + + /** + * Display progress bar for syncinc forums + */ + function display_progress_bar($start, $total) + { + global $template, $user; + + adm_page_header($user->lang['SYNC_IN_PROGRESS']); + + $template->set_filenames(array( + 'body' => 'progress_bar.html') + ); + + $template->assign_vars(array( + 'L_PROGRESS' => $user->lang['SYNC_IN_PROGRESS'], + 'L_PROGRESS_EXPLAIN' => ($start && $total) ? sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], $start, $total) : $user->lang['SYNC_IN_PROGRESS']) + ); + + adm_page_footer(); + } } ?>
\ No newline at end of file diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 9f7e68bfe5..9df1c52d65 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -30,7 +30,7 @@ class acp_groups $action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addusers'])) ? 'addusers' : request_var('action', '')); $group_id = request_var('g', 0); $mark_ary = request_var('mark', array(0)); - $name_ary = request_var('usernames', ''); + $name_ary = request_var('usernames', '', true); $leader = request_var('leader', 0); $default = request_var('default', 0); $start = request_var('start', 0); @@ -52,7 +52,7 @@ class acp_groups if (!$group_row) { - trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); } } @@ -64,11 +64,11 @@ class acp_groups case 'promote': if (!$group_id) { - trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); } // Approve, demote or promote - group_user_attributes($action, $group_id, $mark_ary, false, ($group_id) ? $group_row['group_name'] : false); + group_user_attributes($action, $group_id, $mark_ary, false, $group_row['group_name']); switch ($action) { @@ -85,13 +85,15 @@ class acp_groups break; } + group_update_listings($group_id); + trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); break; case 'default': if (!$group_id) { - trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); } if (confirm_box(true)) @@ -134,6 +136,8 @@ class acp_groups group_user_attributes('default', $group_id, $mark_ary, false, $group_row['group_name'], $group_row); } + group_update_listings($group_id); + trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); } else @@ -155,7 +159,7 @@ class acp_groups { if (!$group_id) { - trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); } $error = ''; @@ -165,7 +169,7 @@ class acp_groups case 'delete': if (!$auth->acl_get('a_groupdel')) { - trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); } $error = group_delete($group_id, $group_row['group_name']); @@ -180,7 +184,7 @@ class acp_groups if ($error) { - trigger_error($user->lang[$error] . adm_back_link($back_link)); + trigger_error($user->lang[$error] . adm_back_link($back_link), E_USER_WARNING); } $message = ($action == 'delete') ? 'GROUP_DELETED' : 'GROUP_USERS_REMOVE'; @@ -201,12 +205,12 @@ class acp_groups case 'addusers': if (!$group_id) { - trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); } if (!$name_ary) { - trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); + trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); } $name_ary = array_unique(explode("\n", $name_ary)); @@ -214,10 +218,10 @@ class acp_groups // Add user/s to group if ($error = group_user_add($group_id, false, $name_ary, $group_row['group_name'], $default, $leader, 0, $group_row)) { - trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); + trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING); } - $message = ($action == 'addleaders') ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED'; + $message = ($leader) ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED'; trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); break; @@ -228,12 +232,12 @@ class acp_groups if ($action == 'edit' && !$group_id) { - trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); } if ($action == 'add' && !$auth->acl_get('a_groupadd')) { - trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); } $error = array(); @@ -313,7 +317,7 @@ class acp_groups { if (isset($group_row['group_avatar']) && $group_row['group_avatar']) { - avatar_delete($group_row['group_avatar']); + avatar_delete('group', $group_row); } } @@ -364,24 +368,7 @@ class acp_groups $db->sql_freeresult($result); // Now insert the data - if (sizeof($groups_sql_ary)) - { - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $groups_sql_ary)); - break; - - default: - foreach ($groups_sql_ary as $ary) - { - $db->sql_query('INSERT INTO ' . ACL_GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; - } - } + $db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary); $auth->acl_clear_prefetch(); } @@ -542,7 +529,7 @@ class acp_groups if (!$group_id) { - trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); } $this->page_title = 'GROUP_MEMBERS'; @@ -614,6 +601,7 @@ class acp_groups 'U_ACTION' => $this->u_action . "&g=$group_id", 'U_BACK' => $this->u_action, 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=list&field=usernames'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=list&field=usernames', false), 'U_DEFAULT_ALL' => "{$this->u_action}&action=default&g=$group_id") ); diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index 66aec3a90d..4636b067c2 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -60,7 +60,7 @@ class acp_icons if ($action == 'edit' || $action == 'add' || $action == 'import') { $imglist = filelist($phpbb_root_path . $img_path, ''); - + foreach ($imglist as $path => $img_ary) { foreach ($img_ary as $img) @@ -108,6 +108,7 @@ class acp_icons ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC'); $result = $db->sql_query($sql); + $data = array(); while ($row = $db->sql_fetchrow($result)) { if ($action == 'add') @@ -135,14 +136,13 @@ class acp_icons } $after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url']; - $order_list = '<option value="' . ($row[$fields . '_order']) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -> ' . htmlspecialchars($after_txt)) . '</option>' . $order_list; + $order_list = '<option value="' . ($row[$fields . '_order'] + 1) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -> ' . htmlspecialchars($after_txt)) . '</option>' . $order_list; } } $db->sql_freeresult($result); $order_list = '<option value="1"' . ((!isset($after)) ? ' selected="selected"' : '') . '>' . $user->lang['FIRST'] . '</option>' . $order_list; - $data = array(); if ($action == 'add') { $data = $_images; @@ -242,11 +242,32 @@ class acp_icons ); } + // Image_order holds the 'new' order value if (!empty($image_order[$image])) { $img_sql = array_merge($img_sql, array( - $fields . '_order' => $image_order[$image] . '.5') + $fields . '_order' => $image_order[$image]) ); + + // Since we always add 'after' an item, we just need to increase all following + the current by one + $sql = "UPDATE $table + SET {$fields}_order = {$fields}_order + 1 + WHERE {$fields}_order >= {$image_order[$image]}"; + $db->sql_query($sql); + + // If we adjust the order, we need to adjust all other orders too - they became inaccurate... + foreach ($image_order as $_image => $_order) + { + if ($_image == $image) + { + continue; + } + + if ($_order >= $image_order[$image]) + { + $image_order[$_image]++; + } + } } if ($action == 'modify') @@ -261,45 +282,6 @@ class acp_icons $sql = "INSERT INTO $table " . $db->sql_build_array('INSERT', $img_sql); $db->sql_query($sql); } - - $update = false; - - if ($action == 'modify' && !empty($image_order[$image])) - { - $update = true; - - $sql = "SELECT {$fields}_order - FROM $table - WHERE {$fields}_id = " . $image_id[$image]; - $result = $db->sql_query($sql); - $order_old = (int) $db->sql_fetchfield($fields . '_order'); - $db->sql_freeresult($result); - - if ($order_old == $image_order[$image]) - { - $update = false; - } - - if ($order_old > $image_order[$image]) - { - $sign = '+'; - $where = $fields . '_order >= ' . $image_order[$image] . " AND {$fields}_order < $order_old"; - } - else if ($order_old < $image_order[$image]) - { - $sign = '-'; - $where = "{$fields}_order > $order_old AND {$fields}_order < " . $image_order[$image]; - $sql[$fields . '_order'] = $image_order[$image] - 1; - } - } - - if ($update) - { - $sql = "UPDATE $table - SET {$fields}_order = {$fields}_order $sign 1 - WHERE $where"; - $db->sql_query($sql); - } } } @@ -329,7 +311,7 @@ class acp_icons // The user has already selected a smilies_pak file if ($current == 'delete') { - $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . $table); + $db->sql_query((($db->sql_layer != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . $table); switch ($mode) { @@ -363,7 +345,7 @@ class acp_icons if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak))) { - trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action)); + trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action), E_USER_WARNING); } foreach ($pak_ary as $pak_entry) @@ -374,7 +356,7 @@ class acp_icons if ((sizeof($data[1]) != 4 && $mode == 'icons') || (sizeof($data[1]) != 6 && $mode == 'smilies')) { - trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action)); + trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING); } // Stripslash here because it got addslashed before... (on export) @@ -523,7 +505,7 @@ class acp_icons } else { - trigger_error($user->lang['NO_' . strtoupper($fields) . '_EXPORT'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_' . strtoupper($fields) . '_EXPORT'] . adm_back_link($this->u_action), E_USER_WARNING); } break; @@ -562,14 +544,40 @@ class acp_icons case 'move_up': case 'move_down': - $image_order = request_var('order', 0); - $order_total = $image_order * 2 + (($action == 'move_up') ? -1 : 1); + // Get current order id... + $sql = "SELECT {$fields}_order as current_order + FROM $table + WHERE {$fields}_id = $icon_id"; + $result = $db->sql_query($sql); + $current_order = (int) $db->sql_fetchfield('current_order'); + $db->sql_freeresult($result); + + if ($current_order == 0 && $action == 'move_up') + { + break; + } + + // on move_down, switch position with next order_id... + // on move_up, switch position with previous order_id... + $switch_order_id = ($action == 'move_down') ? $current_order + 1 : $current_order - 1; - $sql = 'UPDATE ' . $table . ' - SET ' . $fields . "_order = $order_total - " . $fields . '_order - WHERE ' . $fields . "_order IN ($image_order, " . (($action == 'move_up') ? $image_order - 1 : $image_order + 1) . ')'; + // + $sql = "UPDATE $table + SET {$fields}_order = $current_order + WHERE {$fields}_order = $switch_order_id + AND {$fields}_id <> $icon_id"; $db->sql_query($sql); + // Only update the other entry too if the previous entry got updated + if ($db->sql_affectedrows()) + { + $sql = "UPDATE $table + SET {$fields}_order = $switch_order_id + WHERE {$fields}_order = $current_order + AND {$fields}_id = $icon_id"; + $db->sql_query($sql); + } + $cache->destroy('icons'); $cache->destroy('sql', $table); @@ -640,8 +648,8 @@ class acp_icons 'EMOTION' => (isset($row['emotion'])) ? $row['emotion'] : '', 'U_EDIT' => $this->u_action . '&action=edit&id=' . $row[$fields . '_id'], 'U_DELETE' => $this->u_action . '&action=delete&id=' . $row[$fields . '_id'], - 'U_MOVE_UP' => $this->u_action . '&action=move_up&order=' . $row[$fields . '_order'], - 'U_MOVE_DOWN' => $this->u_action . '&action=move_down&order=' . $row[$fields . '_order']) + 'U_MOVE_UP' => $this->u_action . '&action=move_up&id=' . $row[$fields . '_id'], + 'U_MOVE_DOWN' => $this->u_action . '&action=move_down&id=' . $row[$fields . '_id']) ); if (!$spacer && !$row['display_on_posting']) diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php new file mode 100755 index 0000000000..2834d25181 --- /dev/null +++ b/phpBB/includes/acp/acp_inactive.php @@ -0,0 +1,184 @@ +<?php +/** +* +* @package acp +* @version $Id$ +* @copyright (c) 2006 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* @package acp +*/ +class acp_inactive +{ + var $u_action; + var $p_master; + + function acp_inactive(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($id, $mode) + { + global $config, $db, $user, $auth, $template; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; + + $user->add_lang('memberlist'); + + $action = request_var('action', ''); + $mark = (isset($_REQUEST['mark'])) ? request_var('mark', array(0)) : array(); + $start = request_var('start', 0); + + // Sort keys + $sort_days = request_var('st', 0); + $sort_key = request_var('sk', 'i'); + $sort_dir = request_var('sd', 'd'); + + if (sizeof($mark)) + { + switch ($action) + { + case 'activate': + case 'delete': + $sql = 'SELECT username + 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)) + { + $user_affected[] = $row['username']; + } + $db->sql_freeresult($result); + + if ($action == 'activate') + { + include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); + user_active_flip('activate', $mark); + } + else if ($action == 'delete') + { + if (!$auth->acl_get('a_userdel')) + { + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql = 'DELETE FROM ' . USER_GROUP_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark); + $db->sql_query($sql); + $sql = 'DELETE FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark); + $db->sql_query($sql); + + add_log('admin', 'LOG_INACTIVE_' . strtoupper($action), implode(', ', $user_affected)); + } + + break; + + case 'remind': + if (empty($config['email_enable'])) + { + trigger_error($user->lang['EMAIL_DISABLED'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type, user_regdate, user_actkey + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $mark); + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + // Send the messages + include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); + + $messenger = new messenger(); + + $board_url = generate_board_url() . "/ucp.$phpEx?mode=activate"; + + $usernames = array(); + do + { + $messenger->template('user_remind_inactive', $row['user_lang']); + + $messenger->replyto($config['board_email']); + $messenger->to($row['user_email'], $row['username']); + $messenger->im($row['user_jabber'], $row['username']); + + $messenger->assign_vars(array( + 'USERNAME' => htmlspecialchars_decode($row['username']), + 'REGISTER_DATE' => $user->format_date($row['user_regdate']), + 'U_ACTIVATE' => "$board_url&mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey']) + ); + + $messenger->send($row['user_notify_type']); + + $usernames[] = $row['username']; + } + while ($row = $db->sql_fetchrow($result)); + + $messenger->save_queue(); + + add_log('admin', 'LOG_INACTIVE_REMIND', implode(', ', $usernames)); + unset($usernames); + } + $db->sql_freeresult($result); + + 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'); + + $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'); + + $inactive = array(); + $inactive_count = 0; + + view_inactive_users($inactive, $inactive_count, $config['topics_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']), + '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&mode=overview&u={$row['user_id']}")) + ); + } + + $option_ary = array('activate' => 'ACTIVATE', 'delete' => 'DELETE'); + if ($config['email_enable']) + { + $option_ary += array('remind' => 'REMIND'); + } + + $template->assign_vars(array( + 'S_INACTIVE_USERS' => true, + 'S_INACTIVE_OPTIONS' => build_select($option_ary), + + '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 . "&$u_sort_param", $inactive_count, $config['topics_per_page'], $start, true), + )); + + $this->tpl_name = 'acp_inactive'; + $this->page_title = 'ACP_INACTIVE_USERS'; + } +} + +?>
\ No newline at end of file diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php index 7c7e4586e0..afb2ba329a 100644 --- a/phpBB/includes/acp/acp_jabber.php +++ b/phpBB/includes/acp/acp_jabber.php @@ -44,16 +44,9 @@ class acp_jabber $jab_resource = request_var('jab_resource', $config['jab_resource']); $jab_package_size = request_var('jab_package_size', $config['jab_package_size']); - $jabber = new jabber(); + $jabber = new jabber($jab_host, $jab_port, $jab_username, $jab_password, $jab_resource); $error = array(); - // Setup the basis vars for jabber connection - $jabber->server = $jab_host; - $jabber->port = ($jab_port) ? $jab_port : 5222; - $jabber->username = $jab_username; - $jabber->password = $jab_password; - $jabber->resource = $jab_resource; - $message = $user->lang['JAB_SETTINGS_CHANGED']; $log = 'JAB_SETTINGS_CHANGED'; @@ -65,7 +58,7 @@ class acp_jabber { if (!$jabber->connect()) { - trigger_error($user->lang['ERR_JAB_CONNECT'] . adm_back_link($this->u_action)); + trigger_error($user->lang['ERR_JAB_CONNECT'] . adm_back_link($this->u_action), E_USER_WARNING); } // First we'll try to authorise using this account, if that fails we'll try to create it. @@ -94,12 +87,12 @@ class acp_jabber { if (!$jabber->connect()) { - trigger_error($user->lang['ERR_JAB_CONNECT'] . adm_back_link($this->u_action)); + trigger_error($user->lang['ERR_JAB_CONNECT'] . adm_back_link($this->u_action), E_USER_WARNING); } if (!$jabber->send_auth()) { - trigger_error($user->lang['ERR_JAB_AUTH'] . adm_back_link($this->u_action)); + trigger_error($user->lang['ERR_JAB_AUTH'] . adm_back_link($this->u_action), E_USER_WARNING); } $jabber->send_presence(NULL, NULL, 'online'); diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 29aabe240f..61310cff01 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -47,8 +47,10 @@ class acp_language $missing_file = request_var('missing_file', array('' => 0)); list($_REQUEST['language_file'], ) = array_keys($missing_file); } - - list($this->language_directory, $this->language_file) = explode('|', request_var('language_file', '|common.' . $phpEx)); + + $selected_lang_file = request_var('language_file', '|common.' . $phpEx); + + list($this->language_directory, $this->language_file) = explode('|', $selected_lang_file); $this->language_directory = basename($this->language_directory); $this->language_file = basename($this->language_file); @@ -76,7 +78,8 @@ class acp_language break; default: - trigger_error($user->lang['INVALID_UPLOAD_METHOD']); + trigger_error($user->lang['INVALID_UPLOAD_METHOD'], E_USER_ERROR); + break; } $test_connection = $transfer->open_session(); @@ -124,7 +127,7 @@ class acp_language if (!$lang_id) { - trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'SELECT * @@ -153,14 +156,14 @@ class acp_language case 'download_file': case 'upload_data': - if (!$lang_id || !isset($_POST['entry']) || !is_array($_POST['entry'])) + if (!$lang_id || empty($_POST['entry'])) { - trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING); } if (!$this->language_file || (!$this->language_directory && !in_array($this->language_file, $this->main_files))) { - trigger_error($user->lang['NO_FILE_SELECTED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_FILE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'SELECT * @@ -187,7 +190,7 @@ class acp_language { if (!@mkdir($dir, 0777)) { - trigger_error("Could not create directory $dir"); + trigger_error("Could not create directory $dir", E_USER_ERROR); } @chmod($dir, 0777); } @@ -200,7 +203,7 @@ class acp_language if (!$fp) { - trigger_error($user->lang['UNABLE_TO_WRITE_FILE']); + trigger_error(sprintf($user->lang['UNABLE_TO_WRITE_FILE'], $filename) . adm_back_link($this->u_action . '&id=' . $lang_id . '&language_file=' . urlencode($selected_lang_file)), E_USER_WARNING); } if ($this->language_directory == 'email') @@ -284,6 +287,8 @@ class acp_language $file = request_var('file', ''); $dir = request_var('dir', ''); + $selected_lang_file = $dir . '|' . $file; + $old_file = '/' . $this->get_filename($row['lang_iso'], $dir, $file, false, true); $lang_path = 'language/' . $row['lang_iso'] . '/' . (($dir) ? $dir . '/' : ''); @@ -301,12 +306,13 @@ class acp_language break; default: - trigger_error($user->lang['INVALID_UPLOAD_METHOD']); + trigger_error($user->lang['INVALID_UPLOAD_METHOD'], E_USER_ERROR); + break; } if (($result = $transfer->open_session()) !== true) { - trigger_error($user->lang[$result] . adm_back_link($this->u_action)); + trigger_error($user->lang[$result] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id . '&language_file=' . urlencode($selected_lang_file)), E_USER_WARNING); } $transfer->rename($lang_path . $file, $lang_path . $file . '.bak'); @@ -318,7 +324,7 @@ class acp_language add_log('admin', 'LOG_LANGUAGE_FILE_REPLACED', $file); - trigger_error($user->lang['UPLOAD_COMPLETED']); + trigger_error($user->lang['UPLOAD_COMPLETED'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id . '&language_file=' . urlencode($selected_lang_file))); } $action = 'details'; @@ -329,7 +335,7 @@ class acp_language if (!$lang_id) { - trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING); } $this->page_title = 'LANGUAGE_PACK_DETAILS'; @@ -362,28 +368,28 @@ class acp_language case 'email': if (!in_array($this->language_file, $email_files)) { - trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id)); + trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); } break; case 'acp': if (!in_array($this->language_file, $acp_files)) { - trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id)); + trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); } break; case 'mods': if (!in_array($this->language_file, $mods_files)) { - trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id)); + trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); } break; default: if (!in_array($this->language_file, $this->main_files)) { - trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id)); + trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); } } @@ -491,7 +497,7 @@ class acp_language 'S_MISSING_FILES' => true, 'L_MISSING_FILES' => sprintf($user->lang['THOSE_MISSING_LANG_FILES'], $lang_entries['lang_local_name']), 'MISSING_FILES' => implode('<br />', $missing_files)) - ); + ); } if ($is_missing_var) @@ -500,7 +506,7 @@ class acp_language 'S_MISSING_VARS' => true, 'L_MISSING_VARS_EXPLAIN' => sprintf($user->lang['THOSE_MISSING_LANG_VARIABLES'], $lang_entries['lang_local_name']), 'U_MISSING_ACTION' => $this->u_action . "&action=$action&id=$lang_id") - ); + ); foreach ($missing_vars as $file => $vars) { @@ -532,7 +538,7 @@ class acp_language $selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : ''; $s_lang_options .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>'; } - + // Help Files $s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang['HELP_FILES'] . '</option>'; foreach ($this->main_files as $file) @@ -559,7 +565,7 @@ class acp_language } $s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang[strtoupper($check) . '_FILES'] . '</option>'; - + foreach (${$check . '_files'} as $file) { $prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, $check, $file, true, true))) ? '* ' : ''; @@ -599,6 +605,7 @@ class acp_language unset($help); } } + $print_message = (($this->language_directory) ? $this->language_directory . '/' : '') . $this->language_file; } @@ -611,7 +618,7 @@ class acp_language 'PRINT_MESSAGE' => $print_message, ) ); - + if (!$is_email_file) { $method = ($is_help_file) ? 'print_help_entries' : 'print_language_entries'; @@ -622,7 +629,7 @@ class acp_language { $tpl .= $this->$method($missing_vars[$name], '* '); } - + $tpl .= $this->$method($lang); $template->assign_var('TPL', $tpl); @@ -633,20 +640,21 @@ class acp_language $template->assign_vars(array( 'LANG' => $lang) ); + unset($lang); } return; - + break; case 'delete': - + if (!$lang_id) { - trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING); } - + $sql = 'SELECT * FROM ' . LANG_TABLE . ' WHERE lang_id = ' . $lang_id; @@ -656,18 +664,18 @@ class acp_language if ($row['lang_iso'] == $config['default_lang']) { - trigger_error($user->lang['NO_REMOVE_DEFAULT_LANG'] . adm_back_link($this->u_action)); + 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); $sql = 'UPDATE ' . USERS_TABLE . " - SET user_lang = '{$config['default_lang']}' - WHERE user_lang = '{$row['lang_iso']}'"; + SET user_lang = '" . $db->sql_escape($config['default_lang']) . "' + WHERE user_lang = '" . $db->sql_escape($row['lang_iso']) . "'"; $db->sql_query($sql); - + 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)); break; @@ -677,7 +685,7 @@ class acp_language if (!$lang_iso || !file_exists("{$phpbb_root_path}language/$lang_iso/iso.txt")) { - trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action)); + trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING); } $file = file("{$phpbb_root_path}language/$lang_iso/iso.txt"); @@ -685,8 +693,8 @@ class acp_language $lang_pack = array( 'iso' => $lang_iso, 'name' => trim(htmlspecialchars($file[0])), - 'local_name'=> trim(htmlspecialchars($file[1])), - 'author' => trim(htmlspecialchars($file[2])) + 'local_name'=> trim(htmlspecialchars($file[1], ENT_COMPAT, 'UTF-8')), + 'author' => trim(htmlspecialchars($file[2], ENT_COMPAT, 'UTF-8')) ); unset($file); @@ -694,18 +702,19 @@ class acp_language FROM ' . LANG_TABLE . " WHERE lang_iso = '" . $db->sql_escape($lang_iso) . "'"; $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if ($row = $db->sql_fetchrow($result)) + if ($row) { - trigger_error($user->lang['LANGUAGE_PACK_ALREADY_INSTALLED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['LANGUAGE_PACK_ALREADY_INSTALLED'] . adm_back_link($this->u_action), E_USER_WARNING); } - $db->sql_freeresult($result); if (!$lang_pack['name'] || !$lang_pack['local_name']) { - trigger_error($user->lang['INVALID_LANGUAGE_PACK'] . adm_back_link($this->u_action)); + trigger_error($user->lang['INVALID_LANGUAGE_PACK'] . adm_back_link($this->u_action), E_USER_WARNING); } - + // Add language pack $sql_ary = array( 'lang_iso' => $lang_pack['iso'], @@ -716,18 +725,18 @@ class acp_language ); $db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); - + add_log('admin', 'LOG_LANGUAGE_PACK_INSTALLED', $lang_pack['name']); - + trigger_error(sprintf($user->lang['LANGUAGE_PACK_INSTALLED'], $lang_pack['name']) . adm_back_link($this->u_action)); break; case 'download': - + if (!$lang_id) { - trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'SELECT * @@ -747,7 +756,7 @@ class acp_language { continue; } - + $methods[] = $type; } @@ -768,7 +777,7 @@ class acp_language 'U_ACTION' => $this->u_action . "&action=$action&id=$lang_id", 'RADIO_BUTTONS' => $radio_buttons) ); - + return; } @@ -820,9 +829,9 @@ class acp_language $this->add_to_archive($compress, $mod_files, $row['lang_iso'], 'mods'); // Write ISO File - $iso_src = html_entity_decode($row['lang_english_name']) . "\n"; - $iso_src .= html_entity_decode($row['lang_local_name']) . "\n"; - $iso_src .= html_entity_decode($row['lang_author']); + $iso_src = htmlspecialchars_decode($row['lang_english_name']) . "\n"; + $iso_src .= htmlspecialchars_decode($row['lang_local_name']) . "\n"; + $iso_src .= htmlspecialchars_decode($row['lang_author']); $compress->add_data($iso_src, 'language/' . $row['lang_iso'] . '/iso.txt'); // index.html files @@ -838,7 +847,7 @@ class acp_language $compress->close(); $compress->download('lang_' . $row['lang_iso']); - @unlink($phpbb_root_path . 'store/lang_' . $row['lang_iso'] . '.' . $use_method); + @unlink($phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method); exit; @@ -870,18 +879,16 @@ class acp_language $tagstyle = ($row['lang_iso'] == $config['default_lang']) ? '*' : ''; $template->assign_block_vars('lang', array( - 'U_DETAILS' => $this->u_action . "&action=details&id={$row['lang_id']}", - 'U_DOWNLOAD' => $this->u_action . "&action=download&id={$row['lang_id']}", - 'U_DELETE' => $this->u_action . "&action=delete&id={$row['lang_id']}", - - 'ENGLISH_NAME' => $row['lang_english_name'], - 'TAG' => $tagstyle, - 'LOCAL_NAME' => $row['lang_local_name'], - 'ISO' => $row['lang_iso'], - 'USED_BY' => (isset($lang_count[$row['lang_iso']])) ? $lang_count[$row['lang_iso']] : 0, - - ) - ); + 'U_DETAILS' => $this->u_action . "&action=details&id={$row['lang_id']}", + 'U_DOWNLOAD' => $this->u_action . "&action=download&id={$row['lang_id']}", + 'U_DELETE' => $this->u_action . "&action=delete&id={$row['lang_id']}", + + 'ENGLISH_NAME' => $row['lang_english_name'], + 'TAG' => $tagstyle, + 'LOCAL_NAME' => $row['lang_local_name'], + 'ISO' => $row['lang_iso'], + 'USED_BY' => (isset($lang_count[$row['lang_iso']])) ? $lang_count[$row['lang_iso']] : 0, + )); } $db->sql_freeresult($result); @@ -890,7 +897,7 @@ class acp_language while (($file = readdir($dp)) !== false) { - if ($file{0} != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt")) + if ($file[0] != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt")) { if (!in_array($file, $installed)) { @@ -917,14 +924,14 @@ class acp_language foreach ($new_ary as $iso => $lang_ary) { $template->assign_block_vars('notinst', array( - 'ISO' => $lang_ary['iso'], - 'LOCAL_NAME' => $lang_ary['local_name'], - 'NAME' => $lang_ary['name'], + 'ISO' => htmlspecialchars($lang_ary['iso']), + 'LOCAL_NAME' => htmlspecialchars($lang_ary['local_name'], ENT_COMPAT, 'UTF-8'), + 'NAME' => htmlspecialchars($lang_ary['name'], ENT_COMPAT, 'UTF-8'), 'U_INSTALL' => $this->u_action . '&action=install&iso=' . urlencode($lang_ary['iso'])) ); } } - + unset($new_ary); } @@ -942,7 +949,7 @@ class acp_language * {FILENAME} [{LANG_NAME}] * * @package language -* @copyright (c) 2005 phpBB Group +* @copyright (c) 2006 phpBB Group * @author {CHANGED} - {AUTHOR} * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -958,6 +965,8 @@ if (empty($lang) || !is_array($lang)) // 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 @@ -1032,7 +1041,7 @@ $lang = array_merge($lang, array( { $tpl .= ' <tr> - <td class="row3" colspan="2">' . $key_prefix . '<b>' . $key . '</b></td> + <td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td> </tr>'; foreach ($value as $_key => $_value) @@ -1041,23 +1050,23 @@ $lang = array_merge($lang, array( { $tpl .= ' <tr> - <td class="row3" colspan="2">' . $key_prefix . ' <b>' . $_key . '</b></td> + <td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . ' <b>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</b></td> </tr>'; foreach ($_value as $__key => $__value) { $tpl .= ' <tr> - <td class="row1" style="white-space: nowrap;">' . $key_prefix . '<b>' . $__key . '</b></td> + <td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($__key, ENT_COMPAT, 'UTF-8') . '</b></td> <td class="row2">'; if ($input_field) { - $tpl .= '<input type="text" name="entry[' . $key . '][' . $_key . '][' . $__key . ']" value="' . htmlspecialchars($__value) . '" size="50" />'; + $tpl .= '<input type="text" name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($__key, ENT_COMPAT, 'UTF-8') . ']" value="' . htmlspecialchars($__value, ENT_COMPAT, 'UTF-8') . '" size="50" />'; } else { - $tpl .= '<b>' . htmlspecialchars($__value) . '</b>'; + $tpl .= '<b>' . htmlspecialchars($__value, ENT_COMPAT, 'UTF-8') . '</b>'; } $tpl .= '</td> @@ -1068,16 +1077,16 @@ $lang = array_merge($lang, array( { $tpl .= ' <tr> - <td class="row1" style="white-space: nowrap;">' . $key_prefix . '<b>' . $_key . '</b></td> + <td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</b></td> <td class="row2">'; - + if ($input_field) { - $tpl .= '<input type="text" name="entry[' . $key . '][' . $_key . ']" value="' . htmlspecialchars($_value) . '" size="50" />'; + $tpl .= '<input type="text" name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . ']" value="' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '" size="50" />'; } else { - $tpl .= '<b>' . htmlspecialchars($_value) . '</b>'; + $tpl .= '<b>' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '</b>'; } $tpl .= '</td> @@ -1094,16 +1103,16 @@ $lang = array_merge($lang, array( { $tpl .= ' <tr> - <td class="row1" style="white-space: nowrap;">' . $key_prefix . '<b>' . $key . '</b></td> + <td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td> <td class="row2">'; if ($input_field) { - $tpl .= '<input type="text" name="entry[' . $key . ']" value="' . htmlspecialchars($value) . '" size="50" />'; + $tpl .= '<input type="text" name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . ']" value="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '" size="50" />'; } else { - $tpl .= '<b>' . htmlspecialchars($value) . '</b>'; + $tpl .= '<b>' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</b>'; } $tpl .= '</td> @@ -1127,23 +1136,23 @@ $lang = array_merge($lang, array( { $tpl .= ' <tr> - <td class="row3" colspan="2">' . $key_prefix . '<b>' . $key . '</b></td> + <td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td> </tr>'; foreach ($value as $_key => $_value) { $tpl .= ' <tr> - <td class="row1" style="width: 10%; white-space: nowrap;">' . $key_prefix . '<b>' . $_key . '</b></td> + <td class="row1" style="width: 10%; white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</b></td> <td class="row2">'; if ($text_field) { - $tpl .= '<textarea name="entry[' . $key . '][' . $_key . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($_value) . '</textarea>'; + $tpl .= '<textarea name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '][' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '</textarea>'; } else { - $tpl .= '<b>' . htmlspecialchars($_value) . '</b>'; + $tpl .= '<b>' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . '</b>'; } $tpl .= '</td> @@ -1159,23 +1168,23 @@ $lang = array_merge($lang, array( { $tpl .= ' <tr> - <td class="row1" style="width: 10%; white-space: nowrap;">' . $key_prefix . '<b>' . $key . '</b></td> + <td class="row1" style="width: 10%; white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<b>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</b></td> <td class="row2">'; if ($text_field) { - $tpl .= '<textarea name="entry[' . $key . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($value) . '</textarea>'; + $tpl .= '<textarea name="entry[' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . ']" cols="80" rows="5" style="width: 90%;">' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</textarea>'; } else { - $tpl .= '<b>' . htmlspecialchars($value) . '</b>'; + $tpl .= '<b>' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</b>'; } $tpl .= '</td> </tr>'; } } - + return $tpl; } diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index bab08bc0ff..a321057fa2 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -20,131 +20,43 @@ class acp_main global $config, $db, $user, $auth, $template; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; - $action = request_var('action', ''); - $mark = (isset($_REQUEST['mark'])) ? request_var('mark', array(0)) : array(); - - if (sizeof($mark)) + // Show restore permissions notice + if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) { - switch ($action) - { - case 'activate': - case 'delete': - - if (!$auth->acl_get('a_user')) - { - trigger_error($user->lang['NO_ADMIN']); - } - - $sql = 'SELECT username - 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)) - { - $user_affected[] = $row['username']; - } - $db->sql_freeresult($result); - - if ($action == 'activate') - { - include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); - - foreach ($mark as $user_id) - { - user_active_flip($user_id, USER_INACTIVE); - } - - set_config('num_users', $config['num_users'] + sizeof($mark), true); - - // Update latest username - update_last_username(); - } - else if ($action == 'delete') - { - if (!$auth->acl_get('a_userdel')) - { - trigger_error($user->lang['NO_ADMIN']); - } - - $sql = 'DELETE FROM ' . USER_GROUP_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark); - $db->sql_query($sql); - $sql = 'DELETE FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark); - $db->sql_query($sql); - - add_log('admin', 'LOG_INDEX_' . strtoupper($action), implode(', ', $user_affected)); - } - - break; - - case 'remind': - if (!$auth->acl_get('a_user')) - { - trigger_error($user->lang['NO_ADMIN']); - } - - if (empty($config['email_enable'])) - { - trigger_error($user->lang['EMAIL_DISABLED']); - } - - $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type, user_regdate, user_actkey - FROM ' . USERS_TABLE . ' - WHERE ' . $db->sql_in_set('user_id', $mark); - $result = $db->sql_query($sql); - - if ($row = $db->sql_fetchrow($result)) - { - // Send the messages - include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); - - $messenger = new messenger(); + $this->tpl_name = 'acp_main'; + $this->page_title = 'ACP_MAIN'; - $board_url = generate_board_url() . "/ucp.$phpEx?mode=activate"; - $sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); - - $usernames = array(); - do - { - $messenger->template('user_remind_inactive', $row['user_lang']); - - $messenger->replyto($config['board_email']); - $messenger->to($row['user_email'], $row['username']); - $messenger->im($row['user_jabber'], $row['username']); - - $messenger->assign_vars(array( - 'EMAIL_SIG' => $sig, - 'USERNAME' => html_entity_decode($row['username']), - 'SITENAME' => $config['sitename'], - 'REGISTER_DATE' => $user->format_date($row['user_regdate']), - - 'U_ACTIVATE' => "$board_url&mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey']) - ); - - $messenger->send($row['user_notify_type']); + $sql = 'SELECT user_id, username, user_colour + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . $user->data['user_perm_from']; + $result = $db->sql_query($sql); + $user_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - $usernames[] = $row['username']; - } - while ($row = $db->sql_fetchrow($result)); + $perm_from = '<strong' . (($user_row['user_colour']) ? ' style="color: #' . $user_row['user_colour'] . '">' : '>'); + $perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $user_row['user_id']) . '">' : ''; + $perm_from .= $user_row['username']; + $perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '</a>' : ''; + $perm_from .= '</strong>'; - $messenger->save_queue(); + $template->assign_vars(array( + 'S_RESTORE_PERMISSIONS' => true, + 'U_RESTORE_PERMISSIONS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm'), + 'PERM_FROM' => $perm_from, + 'L_PERMISSIONS_TRANSFERED_EXPLAIN' => sprintf($user->lang['PERMISSIONS_TRANSFERED_EXPLAIN'], $perm_from, append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm')), + )); - add_log('admin', 'LOG_INDEX_REMIND', implode(', ', $usernames)); - unset($usernames); - } - $db->sql_freeresult($result); - - break; - } + return; } + $action = request_var('action', ''); + switch ($action) { case 'online': if (!$auth->acl_get('a_board')) { - trigger_error($user->lang['NO_ADMIN']); + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); } set_config('record_online_users', 1, true); @@ -155,47 +67,47 @@ class acp_main case 'stats': if (!$auth->acl_get('a_board')) { - trigger_error($user->lang['NO_ADMIN']); + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'SELECT COUNT(post_id) AS stat FROM ' . POSTS_TABLE . ' WHERE post_approved = 1'; $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); + set_config('num_posts', (int) $row['stat'], true); $sql = 'SELECT COUNT(topic_id) AS stat FROM ' . TOPICS_TABLE . ' WHERE topic_approved = 1'; $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); + set_config('num_topics', (int) $row['stat'], true); $sql = 'SELECT COUNT(user_id) AS stat FROM ' . USERS_TABLE . ' WHERE user_type IN (' . USER_NORMAL . ',' . USER_FOUNDER . ')'; $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); + set_config('num_users', (int) $row['stat'], true); $sql = 'SELECT COUNT(attach_id) as stat - FROM ' . ATTACHMENTS_TABLE; + FROM ' . ATTACHMENTS_TABLE . ' + WHERE is_orphan = 0'; $result = $db->sql_query($sql); - set_config('num_files', (int) $db->sql_fetchfield('stat'), true); $db->sql_freeresult($result); $sql = 'SELECT SUM(filesize) as stat - FROM ' . ATTACHMENTS_TABLE; + FROM ' . ATTACHMENTS_TABLE . ' + WHERE is_orphan = 0'; $result = $db->sql_query($sql); - set_config('upload_dir_size', (int) $db->sql_fetchfield('stat'), true); $db->sql_freeresult($result); @@ -205,7 +117,7 @@ class acp_main case 'user': if (!$auth->acl_get('a_board')) { - trigger_error($user->lang['NO_ADMIN']); + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'SELECT COUNT(post_id) AS num_posts, poster_id @@ -227,7 +139,7 @@ class acp_main case 'date': if (!$auth->acl_get('a_board')) { - trigger_error($user->lang['NO_ADMIN']); + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); } set_config('board_startdate', time() - 1); @@ -235,7 +147,7 @@ class acp_main break; case 'db_track': - $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . TOPICS_POSTED_TABLE); + $db->sql_query((($db->sql_layer != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . TOPICS_POSTED_TABLE); // This can get really nasty... therefore we only do the last six months $get_from_time = time() - (6 * 4 * 7 * 24 * 60 * 60); @@ -290,24 +202,7 @@ class acp_main } unset($posted); - if (sizeof($sql_ary)) - { - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); - break; - - default: - foreach ($sql_ary as $ary) - { - $db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; - } - } + $db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary); } add_log('admin', 'LOG_RESYNC_POST_MARKING'); @@ -337,7 +232,7 @@ class acp_main { while (($file = readdir($avatar_dir)) !== false) { - if ($file{0} != '.' && $file != 'CVS' && strpos($file, 'index.') === false) + if ($file[0] != '.' && $file != 'CVS' && strpos($file, 'index.') === false) { $avatar_dir_size += filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file); } @@ -375,6 +270,21 @@ class acp_main $files_per_day = $total_files; } + if ($config['allow_attachments'] || $config['allow_pm_attach']) + { + $sql = 'SELECT COUNT(attach_id) AS total_orphan + FROM ' . ATTACHMENTS_TABLE . ' + WHERE is_orphan = 1 + AND filetime < ' . (time() - 3*60*60); + $result = $db->sql_query($sql); + $total_orphan = (int) $db->sql_fetchfield('total_orphan'); + $db->sql_freeresult($result); + } + else + { + $total_orphan = false; + } + $dbsize = get_database_size(); $s_action_options = build_select(array('online' => 'RESET_ONLINE', 'date' => 'RESET_DATE', 'stats' => 'RESYNC_STATS', 'user' => 'RESYNC_POSTCOUNTS', 'db_track' => 'RESYNC_POST_MARKING')); @@ -391,11 +301,14 @@ class acp_main 'AVATAR_DIR_SIZE' => $avatar_dir_size, 'DBSIZE' => $dbsize, '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'], 'DATABASE_INFO' => $db->sql_server_info(), 'U_ACTION' => append_sid("{$phpbb_admin_path}index.$phpEx"), 'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&mode=admin'), + 'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&mode=list'), 'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? $s_action_options : '', ) @@ -421,17 +334,18 @@ class acp_main if ($auth->acl_get('a_user')) { - $sql = 'SELECT user_id, username, user_regdate, user_lastvisit - FROM ' . USERS_TABLE . ' - WHERE user_type = ' . USER_INACTIVE . ' - ORDER BY user_regdate ASC'; - $result = $db->sql_query($sql); + $inactive = array(); + $inactive_count = 0; - while ($row = $db->sql_fetchrow($result)) + view_inactive_users($inactive, $inactive_count, 10); + + foreach ($inactive as $row) { $template->assign_block_vars('inactive', array( - 'DATE' => $user->format_date($row['user_regdate']), + 'INACTIVE_DATE' => $user->format_date($row['user_inactive_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&mode=overview&u={$row['user_id']}")) @@ -450,12 +364,6 @@ class acp_main ); } - // Display debug_extra notice - if (defined('DEBUG_EXTRA')) - { - $template->assign_var('S_DEBUG_EXTRA', true); - } - // Warn if install is still present if (file_exists($phpbb_root_path . 'install')) { diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index 7c72a1ca6b..1323c7aee4 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -24,6 +24,7 @@ class acp_modules { var $module_class = ''; + var $parent_id; var $u_action; function main($id, $mode) @@ -51,7 +52,7 @@ class acp_modules $this->page_title = strtoupper($this->module_class); - $parent_id = request_var('parent_id', 0); + $this->parent_id = request_var('parent_id', 0); $module_id = request_var('m', 0); $action = request_var('action', ''); $errors = array(); @@ -61,9 +62,9 @@ class acp_modules case 'delete': if (!$module_id) { - trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id)); + trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } - + if (confirm_box(true)) { $errors = $this->delete_module($module_id); @@ -71,7 +72,7 @@ class acp_modules if (!sizeof($errors)) { $this->remove_cache_file(); - trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id)); + trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); } } else @@ -79,7 +80,7 @@ class acp_modules confirm_box(false, 'DELETE_MODULE', build_hidden_fields(array( 'i' => $id, 'mode' => $mode, - 'parent_id' => $parent_id, + 'parent_id' => $this->parent_id, 'module_id' => $module_id, 'action' => $action, ))); @@ -91,9 +92,9 @@ class acp_modules case 'disable': if (!$module_id) { - trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id)); + trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } - + $sql = 'UPDATE ' . MODULES_TABLE . ' SET module_enabled = ' . (($action == 'enable') ? 1 : 0) . " WHERE module_id = $module_id"; @@ -108,7 +109,7 @@ class acp_modules case 'move_down': if (!$module_id) { - trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id)); + trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } $sql = 'SELECT * @@ -121,7 +122,7 @@ class acp_modules if (!$row) { - trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id)); + trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } $move_module_name = $this->move_module_by($row, $action, 1); @@ -156,7 +157,7 @@ class acp_modules 'module_basename' => $module_basename, 'module_enabled' => 0, 'module_display' => (isset($fileinfo['modes'][$module_mode]['display'])) ? $fileinfo['modes'][$module_mode]['display'] : 1, - 'parent_id' => $parent_id, + 'parent_id' => $this->parent_id, 'module_class' => $this->module_class, 'module_langname' => $fileinfo['modes'][$module_mode]['title'], 'module_mode' => $module_mode, @@ -169,7 +170,7 @@ class acp_modules { $this->remove_cache_file(); - trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id)); + trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); } } } @@ -178,7 +179,7 @@ class acp_modules confirm_box(false, 'ADD_MODULE', build_hidden_fields(array( 'i' => $id, 'mode' => $mode, - 'parent_id' => $parent_id, + 'parent_id' => $this->parent_id, 'action' => 'quickadd', 'quick_install' => $quick_install, ))); @@ -190,7 +191,7 @@ class acp_modules if (!$module_id) { - trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id)); + trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } $module_row = $this->get_module_row($module_id); @@ -228,7 +229,7 @@ class acp_modules { if (!$module_data['module_langname']) { - trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id)); + trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } $module_type = request_var('module_type', 'category'); @@ -257,7 +258,7 @@ class acp_modules { $this->remove_cache_file(); - trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&parent_id=' . $parent_id)); + trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); } } @@ -306,8 +307,8 @@ class acp_modules 'S_CAT_OPTIONS' => $s_cat_option . $this->make_module_select($module_data['parent_id'], ($action == 'edit') ? $module_row['module_id'] : false, false, false, false, true), 'S_MODULE_NAMES' => $s_name_options, 'S_MODULE_MODES' => $s_mode_options, - 'U_BACK' => $this->u_action . '&parent_id=' . $parent_id, - 'U_EDIT_ACTION' => $this->u_action . '&parent_id=' . $parent_id, + 'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id, + 'U_EDIT_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id, 'L_TITLE' => $user->lang[strtoupper($action) . '_MODULE'], @@ -341,7 +342,7 @@ class acp_modules ); } - if (!$parent_id) + if (!$this->parent_id) { $navigation = strtoupper($this->module_class); } @@ -349,12 +350,13 @@ class acp_modules { $navigation = '<a href="' . $this->u_action . '">' . strtoupper($this->module_class) . '</a>'; - $modules_nav = $this->get_module_branch($parent_id, 'parents', 'descending'); + $modules_nav = $this->get_module_branch($this->parent_id, 'parents', 'descending'); + foreach ($modules_nav as $row) { $langname = $this->lang_name($row['module_langname']); - if ($row['module_id'] == $parent_id) + if ($row['module_id'] == $this->parent_id) { $navigation .= ' -> ' . $langname; } @@ -366,11 +368,11 @@ class acp_modules } // Jumpbox - $module_box = $this->make_module_select($parent_id, false, false, false, false); + $module_box = $this->make_module_select($this->parent_id, false, false, false, false); $sql = 'SELECT * FROM ' . MODULES_TABLE . " - WHERE parent_id = $parent_id + WHERE parent_id = {$this->parent_id} AND module_class = '" . $db->sql_escape($this->module_class) . "' ORDER BY left_id"; $result = $db->sql_query($sql); @@ -390,14 +392,17 @@ class acp_modules $module_image = (!$row['module_basename'] || $row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" width="46" height="25" alt="' . $user->lang['CATEGORY'] . '" />' : '<img src="images/icon_folder.gif" width="46" height="25" alt="' . $user->lang['MODULE'] . '" />'; } - $url = $this->u_action . '&parent_id=' . $parent_id . '&m=' . $row['module_id']; - + $url = $this->u_action . '&parent_id=' . $this->parent_id . '&m=' . $row['module_id']; + $template->assign_block_vars('modules', array( 'MODULE_IMAGE' => $module_image, 'MODULE_TITLE' => $langname, 'MODULE_ENABLED' => ($row['module_enabled']) ? true : false, 'MODULE_DISPLAYED' => ($row['module_display']) ? true : false, + 'S_ACP_CAT_SYSTEM' => ($this->module_class == 'acp' && $row['module_langname'] == 'ACP_CAT_SYSTEM') ? true : false, + 'S_ACP_MODULE_MANAGEMENT' => ($this->module_class == 'acp' && ($row['module_basename'] == 'modules' || $row['module_langname'] == 'ACP_MODULE_MANAGEMENT')) ? true : false, + 'U_MODULE' => $this->u_action . '&parent_id=' . $row['module_id'], 'U_MOVE_UP' => $url . '&action=move_up', 'U_MOVE_DOWN' => $url . '&action=move_down', @@ -409,11 +414,11 @@ class acp_modules } while ($row = $db->sql_fetchrow($result)); } - else if ($parent_id) + else if ($this->parent_id) { - $row = $this->get_module_row($parent_id); + $row = $this->get_module_row($this->parent_id); - $url = $this->u_action . '&parent_id=' . $parent_id . '&m=' . $row['module_id']; + $url = $this->u_action . '&parent_id=' . $this->parent_id . '&m=' . $row['module_id']; $template->assign_vars(array( 'S_NO_MODULES' => true, @@ -449,11 +454,11 @@ class acp_modules } $template->assign_vars(array( - 'U_SEL_ACTION' => $this->u_action, - 'U_ACTION' => $this->u_action . '&parent_id=' . $parent_id, - 'NAVIGATION' => $navigation, - 'MODULE_BOX' => $module_box, - 'PARENT_ID' => $parent_id, + 'U_SEL_ACTION' => $this->u_action, + 'U_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id, + 'NAVIGATION' => $navigation, + 'MODULE_BOX' => $module_box, + 'PARENT_ID' => $this->parent_id, 'S_INSTALL_OPTIONS' => $s_install_options, ) ); @@ -476,7 +481,7 @@ class acp_modules if (!$row) { - trigger_error($user->lang['NO_MODULE']); + trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } return $row; @@ -721,7 +726,7 @@ class acp_modules return 'PARENT_NO_EXIST'; } - trigger_error($user->lang['PARENT_NO_EXIST']); + trigger_error($user->lang['PARENT_NO_EXIST'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } $sql = 'UPDATE ' . MODULES_TABLE . " @@ -1007,6 +1012,14 @@ class acp_modules return $this->lang_name($target['module_langname']); } + + /** + * Check if the module or her childs hold the management module(s) + */ + function is_management_module($module_id) + { + + } } ?>
\ No newline at end of file diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php index 2026aebaf0..004d9f55af 100644 --- a/phpBB/includes/acp/acp_permission_roles.php +++ b/phpBB/includes/acp/acp_permission_roles.php @@ -26,7 +26,7 @@ class acp_permission_roles $auth_admin = new auth_admin(); $user->add_lang('acp/permissions'); - $user->add_lang('acp/permissions_phpbb'); + add_permission_language(); $this->tpl_name = 'acp_permission_roles'; @@ -58,7 +58,8 @@ class acp_permission_roles break; default: - trigger_error('INVALID_MODE'); + trigger_error('NO_MODE', E_USER_ERROR); + break; } $template->assign_vars(array( @@ -75,7 +76,7 @@ class acp_permission_roles if (!$role_id) { - trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'SELECT * @@ -87,7 +88,7 @@ class acp_permission_roles if (!$role_row) { - trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); } if (confirm_box(true)) @@ -112,7 +113,7 @@ class acp_permission_roles case 'edit': if (!$role_id) { - trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); } // Get role we edit @@ -125,7 +126,7 @@ class acp_permission_roles if (!$role_row) { - trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); } // no break; @@ -138,22 +139,22 @@ class acp_permission_roles if (!$role_name) { - trigger_error($user->lang['NO_ROLE_NAME_SPECIFIED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_ROLE_NAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); } // if we add/edit a role we check the name to be unique among the settings... $sql = 'SELECT role_id FROM ' . ACL_ROLES_TABLE . " WHERE role_type = '" . $db->sql_escape($permission_type) . "' - AND LOWER(role_name) = '" . $db->sql_escape(strtolower($role_name)) . "'"; + AND role_name = '" . $db->sql_escape($role_name) . "'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); // Make sure we only print out the error if we add the role or change it's name - if ($row && ($mode == 'add' || ($mode == 'edit' && strtolower($role_row['role_name']) != strtolower($role_name)))) + if ($row && ($mode == 'add' || ($mode == 'edit' && $role_row['role_name'] != $role_name))) { - trigger_error(sprintf($user->lang['ROLE_NAME_ALREADY_EXIST'], $role_name) . adm_back_link($this->u_action)); + trigger_error(sprintf($user->lang['ROLE_NAME_ALREADY_EXIST'], $role_name) . adm_back_link($this->u_action), E_USER_WARNING); } $sql_ary = array( @@ -252,7 +253,7 @@ class acp_permission_roles { if (!$role_id) { - trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'SELECT * @@ -279,7 +280,7 @@ class acp_permission_roles if (!$role_row) { - trigger_error($user->lang['NO_PRESET_SELECTED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); } $template->assign_vars(array( diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index ee4b2a1ade..5354d70f72 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -27,7 +27,7 @@ class acp_permissions $auth_admin = new auth_admin(); $user->add_lang('acp/permissions'); - $user->add_lang('acp/permissions_phpbb'); + add_permission_language(); $this->tpl_name = 'acp_permissions'; @@ -47,7 +47,7 @@ class acp_permissions return; } - trigger_error('NO_MODE'); + trigger_error('NO_MODE', E_USER_ERROR); } // Set some vars @@ -59,8 +59,8 @@ class acp_permissions $subforum_id = request_var('subforum_id', 0); $forum_id = request_var('forum_id', array(0)); - $username = request_var('username', array('')); - $usernames = request_var('usernames', ''); + $username = request_var('username', array(''), true); + $usernames = request_var('usernames', '', true); $user_id = request_var('user_id', array(0)); $group_id = request_var('group_id', array(0)); @@ -70,7 +70,7 @@ class acp_permissions if ($select_all_groups) { // Add default groups to selection - $sql_and = (!$config['coppa_enable']) ? " AND group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : ''; + $sql_and = (!$config['coppa_enable']) ? " AND group_name <> 'REGISTERED_COPPA'" : ''; $sql = 'SELECT group_id FROM ' . GROUPS_TABLE . ' @@ -98,7 +98,7 @@ class acp_permissions if (!sizeof($user_id)) { - trigger_error($user->lang['SELECTED_USER_NOT_EXIST'] . adm_back_link($this->u_action)); + trigger_error($user->lang['SELECTED_USER_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING); } } unset($username); @@ -190,7 +190,8 @@ class acp_permissions break; default: - trigger_error('INVALID_MODE'); + trigger_error('NO_MODE', E_USER_ERROR); + break; } $template->assign_vars(array( @@ -203,7 +204,7 @@ class acp_permissions if (!in_array($permission_type, $this->permission_dropdown)) { - trigger_error($user->lang['WRONG_PERMISSION_TYPE'] . adm_back_link($this->u_action)); + trigger_error($user->lang['WRONG_PERMISSION_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING); } @@ -237,14 +238,14 @@ class acp_permissions } else { - trigger_error($user->lang['NO_USER_GROUP_SELECTED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_USER_GROUP_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); } break; case 'apply_permissions': if (!isset($_POST['setting'])) { - trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING); } $this->set_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id); @@ -253,7 +254,7 @@ class acp_permissions case 'apply_all_permissions': if (!isset($_POST['setting'])) { - trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING); } $this->set_all_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id); @@ -330,7 +331,8 @@ class acp_permissions $template->assign_vars(array( 'S_SELECT_USER' => true, - 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_victim&field=username')) + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_victim&field=username'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_victim&field=username', false)) ); break; @@ -392,17 +394,23 @@ class acp_permissions 'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'], 'S_DEFINED_GROUP_OPTIONS' => $items['group_ids_options'], 'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids']), - 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username')) + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username', false)) ); break; } + // The S_ALLOW_SELECT parameter below is a measure to lower memory usage. + // If there are more than 5 forums selected the admin is not able to select all users/groups too. + // We need to see if the number of forums can be increased or need to be decreased. + $template->assign_vars(array( 'U_ACTION' => $this->u_action, 'ANONYMOUS_USER_ID' => ANONYMOUS, 'S_SELECT_VICTIM' => true, + 'S_ALLOW_ALL_SELECT' => (sizeof($forum_id) > 5) ? false : true, 'S_CAN_SELECT_USER' => ($auth->acl_get('a_authusers')) ? true : false, 'S_CAN_SELECT_GROUP' => ($auth->acl_get('a_authgroups')) ? true : false, 'S_HIDDEN_FIELDS' => $s_hidden_fields) @@ -436,7 +444,7 @@ class acp_permissions // Do not allow forum_ids being set and no other setting defined (will bog down the server too much) if (sizeof($forum_id) && !sizeof($user_id) && !sizeof($group_id)) { - trigger_error($user->lang['ONLY_FORUM_DEFINED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['ONLY_FORUM_DEFINED'] . adm_back_link($this->u_action), E_USER_WARNING); } $template->assign_vars(array( @@ -566,7 +574,7 @@ class acp_permissions if (!sizeof($ids)) { - trigger_error($user->lang['SELECTED_' . strtoupper($mode) . '_NOT_EXIST'] . adm_back_link($this->u_action)); + trigger_error($user->lang['SELECTED_' . strtoupper($mode) . '_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING); } } @@ -585,7 +593,7 @@ class acp_permissions // Check the permission setting again if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's')) { - trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); } $ug_id = $forum_id = 0; @@ -643,7 +651,7 @@ class acp_permissions // Remove users who are now moderators or admins from everyones foes list if ($permission_type == 'm_' || $permission_type == 'a_') { - $this->update_foes(); + update_foes(); } $this->log_action($mode, 'add', $permission_type, $ug_type, $ug_id, $forum_id); @@ -664,7 +672,7 @@ class acp_permissions // Check the permission setting again if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's')) { - trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); } $auth_settings = (isset($_POST['setting'])) ? $_POST['setting'] : array(); @@ -710,7 +718,7 @@ class acp_permissions // Remove users who are now moderators or admins from everyones foes list if ($permission_type == 'm_' || $permission_type == 'a_') { - $this->update_foes(); + update_foes(); } $this->log_action($mode, 'add', $permission_type, $ug_type, $ug_ids, $forum_ids); @@ -769,7 +777,7 @@ class acp_permissions // Check the permission setting again if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's')) { - trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); } $auth_admin->acl_delete($ug_type, (($ug_type == 'user') ? $user_id : $group_id), (sizeof($forum_id) ? $forum_id : false), $permission_type); @@ -840,32 +848,6 @@ class acp_permissions } /** - * Update foes - remove moderators and administrators from foe lists... - */ - function update_foes() - { - global $db, $auth; - - $perms = array(); - foreach ($auth->acl_get_list(false, array('a_', 'm_'), false) as $forum_id => $forum_ary) - { - foreach ($forum_ary as $auth_option => $user_ary) - { - $perms = array_merge($perms, $user_ary); - } - } - - if (sizeof($perms)) - { - $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' - WHERE ' . $db->sql_in_set('zebra_id', array_unique($perms)) . ' - AND foe = 1'; - $db->sql_query($sql); - } - unset($perms); - } - - /** * Display a complete trace tree for the selected permission to determine where settings are set/unset */ function permission_trace($user_id, $forum_id, $permission) @@ -888,7 +870,7 @@ class acp_permissions if (!$userdata) { - trigger_error('NO_USERS'); + trigger_error('NO_USERS', E_USER_ERROR); } $forum_name = false; diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php index 44917bd8fc..fe223b623e 100644 --- a/phpBB/includes/acp/acp_php_info.php +++ b/phpBB/includes/acp/acp_php_info.php @@ -22,7 +22,7 @@ class acp_php_info if ($mode != 'info') { - trigger_error('NO_MODE'); + trigger_error('NO_MODE', E_USER_ERROR); } $this->tpl_name = 'acp_php_info'; diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index c361c47c2e..9ce7f3ed92 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -91,7 +91,7 @@ class acp_profile if (!$field_id) { - trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING); } if (confirm_box(true)) @@ -107,7 +107,7 @@ class acp_profile $db->sql_query('DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . " WHERE field_id = $field_id"); $db->sql_query('DELETE FROM ' . PROFILE_LANG_TABLE . " WHERE field_id = $field_id"); - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'sqlite': $sql = "SELECT sql @@ -119,6 +119,8 @@ class acp_profile $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); + $db->sql_transaction('begin'); + // Create a temp table and populate it, destroy the existing one $db->sql_query(preg_replace('#CREATE\s+TABLE\s+"?' . PROFILE_FIELDS_DATA_TABLE . '"?#i', 'CREATE TEMPORARY TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp', $row['sql'])); $db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . '_temp SELECT * FROM ' . PROFILE_FIELDS_DATA_TABLE); @@ -127,12 +129,13 @@ class acp_profile preg_match('#\((.*)\)#s', $row['sql'], $matches); $new_table_cols = trim($matches[1]); - $old_table_cols = explode(',', $new_table_cols); + $old_table_cols = preg_split('/,(?=[\\sa-z])/im', $new_table_cols); $column_list = array(); - foreach($old_table_cols as $declaration) + + foreach ($old_table_cols as $declaration) { $entities = preg_split('#\s+#', trim($declaration)); - if ($entities[0] !== '_' . $field_ident) + if ($entities[0] !== 'pf_' . $field_ident) { $column_list[] = $entities[0]; } @@ -140,16 +143,18 @@ class acp_profile $columns = implode(',', $column_list); - $new_table_cols = preg_replace('/' . '_' . $field_ident . '[^,]+,/', '', $new_table_cols); + $new_table_cols = preg_replace('/' . 'pf_' . $field_ident . '[^,]+,/', '', $new_table_cols); // create a new table and fill it up. destroy the temp one $db->sql_query('CREATE TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $new_table_cols . ');'); $db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . PROFILE_FIELDS_DATA_TABLE . '_temp;'); $db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp'); + + $db->sql_transaction('commit'); break; default: - $db->sql_query('ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " DROP _$field_ident"); + $db->sql_query('ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " DROP pf_$field_ident"); } $order = 0; @@ -192,7 +197,7 @@ class acp_profile if (!$field_id) { - trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'SELECT lang_id @@ -204,7 +209,7 @@ class acp_profile if (!in_array($default_lang_id, $lang_defs['entry'][$field_id])) { - trigger_error($user->lang['DEFAULT_LANGUAGE_NOT_FILLED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['DEFAULT_LANGUAGE_NOT_FILLED'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . " @@ -229,7 +234,7 @@ class acp_profile if (!$field_id) { - trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . " @@ -275,7 +280,7 @@ class acp_profile { if (!$field_id) { - trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'SELECT l.*, f.* @@ -289,7 +294,7 @@ class acp_profile if (!$field_row) { - trigger_error($user->lang['FIELD_NOT_FOUND'] . adm_back_link($this->u_action)); + trigger_error($user->lang['FIELD_NOT_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING); } $field_type = $field_row['field_type']; @@ -319,7 +324,7 @@ class acp_profile if (!$field_type) { - trigger_error($user->lang['NO_FIELD_TYPE'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_FIELD_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING); } $field_row = array_merge($default_values[$field_type], array( @@ -359,7 +364,7 @@ class acp_profile $cp->vars['lang_name'] = request_var('lang_name', $field_row['lang_name'], true); $cp->vars['lang_explain'] = request_var('lang_explain', $field_row['lang_explain'], true); $cp->vars['lang_default_value'] = request_var('lang_default_value', $field_row['lang_default_value'], true); - + // Field option... if (isset($_REQUEST['field_option'])) { @@ -525,7 +530,8 @@ class acp_profile } } - if ($submit && $step == 1) + // Check for general issues in every step + if ($submit) // && $step == 1 { // Check values for step 1 if ($cp->vars['field_ident'] == '') @@ -538,16 +544,39 @@ class acp_profile $error[] = $user->lang['INVALID_CHARS_FIELD_IDENT']; } + if (strlen($cp->vars['field_ident']) > 17) + { + $error[] = $user->lang['INVALID_FIELD_IDENT_LEN']; + } + if ($cp->vars['lang_name'] == '') { $error[] = $user->lang['EMPTY_USER_FIELD_NAME']; } - if ($field_type == FIELD_BOOL || $field_type == FIELD_DROPDOWN) + if ($field_type == FIELD_DROPDOWN && !sizeof($cp->vars['lang_options'])) + { + $error[] = $user->lang['NO_FIELD_ENTRIES']; + } + + if ($field_type == FIELD_BOOL && (empty($cp->vars['lang_options'][0]) || empty($cp->vars['lang_options'][1]))) { - if (!sizeof($cp->vars['lang_options'])) + $error[] = $user->lang['NO_FIELD_ENTRIES']; + } + + // Check for already existing field ident + if ($action != 'edit') + { + $sql = 'SELECT field_ident + FROM ' . PROFILE_FIELDS_TABLE . " + WHERE field_ident = '" . $db->sql_escape($cp->vars['field_ident']) . "'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) { - $error[] = $user->lang['NO_FIELD_ENTRIES']; + $error[] = $user->lang['FIELD_IDENT_ALREADY_EXIST']; } } } @@ -730,12 +759,20 @@ class acp_profile ORDER BY field_order'; $result = $db->sql_query($sql); + $s_one_need_edit = false; while ($row = $db->sql_fetchrow($result)) { $active_lang = (!$row['field_active']) ? 'ACTIVATE' : 'DEACTIVATE'; $active_value = (!$row['field_active']) ? 'activate' : 'deactivate'; $id = $row['field_id']; + $s_need_edit = (sizeof($lang_defs['diff'][$row['field_id']])) ? true : false; + + if ($s_need_edit) + { + $s_one_need_edit = true; + } + $template->assign_block_vars('fields', array( 'FIELD_IDENT' => $row['field_ident'], 'FIELD_TYPE' => $user->lang['FIELD_' . strtoupper($cp->profile_types[$row['field_type']])], @@ -743,15 +780,22 @@ class acp_profile 'L_ACTIVATE_DEACTIVATE' => $user->lang[$active_lang], 'U_ACTIVATE_DEACTIVATE' => $this->u_action . "&action=$active_value&field_id=$id", 'U_EDIT' => $this->u_action . "&action=edit&field_id=$id", + 'U_TRANSLATE' => $this->u_action . "&action=edit&field_id=$id&step=3", 'U_DELETE' => $this->u_action . "&action=delete&field_id=$id", 'U_MOVE_UP' => $this->u_action . "&action=move_up&order={$row['field_order']}", 'U_MOVE_DOWN' => $this->u_action . "&action=move_down&order={$row['field_order']}", - 'S_NEED_EDIT' => (sizeof($lang_defs['diff'][$row['field_id']])) ? true : false) + 'S_NEED_EDIT' => $s_need_edit) ); } $db->sql_freeresult($result); + // At least one option field needs editing? + if ($s_one_need_edit) + { + $template->assign_var('S_NEED_EDIT', true); + } + $s_select_type = ''; foreach ($cp->profile_types as $key => $value) { @@ -831,12 +875,11 @@ class acp_profile $lang_options[$lang_id]['lang_iso'] = $lang_iso; foreach ($options as $field => $field_type) { - $value = ($action == 'create') ? request_var('l_' . $field, '', true) : $cp->vars['l_' . $field]; - + $value = ($action == 'create') ? request_var('l_' . $field, array(0 => ''), true) : $cp->vars['l_' . $field]; + if ($field == 'lang_options') { - - $var = ($action == 'create' || !is_array($cp->vars['lang_options'][$lang_id])) ? $cp->vars['lang_options'] : $cp->vars['lang_options'][$lang_id]; + $var = ($action == 'create' || !is_array($cp->vars['l_lang_options'][$lang_id])) ? $cp->vars['lang_options'] : $cp->vars['lang_options'][$lang_id]; switch ($field_type) { @@ -948,7 +991,7 @@ class acp_profile if ($action == 'create') { - $field_ident = '_' . $field_ident; + $field_ident = 'pf_' . $field_ident; $profile_sql[] = $this->add_field_ident($field_ident, $field_type); } @@ -1003,10 +1046,11 @@ class acp_profile } } - $cp->vars['l_lang_name'] = request_var('l_lang_name', '', true); - $cp->vars['l_lang_explain'] = request_var('l_lang_explain', '', true); - $cp->vars['l_lang_default_value'] = request_var('l_lang_default_value', '', true); - $cp->vars['l_lang_options'] = request_var('l_lang_options', '', true); + // These are always arrays because the key is the language id... + $cp->vars['l_lang_name'] = request_var('l_lang_name', array(0 => ''), true); + $cp->vars['l_lang_explain'] = request_var('l_lang_explain', array(0 => ''), true); + $cp->vars['l_lang_default_value'] = request_var('l_lang_default_value', array(0 => ''), true); + $cp->vars['l_lang_options'] = request_var('l_lang_options', array(0 => ''), true); if ($cp->vars['lang_options']) { @@ -1155,7 +1199,7 @@ class acp_profile } else { - add_log('admin', 'LOG_PROFILE_FIELD_CREATE', substr($field_ident, 1) . ':' . $cp->vars['lang_name']); + add_log('admin', 'LOG_PROFILE_FIELD_CREATE', substr($field_ident, 3) . ':' . $cp->vars['lang_name']); trigger_error($user->lang['ADDED_PROFILE_FIELD'] . adm_back_link($this->u_action)); } } @@ -1215,7 +1259,7 @@ class acp_profile { global $db; - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysql': case 'mysql4': diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 4752e7bafe..e71fe33557 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -155,7 +155,7 @@ class acp_prune if (!$row) { $db->sql_freeresult($result); - trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action), E_USER_WARNING); } $forum_list = $s_hidden_fields = ''; @@ -196,17 +196,18 @@ class acp_prune { if (confirm_box(true)) { - $users = request_var('users', ''); + $users = request_var('users', '', true); $action = request_var('action', 'deactivate'); $deleteposts = request_var('deleteposts', 0); if ($users) { - $where_sql = ' AND ' . $db->sql_in_set('username', explode("\n", $users)); + $users = explode("\n", $users); + $where_sql = ' AND ' . $db->sql_in_set('username_clean', array_map('utf8_clean_string', $users)); } else { - $username = request_var('username', ''); + $username = request_var('username', '', true); $email = request_var('email', ''); $joined_select = request_var('joined_select', 'lt'); @@ -224,7 +225,7 @@ class acp_prune $sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit'); $where_sql = ''; - $where_sql .= ($username) ? " AND username LIKE '" . $db->sql_escape(str_replace('*', '%', $username)) . "'" : ''; + $where_sql .= ($username) ? " AND username_clean LIKE '" . $db->sql_escape(str_replace('*', '%', utf8_clean_string($username))) . "'" : ''; $where_sql .= ($email) ? " AND user_email LIKE '" . $db->sql_escape(str_replace('*', '%', $email)) . "' " : ''; $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] . " $count " : ''; @@ -244,7 +245,8 @@ class acp_prune $db->sql_freeresult($result); // Do not prune founder members - $sql = 'SELECT username, user_id FROM ' . USERS_TABLE . ' + $sql = 'SELECT user_id, username + FROM ' . USERS_TABLE . ' WHERE user_id <> ' . ANONYMOUS . ' AND user_type <> ' . USER_FOUNDER . " $where_sql"; @@ -267,11 +269,7 @@ class acp_prune { if ($action == 'deactivate') { - foreach ($user_ids as $user_id) - { - user_active_flip($user_id, USER_NORMAL, false, false, true); - } - + user_active_flip('deactivate', $user_ids); $l_log = 'LOG_PRUNE_USER_DEAC'; } else if ($action == 'delete') @@ -309,7 +307,7 @@ class acp_prune 'prune' => 1, 'users' => request_var('users', ''), - 'username' => request_var('username', ''), + 'username' => request_var('username', '', true), 'email' => request_var('email', ''), 'joined_select' => request_var('joined_select', ''), 'joined' => request_var('joined', ''), diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php index 59505c34c2..db96b173e8 100644 --- a/phpBB/includes/acp/acp_ranks.php +++ b/phpBB/includes/acp/acp_ranks.php @@ -48,14 +48,14 @@ class acp_ranks if (!$rank_title) { - trigger_error($user->lang['NO_RANK_TITLE'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_RANK_TITLE'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql_ary = array( 'rank_title' => $rank_title, 'rank_special' => $special_rank, 'rank_min' => $min_posts, - 'rank_image' => html_entity_decode($rank_image) + 'rank_image' => htmlspecialchars_decode($rank_image) ); if ($rank_id) @@ -96,7 +96,7 @@ class acp_ranks } else { - trigger_error($user->lang['MUST_SELECT_RANK'] . adm_back_link($this->u_action)); + trigger_error($user->lang['MUST_SELECT_RANK'] . adm_back_link($this->u_action), E_USER_WARNING); } break; diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php index 402663ad90..72419de1ef 100644 --- a/phpBB/includes/acp/acp_reasons.php +++ b/phpBB/includes/acp/acp_reasons.php @@ -61,11 +61,11 @@ class acp_reasons $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if ($row['reason_title'] == 'other') + if (strtolower($row['reason_title']) == 'other') { $reason_row['reason_title'] = 'other'; } - else if (strtolower($row['reason_title']) != strtolower($reason_row['reason_title'])) + else if ($row['reason_title'] != $reason_row['reason_title']) { $check_double = true; } @@ -76,12 +76,12 @@ class acp_reasons { $sql = 'SELECT reason_id FROM ' . REPORTS_REASONS_TABLE . " - WHERE LOWER(reason_title) = '" . strtolower($db->sql_escape($reason_row['reason_title'])) . "'"; + WHERE reason_title = '" . $db->sql_escape($reason_row['reason_title']) . "'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if ($row) + if ($row || ($action == 'add' && strtolower($reason_row['reason_title']) == 'other')) { $error[] = $user->lang['REASON_ALREADY_EXIST']; } @@ -137,7 +137,7 @@ class acp_reasons if (!$reason_row) { - trigger_error($user->lang['NO_REASON'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_REASON'] . adm_back_link($this->u_action), E_USER_WARNING); } } @@ -159,10 +159,14 @@ class acp_reasons 'REASON_TITLE' => $reason_row['reason_title'], 'REASON_DESCRIPTION' => $reason_row['reason_description'], - - 'S_EDIT_REASON' => true, - 'S_TRANSLATED' => $translated, - 'S_ERROR' => (sizeof($error)) ? true : false, + + 'TRANSLATED_TITLE' => ($translated) ? $user->lang['report_reasons']['TITLE'][strtoupper($reason_row['reason_title'])] : '', + 'TRANSLATED_DESCRIPTION'=> ($translated) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason_row['reason_title'])] : '', + + 'S_AVAILABLE_TITLES' => implode(', ', array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))), + 'S_EDIT_REASON' => true, + 'S_TRANSLATED' => $translated, + 'S_ERROR' => (sizeof($error)) ? true : false, ) ); @@ -180,12 +184,12 @@ class acp_reasons if (!$reason_row) { - trigger_error($user->lang['NO_REASON'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_REASON'] . adm_back_link($this->u_action), E_USER_WARNING); } - if ($reason_row['reason_title'] == 'other') + if (strtolower($reason_row['reason_title']) == 'other') { - trigger_error($user->lang['NO_REMOVE_DEFAULT_REASON'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_REMOVE_DEFAULT_REASON'] . adm_back_link($this->u_action), E_USER_WARNING); } // Let the deletion be confirmed... @@ -193,12 +197,12 @@ class acp_reasons { $sql = 'SELECT reason_id FROM ' . REPORTS_REASONS_TABLE . " - WHERE reason_title = 'other'"; + WHERE LOWER(reason_title) = 'other'"; $result = $db->sql_query($sql); $other_reason_id = (int) $db->sql_fetchfield('reason_id'); $db->sql_freeresult($result); - switch (SQL_LAYER) + switch ($db->sql_layer) { // The ugly one! case 'mysqli': @@ -214,9 +218,17 @@ class acp_reasons case 'mssql': case 'mssql_odbc': // Change the reports using this reason to 'other' - $sql = 'UPDATE ' . REPORTS_TABLE . ' - SET reason_id = ' . $other_reason_id . ", report_text = '" . $db->sql_escape($reason_row['reason_description']) . "\n\n' + report_text - WHERE reason_id = $reason_id"; + $sql = "DECLARE @ptrval binary(16) + + SELECT @ptrval = TEXTPTR(report_text) + FROM " . REPORTS_TABLE . " + WHERE reason_id = " . $reason_id . " + + UPDATETEXT " . REPORTS_TABLE . ".report_text @ptrval 0 0 '" . $db->sql_escape($reason_row['reason_description']) . "\n\n' + + UPDATE " . REPORTS_TABLE . ' + SET reason_id = ' . $other_reason_id . " + WHERE reason_id = $reason_id"; break; // Teh standard @@ -319,7 +331,7 @@ class acp_reasons // If the reason is defined within the language file, we will use the localized version, else just use the database entry... if (isset($user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) { - $row['reson_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]; + $row['reason_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]; $row['reason_title'] = $user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]; $translated = true; diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php index b7c37772ed..6b1eefe8e6 100644 --- a/phpBB/includes/acp/acp_search.php +++ b/phpBB/includes/acp/acp_search.php @@ -152,7 +152,7 @@ class acp_search } else { - trigger_error($error); + trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING); } } else @@ -168,7 +168,7 @@ class acp_search } else { - trigger_error($error); + trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING); } } @@ -228,7 +228,8 @@ class acp_search break; default: - trigger_error('NO_ACTION'); + trigger_error('NO_ACTION', E_USER_ERROR); + break; } if (empty($this->state[0])) @@ -240,7 +241,7 @@ class acp_search $error = false; if ($this->init_search($this->state[0], $this->search, $error)) { - trigger_error($error); + trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING); } $action = &$this->state[1]; @@ -262,7 +263,7 @@ class acp_search { $this->state = array(''); $this->save_state(); - trigger_error($error . adm_back_link($this->u_action) . $this->close_popup_js()); + trigger_error($error . adm_back_link($this->u_action) . $this->close_popup_js(), E_USER_WARNING); } } else @@ -294,7 +295,7 @@ class acp_search if ($post_counter <= $this->max_post_id) { - redirect($this->u_action . '&action=delete', 3); + redirect($this->u_action . '&action=delete'); } } @@ -314,12 +315,12 @@ class acp_search { $this->state = array(''); $this->save_state(); - trigger_error($error . adm_back_link($this->u_action) . $this->close_popup_js()); + trigger_error($error . adm_back_link($this->u_action) . $this->close_popup_js(), E_USER_WARNING); } } else { - $sql = 'SELECT post_id, post_subject, post_text, post_encoding, poster_id, forum_id + $sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id FROM ' . POSTS_TABLE . ' WHERE post_id >= ' . (int) ($post_counter + 1) . ' AND post_id < ' . (int) ($post_counter + $this->batch_size); @@ -327,7 +328,7 @@ class acp_search while ($row = $db->sql_fetchrow($result)) { - $this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['post_encoding'], $row['poster_id'], $row['forum_id']); + $this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['poster_id'], $row['forum_id']); } $db->sql_freeresult($result); @@ -338,7 +339,7 @@ class acp_search if ($post_counter <= $this->max_post_id) { - redirect($this->u_action . '&action=create', 3); + redirect($this->u_action . '&action=create'); } } @@ -440,7 +441,7 @@ class acp_search adm_page_header($user->lang[$l_type]); $template->set_filenames(array( - 'body' => 'search_index_progress_bar.html') + 'body' => 'progress_bar.html') ); $template->assign_vars(array( diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 48277dc487..4377dd7e20 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -191,7 +191,7 @@ pagination_sep = \'{PAGINATION_SEP}\' if ($style_id == $config['default_style']) { - trigger_error($user->lang['DEACTIVATE_DEFAULT'] . adm_back_link($this->u_action)); + trigger_error($user->lang['DEACTIVATE_DEFAULT'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'UPDATE ' . STYLES_TABLE . ' @@ -234,7 +234,7 @@ pagination_sep = \'{PAGINATION_SEP}\' if (!$template_row) { - trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING); } if (confirm_box(true)) @@ -311,12 +311,12 @@ pagination_sep = \'{PAGINATION_SEP}\' if (!$theme_row) { - trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING); } if (!$theme_row['theme_storedb']) { - trigger_error($user->lang['THEME_ERR_REFRESH_FS'] . adm_back_link($this->u_action)); + trigger_error($user->lang['THEME_ERR_REFRESH_FS'] . adm_back_link($this->u_action), E_USER_WARNING); } if (confirm_box(true)) @@ -369,7 +369,7 @@ pagination_sep = \'{PAGINATION_SEP}\' if (!$imageset_row) { - trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action), E_USER_WARNING); } if (confirm_box(true)) @@ -397,9 +397,12 @@ pagination_sep = \'{PAGINATION_SEP}\' } unset($cfg_data); - $sql = 'UPDATE ' . STYLES_IMAGESET_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " - WHERE imageset_id = $style_id"; - $db->sql_query($sql); + if (sizeof($sql_ary)) + { + $sql = 'UPDATE ' . STYLES_IMAGESET_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE imageset_id = $style_id"; + $db->sql_query($sql); + } $cache->destroy('sql', STYLES_IMAGESET_TABLE); @@ -533,7 +536,7 @@ pagination_sep = \'{PAGINATION_SEP}\' while (($file = readdir($dp)) !== false) { $subpath = ($mode != 'style') ? "$mode/" : ''; - if ($file{0} != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg")) + if ($file[0] != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg")) { if ($cfg = file("{$phpbb_root_path}styles/$file/$subpath$mode.cfg")) { @@ -590,7 +593,7 @@ pagination_sep = \'{PAGINATION_SEP}\' $_POST['template_data'] = (isset($_POST['template_data']) && !empty($_POST['template_data'])) ? str_replace(array("\r\n", "\r"), array("\n", "\n"), $_POST['template_data']) : ''; $template_data = (STRIP) ? stripslashes($_POST['template_data']) : $_POST['template_data']; - $template_file = request_var('template_file', ''); + $template_file = request_var('template_file', ''); $text_rows = max(5, min(999, request_var('text_rows', 20))); $save_changes = (isset($_POST['save'])) ? true : false; @@ -602,12 +605,13 @@ pagination_sep = \'{PAGINATION_SEP}\' FROM ' . STYLES_TEMPLATE_TABLE . " WHERE template_id = $template_id"; $result = $db->sql_query($sql); + $template_info = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!($template_info = $db->sql_fetchrow($result))) + if (!$template_info) { - trigger_error($user->lang['NO_TEMPLATE']); + trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING); } - $db->sql_freeresult($result); // save changes to the template if the user submitted any if ($save_changes && $template_file) @@ -621,7 +625,7 @@ pagination_sep = \'{PAGINATION_SEP}\' { if (!($fp = fopen($file, 'wb'))) { - trigger_error($user->lang['NO_TEMPLATE']); + trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING); } fwrite($fp, $template_data); fclose($fp); @@ -674,7 +678,7 @@ pagination_sep = \'{PAGINATION_SEP}\' { if (!file_exists($template_path . "/$template_file") || !($template_data = file_get_contents($template_path . "/$template_file"))) { - trigger_error($user->lang['NO_TEMPLATE']); + trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING); } } } @@ -779,7 +783,7 @@ pagination_sep = \'{PAGINATION_SEP}\' 'SELECTED_TEMPLATE' => $template_info['template_name'], 'TEMPLATE_FILE' => $template_file, - 'TEMPLATE_DATA' => htmlentities($template_data), + 'TEMPLATE_DATA' => htmlspecialchars($template_data), 'TEXT_ROWS' => $text_rows) ); } @@ -801,12 +805,13 @@ pagination_sep = \'{PAGINATION_SEP}\' FROM ' . STYLES_TEMPLATE_TABLE . " WHERE template_id = $template_id"; $result = $db->sql_query($sql); + $template_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!($template_row = $db->sql_fetchrow($result))) + if (!$template_row) { - trigger_error($user->lang['NO_TEMPLATE']); + trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING); } - $db->sql_freeresult($result); // User wants to delete one or more files ... if ($submit && $file_ary) @@ -941,7 +946,7 @@ pagination_sep = \'{PAGINATION_SEP}\' if (!($theme_info = $db->sql_fetchrow($result))) { - trigger_error($user->lang['NO_THEME']); + trigger_error($user->lang['NO_THEME'] . adm_bacl_link($this->u_action), E_USER_WARNING); } $db->sql_freeresult($result); @@ -951,7 +956,7 @@ pagination_sep = \'{PAGINATION_SEP}\' { if (!file_exists($stylesheet_path) || !($stylesheet = file_get_contents($stylesheet_path))) { - trigger_error($user->lang['NO_THEME']); + trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING); } } else @@ -961,7 +966,7 @@ pagination_sep = \'{PAGINATION_SEP}\' // Pull out a list of classes $classes = array(); - if (preg_match_all('/^([a-z0-9\.:#> \t]+?)[ \t\n]*?\{.*?\}/msi', $stylesheet, $matches)) + if (preg_match_all('/^([a-z0-9\.,:#> \t]+?)[ \t\n]*?\{.*?\}/msi', $stylesheet, $matches)) { $classes = $matches[1]; } @@ -1007,7 +1012,7 @@ pagination_sep = \'{PAGINATION_SEP}\' // Used in an sprintf statement to generate appropriate output for rawcss mode $map_elements = array( 'colors' => '%s', - 'sizes' => '%d', + 'sizes' => '%1.10f', 'images' => 'url(\'./%s\')', 'repeat' => '%s', 'other' => '%s', @@ -1015,11 +1020,11 @@ pagination_sep = \'{PAGINATION_SEP}\' $units = array('px', '%', 'em', 'pt'); $repeat_types = array( - '' => $user->lang['UNSET'], - 'none' => $user->lang['REPEAT_NO'], - 'repeat-x' => $user->lang['REPEAT_X'], - 'repeat-y' => $user->lang['REPEAT_Y'], - 'both' => $user->lang['REPEAT_ALL'], + '' => $user->lang['UNSET'], + 'none' => $user->lang['REPEAT_NO'], + 'repeat-x' => $user->lang['REPEAT_X'], + 'repeat-y' => $user->lang['REPEAT_Y'], + 'both' => $user->lang['REPEAT_ALL'], ); // Fill css_data with the class contents from the stylesheet @@ -1030,7 +1035,7 @@ pagination_sep = \'{PAGINATION_SEP}\' if (!isset($matches[1])) { - trigger_error($user->lang['NO_CLASS']); + trigger_error($user->lang['NO_CLASS'] . adm_back_link($this->u_action), E_USER_WARNING); } $css_data = implode(";\n", array_diff(array_map('trim', explode("\n", preg_replace("#;[\n]*#s", "\n", $matches[1]))), array(''))); @@ -1183,11 +1188,11 @@ pagination_sep = \'{PAGINATION_SEP}\' $value = ''; $unit = ''; - // retrieve and validate date for this setting + // retrieve and validate data for this setting switch ($type) { case 'sizes': - $value = request_var($var, 0); + $value = request_var($var, 0.0); $unit = request_var($var . '_unit', ''); if ((request_var($var, '') === '') || !in_array($unit, $units)) @@ -1227,7 +1232,7 @@ pagination_sep = \'{PAGINATION_SEP}\' // use the element mapping to create raw css code if ($value !== '') { - $css_data .= $match . ': ' . sprintf($map_elements[$type], $value) . $unit . ";\n"; + $css_data .= $match . ': ' . ($type == 'sizes' ? rtrim(sprintf($map_elements[$type], $value), '0') : sprintf($map_elements[$type], $value)) . $unit . ";\n"; } } } @@ -1262,7 +1267,7 @@ pagination_sep = \'{PAGINATION_SEP}\' // check whether the custom class name is valid if (!preg_match('/^[a-z0-9#:.\- ]+$/i', $add_custom)) { - trigger_error($user->lang['THEME_ERR_CLASS_CHARS'] . adm_back_link($this->u_action . "&action=edit&id=$theme_id&text_rows=$text_rows")); + trigger_error($user->lang['THEME_ERR_CLASS_CHARS'] . adm_back_link($this->u_action . "&action=edit&id=$theme_id&text_rows=$text_rows"), E_USER_WARNING); } else { @@ -1278,7 +1283,7 @@ pagination_sep = \'{PAGINATION_SEP}\' // write stylesheet to file if (!($fp = fopen($stylesheet_path, 'wb'))) { - trigger_error($user->lang['NO_THEME']); + trigger_error($user->lang['NO_THEME'] . adm_back_link($this->u_action), E_USER_WARNING); } fwrite($fp, $stylesheet); fclose($fp); @@ -1348,16 +1353,19 @@ pagination_sep = \'{PAGINATION_SEP}\' if ($imageset_id) { $sql_select = ($imgname) ? ", $imgname" : ''; + $sql = "SELECT imageset_path, imageset_name, imageset_copyright$sql_select FROM " . STYLES_IMAGESET_TABLE . " WHERE imageset_id = $imageset_id"; $result = $db->sql_query($sql); + $imageset_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!extract($db->sql_fetchrow($result))) + if (!$imageset_row) { - trigger_error($user->lang['NO_IMAGESET']); + trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action), E_USER_WARNING); } - $db->sql_freeresult($result); + extract($imageset_row); // Check to see whether the selected image exists in the table $valid_name = ($update) ? false : true; @@ -1431,7 +1439,7 @@ pagination_sep = \'{PAGINATION_SEP}\' $dp = opendir($dir); while (($file = readdir($dp)) !== false) { - if (!is_file($dir . '/' . $file) && !is_link($dir . '/' . $file) && $file{0} != '.' && strtoupper($file) != 'CVS' && !sizeof($imagesetlist['lang'])) + if (!is_file($dir . '/' . $file) && !is_link($dir . '/' . $file) && $file[0] != '.' && strtoupper($file) != 'CVS' && !sizeof($imagesetlist['lang'])) { $dp2 = opendir("$dir/$file"); while (($file2 = readdir($dp2)) !== false) @@ -1540,7 +1548,7 @@ pagination_sep = \'{PAGINATION_SEP}\' if (!$style_row) { - trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = "SELECT {$mode}_id, {$mode}_name @@ -1561,7 +1569,7 @@ pagination_sep = \'{PAGINATION_SEP}\' } else { - trigger_error($user->lang['ONLY_' . $l_prefix] . adm_back_link($this->u_action)); + trigger_error($user->lang['ONLY_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING); } $db->sql_freeresult($result); @@ -1719,7 +1727,7 @@ pagination_sep = \'{PAGINATION_SEP}\' if (!$style_row) { - trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING); } $var_ary = array('style_id', 'style_name', 'style_copyright', 'template_id', 'template_name', 'template_path', 'template_copyright', 'template_storedb', 'bbcode_bitfield', 'theme_id', 'theme_name', 'theme_path', 'theme_copyright', 'theme_storedb', 'theme_mtime', 'theme_data', 'imageset_id', 'imageset_name', 'imageset_path', 'imageset_copyright'); @@ -1843,7 +1851,7 @@ pagination_sep = \'{PAGINATION_SEP}\' { foreach ($key_array as $key) { - $imageset_cfg .= "\n" . $key . ' = ' . str_replace("styles/{$style_row['imageset_path']}/imageset/", '{PATH}', $style_row[$key]); + $imageset_cfg .= "\nimg_" . $key . ' = ' . str_replace("styles/{$style_row['imageset_path']}/imageset/", '{PATH}', $style_row[$key]); } } @@ -1951,7 +1959,7 @@ pagination_sep = \'{PAGINATION_SEP}\' if (!$style_row) { - trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_' . $l_prefix] . adm_back_link($this->u_action), E_USER_WARNING); } $this->page_title = $l_prefix . '_EXPORT'; @@ -2021,7 +2029,7 @@ pagination_sep = \'{PAGINATION_SEP}\' if (!$style_row) { - trigger_error($user->lang['NO_' . $l_type] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_' . $l_type] . adm_back_link($this->u_action), E_USER_WARNING); } $style_row['style_default'] = ($mode == 'style' && $config['default_style'] == $style_id) ? 1 : 0; @@ -2057,12 +2065,12 @@ pagination_sep = \'{PAGINATION_SEP}\' if (!sizeof($error)) { // Check length settings - if (strlen($name) > 30) + if (utf8_strlen($name) > 30) { $error[] = $user->lang[$l_type . '_ERR_NAME_LONG']; } - if (strlen($copyright) > 60) + if (utf8_strlen($copyright) > 60) { $error[] = $user->lang[$l_type . '_ERR_COPY_LONG']; } @@ -2308,7 +2316,7 @@ pagination_sep = \'{PAGINATION_SEP}\' { foreach ($matches[0] as $idx => $match) { - $stylesheet = str_replace($match, $this->load_css_file($theme_row['theme_path'], $matches[1][$idx]), $stylesheet); + $stylesheet = str_replace($match, acp_styles::load_css_file($theme_row['theme_path'], $matches[1][$idx]), $stylesheet); } } @@ -2331,7 +2339,7 @@ pagination_sep = \'{PAGINATION_SEP}\' { if (!($fp = fopen("{$phpbb_root_path}styles/$template_path$pathfile$file", 'r'))) { - trigger_error("Could not open {$phpbb_root_path}styles/$template_path$pathfile$file"); + 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")); fclose($fp); @@ -2396,7 +2404,7 @@ pagination_sep = \'{PAGINATION_SEP}\' if (!($dp = @opendir("{$phpbb_root_path}cache"))) { - trigger_error($user->lang['TEMPLATE_ERR_CACHE_READ']); + trigger_error($user->lang['TEMPLATE_ERR_CACHE_READ'] . adm_back_link($this->u_action), E_USER_WARNING); } $file_ary = array(); @@ -2538,7 +2546,7 @@ pagination_sep = \'{PAGINATION_SEP}\' } else { - trigger_error($user->lang['NO_' . $l_type] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_' . $l_type] . adm_back_link($this->u_action), E_USER_WARNING); } $style_row['store_db'] = request_var('store_db', 0); @@ -2822,12 +2830,12 @@ pagination_sep = \'{PAGINATION_SEP}\' } // Check length settings - if (strlen($name) > 30) + if (utf8_strlen($name) > 30) { $error[] = $user->lang['STYLE_ERR_NAME_LONG']; } - if (strlen($copyright) > 60) + if (utf8_strlen($copyright) > 60) { $error[] = $user->lang['STYLE_ERR_COPY_LONG']; } @@ -2932,12 +2940,12 @@ pagination_sep = \'{PAGINATION_SEP}\' } // Check length settings - if (strlen($name) > 30) + if (utf8_strlen($name) > 30) { $error[] = $user->lang[$l_type . '_ERR_NAME_LONG']; } - if (strlen($copyright) > 60) + if (utf8_strlen($copyright) > 60) { $error[] = $user->lang[$l_type . '_ERR_COPY_LONG']; } diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php new file mode 100644 index 0000000000..fac20449bc --- /dev/null +++ b/phpBB/includes/acp/acp_update.php @@ -0,0 +1,61 @@ +<?php +/** +* +* @package acp +* @version $Id$ +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* @package acp +*/ +class acp_update +{ + var $u_action; + + function main($id, $mode) + { + global $config, $db, $user, $auth, $template, $cache; + global $phpbb_root_path, $phpbb_admin_path, $phpEx; + + $user->add_lang('install'); + + $this->tpl_name = 'acp_update'; + $this->page_title = 'ACP_UPDATE'; + + // Get current and latest version + $errstr = ''; + $errno = 0; + + $info = get_remote_file('www.phpbb.com', '/updatecheck', '30x.txt', $errstr, $errno); + + if ($info === false) + { + trigger_error($errstr . adm_back_link($this->u_action)); + } + + $info = explode("\n", $info); + $latest_version = trim($info[0]); + + $announcement_url = trim($info[1]); + $update_archive_link = 'http://www.phpbb.com/files/releases/phpBB-' . $config['version'] . '_to_' . $latest_version . '.zip'; + $update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update'); + + $up_to_date = (version_compare(strtolower($config['version']), strtolower($latest_version), '<')) ? false : true; + + $template->assign_vars(array( + 'S_UP_TO_DATE' => $up_to_date, + 'S_VERSION_CHECK' => true, + 'U_ACTION' => $this->u_action, + + 'LATEST_VERSION' => $latest_version, + 'CURRENT_VERSION' => $config['version'], + + 'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_archive_link, $update_link), + )); + } +} + +?>
\ No newline at end of file diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index e658609c5f..30c4e27b63 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -34,7 +34,7 @@ class acp_users include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); $error = array(); - $username = request_var('username', ''); + $username = request_var('username', '', true); $user_id = request_var('u', 0); $action = request_var('action', ''); @@ -53,7 +53,7 @@ class acp_users if ($ipwhois = user_ipwhois($user_ip)) { $ipwhois = preg_replace('#(\s)([\w\-\._\+]+@[\w\-\.]+)(\s)#', '\1<a href="mailto:\2">\2</a>\3', $ipwhois); - $ipwhois = preg_replace('#(\s)(http:/{2}[^\s]*)(\s)#', '\1<a href="\2" target="_blank">\2</a>\3', $ipwhois); + $ipwhois = preg_replace('#(\s)(http:/{2}[^\s]*)(\s)#', '\1<a href="\2">\2</a>\3', $ipwhois); } $template->assign_vars(array( @@ -75,6 +75,7 @@ class acp_users 'S_SELECT_USER' => true, 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_user&field=username'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_user&field=username', false), ) ); @@ -85,14 +86,14 @@ class acp_users { $sql = 'SELECT user_id FROM ' . USERS_TABLE . " - WHERE username = '" . $db->sql_escape($username) . "'"; + WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; $result = $db->sql_query($sql); $user_id = (int) $db->sql_fetchfield('user_id'); $db->sql_freeresult($result); if (!$user_id) { - trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING); } } @@ -108,7 +109,7 @@ class acp_users if (!$user_row) { - trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING); } // Generate overall "header" for user admin @@ -139,7 +140,7 @@ class acp_users // Prevent normal users/admins change/view founders if they are not a founder by themselves if ($user->data['user_type'] != USER_FOUNDER && $user_row['user_type'] == USER_FOUNDER) { - trigger_error($user->lang['NOT_MANAGE_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id)); + trigger_error($user->lang['NOT_MANAGE_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } switch ($mode) @@ -157,23 +158,23 @@ class acp_users { if (!$auth->acl_get('a_userdel')) { - trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action . '&u=' . $user_id)); + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } // Check if the user wants to remove himself or the guest user account if ($user_id == ANONYMOUS) { - trigger_error($user->lang['CANNOT_REMOVE_ANONYMOUS'] . adm_back_link($this->u_action . '&u=' . $user_id)); + trigger_error($user->lang['CANNOT_REMOVE_ANONYMOUS'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } if ($user_id == $user->data['user_id']) { - trigger_error($user->lang['CANNOT_REMOVE_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id)); + trigger_error($user->lang['CANNOT_REMOVE_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } if (confirm_box(true)) { - user_delete($delete_type, $user_id); + user_delete($delete_type, $user_id, $user_row['username']); add_log('admin', 'LOG_USER_DELETED', $user_row['username']); trigger_error($user->lang['USER_DELETED'] . adm_back_link($this->u_action)); @@ -201,7 +202,12 @@ class acp_users if ($user_id == $user->data['user_id']) { - trigger_error($user->lang['CANNOT_BAN_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id)); + trigger_error($user->lang['CANNOT_BAN_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($user_row['user_type'] == USER_FOUNDER) + { + trigger_error($user->lang['CANNOT_BAN_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } $ban = array(); @@ -241,8 +247,8 @@ class acp_users user_ban(substr($action, 3), $ban, 0, 0, 0, $user->lang[$reason]); - add_log('admin', $log, $user->lang[$reason]); - add_log('user', $user_id, $log, $user->lang[$reason]); + add_log('admin', $log, $user->lang[$reason], implode(', ', $ban)); + add_log('user', $user_id, $log, $user->lang[$reason], implode(', ', $ban)); trigger_error($user->lang['BAN_SUCCESSFUL'] . adm_back_link($this->u_action . '&u=' . $user_id)); @@ -252,7 +258,17 @@ class acp_users if ($user_id == $user->data['user_id']) { - trigger_error($user->lang['CANNOT_FORCE_REACT_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id)); + trigger_error($user->lang['CANNOT_FORCE_REACT_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($user_row['user_type'] == USER_FOUNDER) + { + trigger_error($user->lang['CANNOT_FORCE_REACT_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($user_row['user_type'] == USER_IGNORE) + { + trigger_error($user->lang['CANNOT_FORCE_REACT_BOT'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } if ($config['email_enable']) @@ -266,9 +282,14 @@ class acp_users $key_len = ($key_len > 6) ? $key_len : 6; $user_actkey = substr($user_actkey, 0, $key_len); - if ($user_row['user_type'] != USER_INACTIVE) + if ($user_row['user_type'] == USER_NORMAL) { - user_active_flip($user_id, $user_row['user_type'], $user_actkey, $user_row['username']); + user_active_flip('deactivate', $user_id, INACTIVE_REMIND); + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_actkey = '" . $db->sql_escape($user_actkey) . "' + WHERE user_id = $user_id"; + $db->sql_query($sql); } $messenger = new messenger(false); @@ -284,11 +305,8 @@ class acp_users $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); $messenger->assign_vars(array( - 'SITENAME' => $config['sitename'], - 'WELCOME_MSG' => sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']), - 'USERNAME' => html_entity_decode($user_row['username']), - 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), - + 'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])), + 'USERNAME' => htmlspecialchars_decode($user_row['username']), 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k=$user_actkey") ); @@ -307,27 +325,26 @@ class acp_users if ($user_id == $user->data['user_id']) { // It is only deactivation since the user is already activated (else he would not have reached this page) - trigger_error($user->lang['CANNOT_DEACTIVATE_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id)); + trigger_error($user->lang['CANNOT_DEACTIVATE_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } - user_active_flip($user_id, $user_row['user_type'], false, $user_row['username']); - - $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'; - - add_log('user', $user_id, $log . '_USER'); - - if ($user_row['user_type'] == USER_INACTIVE) + if ($user_row['user_type'] == USER_FOUNDER) { - set_config('num_users', $config['num_users'] + 1, true); + trigger_error($user->lang['CANNOT_DEACTIVATE_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } - else + + if ($user_row['user_type'] == USER_IGNORE) { - set_config('num_users', $config['num_users'] - 1, true); + trigger_error($user->lang['CANNOT_DEACTIVATE_BOT'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } - // Update latest username - update_last_username(); + user_active_flip('flip', $user_id); + + $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'; + + add_log('admin', $log, $user_row['username']); + add_log('user', $user_id, $log . '_USER'); trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&u=' . $user_id)); @@ -338,7 +355,7 @@ class acp_users $sql_ary = array( 'user_sig' => '', 'user_sig_bbcode_uid' => '', - 'user_sig_bbcode_bitfield' => 0 + 'user_sig_bbcode_bitfield' => '' ); $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " @@ -369,7 +386,7 @@ class acp_users // Delete old avatar if present if ($user_row['user_avatar'] && $user_row['user_avatar_type'] != AVATAR_GALLERY) { - avatar_delete($user_row['user_avatar']); + avatar_delete('user', $user_row); } add_log('admin', 'LOG_USER_DEL_AVATAR', $user_row['username']); @@ -599,32 +616,22 @@ class acp_users break; } - $data = array(); - // Handle registration info updates - $var_ary = array( - 'user' => (string) $user_row['username'], - 'user_founder' => (int) (($user_row['user_type'] == USER_FOUNDER) ? 1 : 0), - 'user_email' => (string) $user_row['user_email'], - 'email_confirm' => (string) '', - 'user_password' => (string) '', - 'password_confirm' => (string) '', - 'warnings' => (int) $user_row['user_warnings'], + $data = array( + 'username' => request_var('user', $user_row['username'], true), + 'user_founder' => request_var('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0), + 'email' => request_var('user_email', $user_row['user_email']), + 'email_confirm' => request_var('email_confirm', ''), + 'user_password' => request_var('user_password', '', true), + 'password_confirm' => request_var('password_confirm', '', true), + 'warnings' => request_var('warnings', $user_row['user_warnings']), ); - // Get the data from the form. Use data from the database if no info is provided - foreach ($var_ary as $var => $default) - { - $data[$var] = request_var($var, $default); - } - - // We use user within the form to circumvent auto filling - $data['username'] = $data['user']; - unset($data['user']); - - // Validation data - $var_ary = array( - 'user_password' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']), + // Validation data - we do not check the password complexity setting here + $check_ary = array( + 'user_password' => array( + array('string', true, $config['min_pass_chars'], $config['max_pass_chars']), + array('password')), 'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']), 'warnings' => array('num'), ); @@ -632,7 +639,7 @@ class acp_users // Check username if altered if ($data['username'] != $user_row['username']) { - $var_ary += array( + $check_ary += array( 'username' => array( array('string', false, $config['min_name_chars'], $config['max_name_chars']), array('username', $user_row['username'])), @@ -640,10 +647,10 @@ class acp_users } // Check email if altered - if ($data['user_email'] != $user_row['user_email']) + if ($data['email'] != $user_row['user_email']) { - $var_ary += array( - 'user_email' => array( + $check_ary += array( + 'email' => array( array('string', false, 6, 60), array('email', $user_row['user_email']) ), @@ -651,14 +658,14 @@ class acp_users ); } - $error = validate_data($data, $var_ary); + $error = validate_data($data, $check_ary); if ($data['user_password'] && $data['password_confirm'] != $data['user_password']) { $error[] = 'NEW_PASSWORD_ERROR'; } - if ($data['user_email'] != $user_row['user_email'] && $data['email_confirm'] != $data['user_email']) + if ($data['email'] != $user_row['user_email'] && $data['email_confirm'] != $data['email']) { $error[] = 'NEW_EMAIL_ERROR'; } @@ -667,7 +674,7 @@ class acp_users $update_warning = ($user_row['user_warnings'] != $data['warnings']) ? true : false; $update_username = ($user_row['username'] != $data['username']) ? $data['username'] : false; $update_password = ($data['user_password'] && $user_row['user_password'] != md5($data['user_password'])) ? true : false; - $update_email = ($data['user_email'] != $user_row['user_email']) ? $data['user_email'] : false; + $update_email = ($data['email'] != $user_row['user_email']) ? $data['email'] : false; if (!sizeof($error)) { @@ -686,6 +693,17 @@ class acp_users // Setting a normal member to be a founder if ($data['user_founder'] && $user_row['user_type'] != USER_FOUNDER) { + // Make sure the user is not setting an Inactive or ignored user to be a founder + if ($user_row['user_type'] == USER_IGNORE) + { + trigger_error($user->lang['CANNOT_SET_FOUNDER_BOT'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + + if ($user_row['user_type'] == USER_INACTIVE) + { + trigger_error($user->lang['CANNOT_SET_FOUNDER_INACTIVE'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + $sql_ary['user_type'] = USER_FOUNDER; } else if (!$data['user_founder'] && $user_row['user_type'] == USER_FOUNDER) @@ -705,7 +723,7 @@ class acp_users } else { - trigger_error($user->lang['AT_LEAST_ONE_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id)); + trigger_error($user->lang['AT_LEAST_ONE_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } } } @@ -714,6 +732,7 @@ class acp_users if ($update_username !== false) { $sql_ary['username'] = $update_username; + $sql_ary['username_clean'] = utf8_clean_string($update_username); add_log('user', $user_id, 'LOG_USER_UPDATE_NAME', $user_row['username'], $update_username); } @@ -772,6 +791,7 @@ class acp_users } $user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS'); + $pass_char_ary = array('.*' => 'PASS_TYPE_ANY', '[a-zA-Z]' => 'PASS_TYPE_CASE', '[a-zA-Z0-9]' => 'PASS_TYPE_ALPHA', '[a-zA-Z\W]' => 'PASS_TYPE_SYMBOL'); if ($user_id == $user->data['user_id']) { @@ -779,9 +799,21 @@ class acp_users } else { - $quick_tool_ary = array('banuser' => 'BAN_USER', 'banemail' => 'BAN_EMAIL', 'banip' => 'BAN_IP', 'active' => (($user_row['user_type'] == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE'), 'delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH'); + $quick_tool_ary = array(); + + if ($user_row['user_type'] != USER_FOUNDER) + { + $quick_tool_ary += array('banuser' => 'BAN_USER', 'banemail' => 'BAN_EMAIL', 'banip' => 'BAN_IP'); + } + + if ($user_row['user_type'] != USER_FOUNDER && $user_row['user_type'] != USER_IGNORE) + { + $quick_tool_ary += array('active' => (($user_row['user_type'] == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE')); + } - if ($config['email_enable']) + $quick_tool_ary += array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH'); + + if ($config['email_enable'] && ($user_row['user_type'] == USER_NORMAL || $user_row['user_type'] == USER_INACTIVE)) { $quick_tool_ary['reactivate'] = 'FORCE'; } @@ -793,9 +825,25 @@ class acp_users $s_action_options .= '<option value="' . $value . '">' . $user->lang['USER_ADMIN_' . $lang] . '</option>'; } + if ($config['load_onlinetrack']) + { + $sql = 'SELECT MAX(session_time) AS session_time, MIN(session_viewonline) AS session_viewonline + FROM ' . SESSIONS_TABLE . " + WHERE session_user_id = $user_id"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $user_row['session_time'] = (isset($row['session_time'])) ? $row['session_time'] : 0; + $user_row['session_viewonline'] = (isset($row['session_viewonline'])) ? $row['session_viewonline'] : 0; + unset($row); + } + + $last_visit = (!empty($user_row['session_time'])) ? $user_row['session_time'] : $user_row['user_lastvisit']; + $template->assign_vars(array( - 'L_NAME_CHARS_EXPLAIN' => sprintf($user->lang[$user_char_ary[$config['allow_name_chars']] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), - 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang['CHANGE_PASSWORD_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), + 'L_NAME_CHARS_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), + 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), 'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false, 'S_OVERVIEW' => true, @@ -803,6 +851,7 @@ class acp_users 'S_USER_FOUNDER' => ($user_row['user_type'] == USER_FOUNDER) ? true : false, 'S_ACTION_OPTIONS' => $s_action_options, 'S_OWN_ACCOUNT' => ($user_id == $user->data['user_id']) ? true : false, + 'S_USER_INACTIVE' => ($user_row['user_type'] == USER_INACTIVE) ? true : false, 'U_SHOW_IP' => $this->u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'), 'U_WHOIS' => $this->u_action . "&action=whois&user_ip={$user_row['user_ip']}", @@ -812,7 +861,7 @@ class acp_users 'USER' => $user_row['username'], 'USER_REGISTERED' => $user->format_date($user_row['user_regdate']), 'REGISTERED_IP' => ($ip == 'hostname') ? gethostbyaddr($user_row['user_ip']) : $user_row['user_ip'], - 'USER_LASTACTIVE' => ($user_row['user_lastvisit']) ? $user->format_date($user_row['user_lastvisit']) : ' - ', + 'USER_LASTACTIVE' => ($last_visit) ? $user->format_date($last_visit) : ' - ', 'USER_EMAIL' => $user_row['user_email'], 'USER_WARNINGS' => $user_row['user_warnings'], 'USER_POSTS' => $user_row['user_posts'], @@ -917,40 +966,45 @@ class acp_users $cp = new custom_profile(); $cp_data = $cp_error = array(); - $data = array(); $sql = 'SELECT lang_id FROM ' . LANG_TABLE . " - WHERE lang_iso = '" . $db->sql_escape($user_row['user_lang']) . "'"; + WHERE lang_iso = '" . $db->sql_escape($user->data['user_lang']) . "'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); $user_row['iso_lang_id'] = $row['lang_id']; - if ($submit) + $data = array( + 'icq' => request_var('icq', $user_row['user_icq']), + 'aim' => request_var('aim', $user_row['user_aim']), + 'msn' => request_var('msn', $user_row['user_msnm']), + 'yim' => request_var('yim', $user_row['user_yim']), + 'jabber' => request_var('jabber', $user_row['user_jabber']), + 'website' => request_var('website', $user_row['user_website']), + 'location' => request_var('location', $user_row['user_from'], true), + 'occupation' => request_var('occupation', $user_row['user_occ'], true), + 'interests' => request_var('interests', $user_row['user_interests'], true), + 'bday_day' => 0, + 'bday_month' => 0, + 'bday_year' => 0, + ); + + utf8_normalize_nfc(array(&$data['location'], &$data['occupation'], &$data['interests'])); + + if ($user_row['user_birthday']) { - $var_ary = array( - 'icq' => (string) '', - 'aim' => (string) '', - 'msn' => (string) '', - 'yim' => (string) '', - 'jabber' => (string) '', - 'website' => (string) '', - 'location' => (string) '', - 'occupation' => (string) '', - 'interests' => (string) '', - 'bday_day' => 0, - 'bday_month' => 0, - 'bday_year' => 0, - ); + list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user_row['user_birthday']); + } - foreach ($var_ary as $var => $default) - { - $data[$var] = (in_array($var, array('location', 'occupation', 'interests'))) ? request_var($var, $default, true) : $data[$var] = request_var($var, $default); - } + $data['bday_day'] = request_var('bday_day', $data['bday_day']); + $data['bday_month'] = request_var('bday_month', $data['bday_month']); + $data['bday_year'] = request_var('bday_year', $data['bday_year']); - $var_ary = array( + if ($submit) + { + $error = validate_data($data, array( 'icq' => array( array('string', true, 3, 15), array('match', true, '#^[0-9]+$#i')), @@ -969,9 +1023,7 @@ class acp_users 'bday_day' => array('num', true, 1, 31), 'bday_month' => array('num', true, 1, 12), 'bday_year' => array('num', true, 1901, gmdate('Y', time())), - ); - - $error = validate_data($data, $var_ary); + )); // validate custom profile fields $cp->submit_cp_field('profile', $user_row['iso_lang_id'], $cp_data, $cp_error); @@ -1004,7 +1056,7 @@ class acp_users // Update Custom Fields if (sizeof($cp_data)) { - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'oracle': case 'firebird': @@ -1057,18 +1109,6 @@ class acp_users $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error); } - if (!isset($data['bday_day'])) - { - if ($user_row['user_birthday']) - { - list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user_row['user_birthday']); - } - else - { - $data['bday_day'] = $data['bday_month'] = $data['bday_year'] = 0; - } - } - $s_birthday_day_options = '<option value="0"' . ((!$data['bday_day']) ? ' selected="selected"' : '') . '>--</option>'; for ($i = 1; $i < 32; $i++) { @@ -1094,15 +1134,15 @@ class acp_users unset($now); $template->assign_vars(array( - 'ICQ' => (isset($data['icq'])) ? $data['icq'] : $user_row['user_icq'], - 'YIM' => (isset($data['yim'])) ? $data['yim'] : $user_row['user_yim'], - 'AIM' => (isset($data['aim'])) ? $data['aim'] : $user_row['user_aim'], - 'MSN' => (isset($data['msn'])) ? $data['msn'] : $user_row['user_msnm'], - 'JABBER' => (isset($data['jabber'])) ? $data['jabber'] : $user_row['user_jabber'], - 'WEBSITE' => (isset($data['website'])) ? $data['website']: $user_row['user_website'], - 'LOCATION' => (isset($data['location'])) ? $data['location'] : $user_row['user_from'], - 'OCCUPATION' => (isset($data['occupation'])) ? $data['occupation'] : $user_row['user_occ'], - 'INTERESTS' => (isset($data['interests'])) ? $data['interests'] : $user_row['user_interests'], + 'ICQ' => $data['icq'], + 'YIM' => $data['yim'], + 'AIM' => $data['aim'], + 'MSN' => $data['msn'], + 'JABBER' => $data['jabber'], + 'WEBSITE' => $data['website'], + 'LOCATION' => $data['location'], + 'OCCUPATION' => $data['occupation'], + 'INTERESTS' => $data['interests'], 'S_BIRTHDAY_DAY_OPTIONS' => $s_birthday_day_options, 'S_BIRTHDAY_MONTH_OPTIONS' => $s_birthday_month_options, @@ -1120,51 +1160,44 @@ class acp_users case 'prefs': - $data = array(); + $data = array( + 'dateformat' => request_var('dateformat', $user_row['user_dateformat']), + 'lang' => request_var('lang', $user_row['user_lang']), + 'tz' => request_var('tz', (float) $user_row['user_timezone']), + 'style' => request_var('style', $user_row['user_style']), + 'dst' => request_var('dst', $user_row['user_dst']), + 'viewemail' => request_var('viewemail', $user_row['user_allow_viewemail']), + 'massemail' => request_var('massemail', $user_row['user_allow_massemail']), + 'hideonline' => request_var('hideonline', !$user_row['user_allow_viewonline']), + 'notifymethod' => request_var('notifymethod', $user_row['user_notify_type']), + 'notifypm' => request_var('notifypm', $user_row['user_notify_pm']), + 'popuppm' => request_var('popuppm', $this->optionget($user_row, 'popuppm')), + 'allowpm' => request_var('allowpm', $user_row['user_allow_pm']), + + 'topic_sk' => request_var('topic_sk', ($user_row['user_topic_sortby_type']) ? $user_row['user_topic_sortby_type'] : 't'), + 'topic_sd' => request_var('topic_sd', ($user_row['user_topic_sortby_dir']) ? $user_row['user_topic_sortby_dir'] : 'd'), + 'topic_st' => request_var('topic_st', ($user_row['user_topic_show_days']) ? $user_row['user_topic_show_days'] : 0), + + 'post_sk' => request_var('post_sk', ($user_row['user_post_sortby_type']) ? $user_row['user_post_sortby_type'] : 't'), + 'post_sd' => request_var('post_sd', ($user_row['user_post_sortby_dir']) ? $user_row['user_post_sortby_dir'] : 'a'), + 'post_st' => request_var('post_st', ($user_row['user_post_show_days']) ? $user_row['user_post_show_days'] : 0), + + 'view_images' => request_var('view_images', $this->optionget($user_row, 'viewimg')), + 'view_flash' => request_var('view_flash', $this->optionget($user_row, 'viewflash')), + 'view_smilies' => request_var('view_smilies', $this->optionget($user_row, 'viewsmilies')), + 'view_sigs' => request_var('view_sigs', $this->optionget($user_row, 'viewsigs')), + 'view_avatars' => request_var('view_avatars', $this->optionget($user_row, 'viewavatars')), + 'view_wordcensor' => request_var('view_wordcensore', $this->optionget($user_row, 'viewcensors')), + + 'bbcode' => request_var('bbcode', $this->optionget($user_row, 'bbcode')), + 'smilies' => request_var('smilies', $this->optionget($user_row, 'smilies')), + 'sig' => request_var('sig', $this->optionget($user_row, 'attachsig')), + 'notify' => request_var('notify', $user_row['user_notify']), + ); if ($submit) { - $var_ary = array( - 'dateformat' => (string) $config['default_dateformat'], - 'lang' => (string) $config['default_lang'], - 'tz' => (float) $config['board_timezone'], - 'style' => (int) $config['default_style'], - 'dst' => (bool) $config['board_dst'], - 'viewemail' => false, - 'massemail' => true, - 'hideonline' => false, - 'notifymethod' => 0, - 'notifypm' => true, - 'popuppm' => false, - 'allowpm' => true, - - 'topic_sk' => (string) 't', - 'topic_sd' => (string) 'd', - 'topic_st' => 0, - - 'post_sk' => (string) 't', - 'post_sd' => (string) 'a', - 'post_st' => 0, - - 'view_images' => true, - 'view_flash' => false, - 'view_smilies' => true, - 'view_sigs' => true, - 'view_avatars' => true, - 'view_wordcensor' => false, - - 'bbcode' => true, - 'smilies' => true, - 'sig' => true, - 'notify' => false, - ); - - foreach ($var_ary as $var => $default) - { - $data[$var] = request_var($var, $default); - } - - $var_ary = array( + $error = validate_data($data, array( 'dateformat' => array('string', false, 3, 30), 'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'), 'tz' => array('num', false, -14, 14), @@ -1173,9 +1206,7 @@ class acp_users 'topic_sd' => array('string', false, 1, 1), 'post_sk' => array('string', false, 1, 1), 'post_sd' => array('string', false, 1, 1), - ); - - $error = validate_data($data, $var_ary); + )); if (!sizeof($error)) { @@ -1229,17 +1260,10 @@ class acp_users $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error); } - $notify_method = (isset($data['notifymethod'])) ? $data['notifymethod'] : $user_row['user_notify_type']; - $dateformat = (isset($data['dateformat'])) ? $data['dateformat'] : $user_row['user_dateformat']; - $lang = (isset($data['lang'])) ? $data['lang'] : $user_row['user_lang']; - $style = (isset($data['style'])) ? $data['style'] : $user_row['user_style']; - $tz = (isset($data['tz'])) ? $data['tz'] : $user_row['user_timezone']; - $dateformat_options = ''; - foreach ($user->lang['dateformats'] as $format => $null) { - $dateformat_options .= '<option value="' . $format . '"' . (($format == $dateformat) ? ' selected="selected"' : '') . '>'; + $dateformat_options .= '<option value="' . $format . '"' . (($format == $data['dateformat']) ? ' selected="selected"' : '') . '>'; $dateformat_options .= $user->format_date(time(), $format, true) . ((strpos($format, '|') !== false) ? ' [' . $user->lang['RELATIVE_DAYS'] . ']' : ''); $dateformat_options .= '</option>'; } @@ -1247,22 +1271,13 @@ class acp_users $s_custom = false; $dateformat_options .= '<option value="custom"'; - if (!in_array($dateformat, array_keys($user->lang['dateformats']))) + if (!in_array($data['dateformat'], array_keys($user->lang['dateformats']))) { $dateformat_options .= ' selected="selected"'; $s_custom = true; } $dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>'; - $topic_sk = (isset($data['topic_sk'])) ? $data['topic_sk'] : (($user_row['user_topic_sortby_type']) ? $user_row['user_topic_sortby_type'] : 't'); - $post_sk = (isset($data['post_sk'])) ? $data['post_sk'] : (($user_row['user_post_sortby_type']) ? $user_row['user_post_sortby_type'] : 't'); - - $topic_sd = (isset($data['topic_sd'])) ? $data['topic_sd'] : (($user_row['user_topic_sortby_dir']) ? $user_row['user_topic_sortby_dir'] : 'd'); - $post_sd = (isset($data['post_sd'])) ? $data['post_sd'] : (($user_row['user_post_sortby_dir']) ? $user_row['user_post_sortby_dir'] : 'd'); - - $topic_st = (isset($data['topic_st'])) ? $data['topic_st'] : (($user_row['user_topic_show_days']) ? $user_row['user_topic_show_days'] : 0); - $post_st = (isset($data['post_st'])) ? $data['post_st'] : (($user_row['user_post_show_days']) ? $user_row['user_post_show_days'] : 0); - $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); // Topic ordering options @@ -1279,7 +1294,7 @@ class acp_users ${'s_limit_' . $sort_option . '_days'} = '<select name="' . $sort_option . '_st">'; foreach (${'limit_' . $sort_option . '_days'} as $day => $text) { - $selected = (${$sort_option . '_st'} == $day) ? ' selected="selected"' : ''; + $selected = ($data[$sort_option . '_st'] == $day) ? ' selected="selected"' : ''; ${'s_limit_' . $sort_option . '_days'} .= '<option value="' . $day . '"' . $selected . '>' . $text . '</option>'; } ${'s_limit_' . $sort_option . '_days'} .= '</select>'; @@ -1287,7 +1302,7 @@ class acp_users ${'s_sort_' . $sort_option . '_key'} = '<select name="' . $sort_option . '_sk">'; foreach (${'sort_by_' . $sort_option . '_text'} as $key => $text) { - $selected = (${$sort_option . '_sk'} == $key) ? ' selected="selected"' : ''; + $selected = ($data[$sort_option . '_sk'] == $key) ? ' selected="selected"' : ''; ${'s_sort_' . $sort_option . '_key'} .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>'; } ${'s_sort_' . $sort_option . '_key'} .= '</select>'; @@ -1295,7 +1310,7 @@ class acp_users ${'s_sort_' . $sort_option . '_dir'} = '<select name="' . $sort_option . '_sd">'; foreach ($sort_dir_text as $key => $value) { - $selected = (${$sort_option . '_sd'} == $key) ? ' selected="selected"' : ''; + $selected = ($data[$sort_option . '_sd'] == $key) ? ' selected="selected"' : ''; ${'s_sort_' . $sort_option . '_dir'} .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>'; } ${'s_sort_' . $sort_option . '_dir'} .= '</select>'; @@ -1303,28 +1318,28 @@ class acp_users $template->assign_vars(array( 'S_PREFS' => true, - 'S_JABBER_DISABLED' => ($config['jab_enable'] && $user->data['user_jabber'] && @extension_loaded('xml')) ? false : true, + 'S_JABBER_DISABLED' => ($config['jab_enable'] && $user_row['user_jabber'] && @extension_loaded('xml')) ? false : true, - 'VIEW_EMAIL' => (isset($data['viewemail'])) ? $data['viewemail'] : $user_row['user_allow_viewemail'], - 'MASS_EMAIL' => (isset($data['massemail'])) ? $data['massemail'] : $user_row['user_allow_massemail'], - 'ALLOW_PM' => (isset($data['allowpm'])) ? $data['allowpm'] : $user_row['user_allow_pm'], - 'HIDE_ONLINE' => (isset($data['hideonline'])) ? $data['hideonline'] : !$user_row['user_allow_viewonline'], - 'NOTIFY_EMAIL' => ($notify_method == NOTIFY_EMAIL) ? true : false, - 'NOTIFY_IM' => ($notify_method == NOTIFY_IM) ? true : false, - 'NOTIFY_BOTH' => ($notify_method == NOTIFY_BOTH) ? true : false, - 'NOTIFY_PM' => (isset($data['notifypm'])) ? $data['notifypm'] : $user_row['user_notify_pm'], - 'POPUP_PM' => (isset($data['popuppm'])) ? $data['popuppm'] : $this->optionget($user_row, 'popuppm'), - 'DST' => (isset($data['dst'])) ? $data['dst'] : $user_row['user_dst'], - 'BBCODE' => (isset($data['bbcode'])) ? $data['bbcode'] : $this->optionget($user_row, 'bbcode'), - 'SMILIES' => (isset($data['smilies'])) ? $data['smilies'] : $this->optionget($user_row, 'smilies'), - 'ATTACH_SIG' => (isset($data['sig'])) ? $data['sig'] : $this->optionget($user_row, 'attachsig'), - 'NOTIFY' => (isset($data['notify'])) ? $data['notify'] : $user_row['user_notify'], - 'VIEW_IMAGES' => (isset($data['view_images'])) ? $data['view_images'] : $this->optionget($user_row, 'viewimg'), - 'VIEW_FLASH' => (isset($data['view_flash'])) ? $data['view_flash'] : $this->optionget($user_row, 'viewflash'), - 'VIEW_SMILIES' => (isset($data['view_smilies'])) ? $data['view_smilies'] : $this->optionget($user_row, 'viewsmilies'), - 'VIEW_SIGS' => (isset($data['view_sigs'])) ? $data['view_sigs'] : $this->optionget($user_row, 'viewsigs'), - 'VIEW_AVATARS' => (isset($data['view_avatars'])) ? $data['view_avatars'] : $this->optionget($user_row, 'viewavatars'), - 'VIEW_WORDCENSOR' => (isset($data['view_wordcensor'])) ? $data['view_wordcensor'] : $this->optionget($user_row, 'viewcensors'), + 'VIEW_EMAIL' => $data['viewemail'], + 'MASS_EMAIL' => $data['massemail'], + 'ALLOW_PM' => $data['allowpm'], + 'HIDE_ONLINE' => $data['hideonline'], + 'NOTIFY_EMAIL' => ($data['notifymethod'] == NOTIFY_EMAIL) ? true : false, + 'NOTIFY_IM' => ($data['notifymethod'] == NOTIFY_IM) ? true : false, + 'NOTIFY_BOTH' => ($data['notifymethod'] == NOTIFY_BOTH) ? true : false, + 'NOTIFY_PM' => $data['notifypm'], + 'POPUP_PM' => $data['popuppm'], + 'DST' => $data['dst'], + 'BBCODE' => $data['bbcode'], + 'SMILIES' => $data['smilies'], + 'ATTACH_SIG' => $data['sig'], + 'NOTIFY' => $data['notify'], + 'VIEW_IMAGES' => $data['view_images'], + 'VIEW_FLASH' => $data['view_flash'], + 'VIEW_SMILIES' => $data['view_smilies'], + 'VIEW_SIGS' => $data['view_sigs'], + 'VIEW_AVATARS' => $data['view_avatars'], + 'VIEW_WORDCENSOR' => $data['view_wordcensor'], 'S_TOPIC_SORT_DAYS' => $s_limit_topic_days, 'S_TOPIC_SORT_KEY' => $s_sort_topic_key, @@ -1333,15 +1348,15 @@ class acp_users 'S_POST_SORT_KEY' => $s_sort_post_key, 'S_POST_SORT_DIR' => $s_sort_post_dir, - 'DATE_FORMAT' => $dateformat, + 'DATE_FORMAT' => $data['dateformat'], 'S_DATEFORMAT_OPTIONS' => $dateformat_options, 'S_CUSTOM_DATEFORMAT' => $s_custom, 'DEFAULT_DATEFORMAT' => $config['default_dateformat'], 'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']), - 'S_LANG_OPTIONS' => language_select($lang), - 'S_STYLE_OPTIONS' => style_select($style), - 'S_TZ_OPTIONS' => tz_select($tz, true), + 'S_LANG_OPTIONS' => language_select($data['lang']), + 'S_STYLE_OPTIONS' => style_select($data['style']), + 'S_TZ_OPTIONS' => tz_select($data['tz'], true), ) ); @@ -1359,26 +1374,19 @@ class acp_users { $delete = request_var('delete', ''); - $var_ary = array( - 'uploadurl' => (string) '', - 'remotelink' => (string) '', - 'width' => (string) '', - 'height' => (string) '', + $data = array( + 'uploadurl' => request_var('uploadurl', ''), + 'remotelink' => request_var('remotelink', ''), + 'width' => request_var('width', ''), + 'height' => request_var('height', ''), ); - foreach ($var_ary as $var => $default) - { - $data[$var] = request_var($var, $default); - } - - $var_ary = array( + $error = validate_data($data, array( 'uploadurl' => array('string', true, 5, 255), 'remotelink' => array('string', true, 5, 255), 'width' => array('string', true, 1, 3), 'height' => array('string', true, 1, 3), - ); - - $error = validate_data($data, $var_ary); + )); if (!sizeof($error)) { @@ -1440,7 +1448,7 @@ class acp_users // Delete old avatar if present if ($user_row['user_avatar'] && $filename != $user_row['user_avatar'] && $user_row['user_avatar_type'] != AVATAR_GALLERY) { - avatar_delete($user_row['user_avatar']); + avatar_delete('user', $user_row); } } @@ -1545,6 +1553,8 @@ class acp_users $enable_urls = request_var('enable_urls', true); $signature = request_var('signature', $user_row['user_sig'], true); + utf8_normalize_nfc(&$signature); + $preview = (isset($_POST['preview'])) ? true : false; if ($submit || $preview) @@ -1554,7 +1564,7 @@ class acp_users $message_parser = new parse_message($signature); // Allowing Quote BBCode - $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, true, 'sig'); + $message_parser->parse($enable_bbcode, ($config['allow_sig_links']) ? $enable_urls : false, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig'); if (sizeof($message_parser->warn_msg)) { @@ -1566,7 +1576,7 @@ class acp_users $sql_ary = array( 'user_sig' => (string) $message_parser->message, 'user_sig_bbcode_uid' => (string) $message_parser->bbcode_uid, - 'user_sig_bbcode_bitfield' => (int) $message_parser->bbcode_bitfield + 'user_sig_bbcode_bitfield' => (string) $message_parser->bbcode_bitfield ); $sql = 'UPDATE ' . USERS_TABLE . ' @@ -1602,17 +1612,19 @@ class acp_users 'S_SMILIES_CHECKED' => (!$enable_smilies) ? 'checked="checked"' : '', 'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? 'checked="checked"' : '', - 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '" onclick="target=\'_phpbbcode\';">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '" onclick="target=\'_phpbbcode\';">', '</a>'), + 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'), 'SMILIES_STATUS' => ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], 'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], 'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], + 'URL_STATUS' => ($config['allow_sig_links']) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'], 'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']), 'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'], 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'], 'S_BBCODE_IMG' => ($config['allow_sig_img']) ? true : false, - 'S_BBCODE_FLASH' => ($config['allow_sig_flash']) ? true : false) + 'S_BBCODE_FLASH' => ($config['allow_sig_flash']) ? true : false, + 'S_LINKS_ALLOWED' => ($config['allow_sig_links']) ? true : false) ); // Assigning custom bbcodes @@ -1686,7 +1698,12 @@ class acp_users $s_sort_dir .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>'; } - $order_by = $sk_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); + if (!isset($sk_sql[$sort_key])) + { + $sort_key = 'a'; + } + + $order_by = $sk_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); $sql = 'SELECT COUNT(attach_id) as num_attachments FROM ' . ATTACHMENTS_TABLE . " @@ -1772,12 +1789,12 @@ class acp_users { if (!$group_id) { - trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id)); + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } if ($error = group_user_del($group_id, $user_id)) { - trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&u=' . $user_id)); + trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } $error = array(); @@ -1801,13 +1818,13 @@ class acp_users { if (!$group_id) { - trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id)); + trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } // Add user/s to group if ($error = group_user_add($group_id, $user_id)) { - trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&u=' . $user_id)); + trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } $error = array(); @@ -1847,11 +1864,11 @@ class acp_users $s_group_options = ''; while ($row = $db->sql_fetchrow($result)) { - if (!$config['coppa_enable'] && in_array($row['group_name'], array('INACTIVE_COPPA', 'REGISTERED_COPPA'))) + if (!$config['coppa_enable'] && $row['group_name'] == 'REGISTERED_COPPA') { continue; } - + $s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>'; } $db->sql_freeresult($result); @@ -1899,14 +1916,14 @@ class acp_users $auth_admin = new auth_admin(); $user->add_lang('acp/permissions'); - $user->add_lang('acp/permissions_phpbb'); + add_permission_language(); // Select auth options $sql = 'SELECT auth_option, is_local, is_global FROM ' . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE '%\_'"; - if (SQL_LAYER == 'mssql' || SQL_LAYER == 'mssql_odbc') + if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') { $sql .= " ESCAPE '\\'"; } @@ -1926,7 +1943,7 @@ class acp_users FROM ' . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE '%\_'"; - if (SQL_LAYER == 'mssql' || SQL_LAYER == 'mssql_odbc') + if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') { $sql .= " ESCAPE '\\'"; } diff --git a/phpBB/includes/acp/acp_words.php b/phpBB/includes/acp/acp_words.php index cacea98d97..8fe99b8c80 100644 --- a/phpBB/includes/acp/acp_words.php +++ b/phpBB/includes/acp/acp_words.php @@ -40,7 +40,7 @@ class acp_words if (!$word_id) { - trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'SELECT * @@ -71,10 +71,12 @@ class acp_words $word_id = request_var('id', 0); $word = request_var('word', '', true); $replacement = request_var('replacement', '', true); + + utf8_normalize_nfc(array(&$word, &$replacement)); if (!$word || !$replacement) { - trigger_error($user->lang['ENTER_WORD'] . adm_back_link($this->u_action)); + trigger_error($user->lang['ENTER_WORD'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql_ary = array( @@ -107,7 +109,7 @@ class acp_words if (!$word_id) { - trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'SELECT word diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 71d17bd40d..436e3f017b 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -724,24 +724,7 @@ class auth_admin extends auth } } - if (sizeof($sql_ary)) - { - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query('INSERT INTO ' . ACL_OPTIONS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); - break; - - default: - foreach ($sql_ary as $ary) - { - $db->sql_query('INSERT INTO ' . ACL_OPTIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; - } - } + $db->sql_multi_insert(ACL_OPTIONS_TABLE, $sql_ary); $cache->destroy('acl_options'); $this->acl_clear_prefetch(); @@ -874,24 +857,7 @@ class auth_admin extends auth } } - if (sizeof($sql_ary)) - { - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query("INSERT INTO $table " . $db->sql_build_array('MULTI_INSERT', $sql_ary)); - break; - - default: - foreach ($sql_ary as $ary) - { - $db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $ary)); - } - break; - } - } + $db->sql_multi_insert($table, $sql_ary); if ($clear_prefetch) { @@ -956,21 +922,8 @@ class auth_admin extends auth WHERE role_id = ' . $role_id; $db->sql_query($sql); - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query('INSERT INTO ' . ACL_ROLES_DATA_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); - break; - - default: - foreach ($sql_ary as $ary) - { - $db->sql_query('INSERT INTO ' . ACL_ROLES_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; - } + // Now insert the new values + $db->sql_multi_insert(ACL_ROLES_DATA_TABLE, $sql_ary); $this->acl_clear_prefetch(); } @@ -1009,7 +962,9 @@ class auth_admin extends auth // Get permission type $sql = 'SELECT auth_option, auth_option_id FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option LIKE '" . $db->sql_escape($permission_type) . "%'"; + WHERE auth_option LIKE '" . $db->sql_escape(str_replace('_', "\_", $permission_type)) . "%'"; + $sql .= ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : ''; + $result = $db->sql_query($sql); $auth_id_ary = array(); diff --git a/phpBB/includes/acp/info/acp_inactive.php b/phpBB/includes/acp/info/acp_inactive.php new file mode 100755 index 0000000000..bee9d977d4 --- /dev/null +++ b/phpBB/includes/acp/info/acp_inactive.php @@ -0,0 +1,37 @@ +<?php +/** +* +* @package acp +* @version $Id$ +* @copyright (c) 2006 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* @package module_install +*/ +class acp_inactive_info +{ + function module() + { + return array( + 'filename' => 'acp_inactive', + 'title' => 'ACP_INACTIVE_USERS', + 'version' => '1.0.0', + 'modes' => array( + 'list' => array('title' => 'ACP_INACTIVE_USERS', 'auth' => 'acl_a_user', 'cat' => array('ACP_CAT_USERS')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} + +?>
\ No newline at end of file diff --git a/phpBB/includes/acp/info/acp_update.php b/phpBB/includes/acp/info/acp_update.php new file mode 100644 index 0000000000..014d67ff2b --- /dev/null +++ b/phpBB/includes/acp/info/acp_update.php @@ -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_update_info +{ + function module() + { + return array( + 'filename' => 'acp_update', + 'title' => 'ACP_UPDATE', + 'version' => '1.0.0', + 'modes' => array( + 'version_check' => array('title' => 'ACP_VERSION_CHECK', 'auth' => 'acl_a_', 'cat' => array('ACP_AUTOMATION')), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} + +?>
\ No newline at end of file diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index 4e6a8af1d8..8ee4a23abb 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -396,7 +396,7 @@ class auth $hold_str .= str_repeat("\n", $f - $last_f); // Convert bitstring for storage - we do not use binary/bytes because PHP's string functions are not fully binary safe - for ($i = 0; $i < strlen($bitstring); $i += 31) + for ($i = 0, $bit_length = strlen($bitstring); $i < $bit_length; $i += 31) { $hold_str .= str_pad(base_convert(str_pad(substr($bitstring, $i, 31), 31, 0, STR_PAD_RIGHT), 2, 36), 6, 0, STR_PAD_LEFT); } @@ -478,18 +478,11 @@ class auth $sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? "user_id = $user_id" : $db->sql_in_set('user_id', $user_id)) : ''; $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND ' . $db->sql_in_set('a.forum_id', $forum_id)) : ''; - $sql_opts = ''; + $sql_opts = $sql_escape = ''; if ($opts !== false) { - if (!is_array($opts)) - { - $sql_opts = (strpos($opts, '%') !== false) ? "AND ao.auth_option LIKE '" . $db->sql_escape($opts) . "'" : "AND ao.auth_option = '" . $db->sql_escape($opts) . "'"; - } - else - { - $sql_opts = 'AND ' . $db->sql_in_set('ao.auth_option', $opts); - } + $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts, $sql_escape); } $hold_ary = array(); @@ -519,7 +512,7 @@ class auth 'ORDER_BY' => 'a.forum_id, ao.auth_option' )); - $result = $db->sql_query($sql); + $result = $db->sql_query($sql . $sql_escape); while ($row = $db->sql_fetchrow($result)) { @@ -595,18 +588,11 @@ class auth $sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? "user_id = $user_id" : $db->sql_in_set('user_id', $user_id)) : ''; $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND ' . $db->sql_in_set('a.forum_id', $forum_id)) : ''; - $sql_opts = ''; + $sql_opts = $sql_escape = ''; if ($opts !== false) { - if (!is_array($opts)) - { - $sql_opts = (strpos($opts, '%') !== false) ? "AND ao.auth_option LIKE '" . $db->sql_escape($opts) . "'" : "AND ao.auth_option = '" . $db->sql_escape($opts) . "'"; - } - else - { - $sql_opts = 'AND ' . $db->sql_in_set('ao.auth_option', $opts); - } + $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts, $sql_escape); } $hold_ary = array(); @@ -634,7 +620,7 @@ class auth 'ORDER_BY' => 'a.forum_id, ao.auth_option' )); - $result = $db->sql_query($sql); + $result = $db->sql_query($sql . $sql_escape); while ($row = $db->sql_fetchrow($result)) { @@ -656,16 +642,11 @@ class auth $sql_group = ($group_id !== false) ? ((!is_array($group_id)) ? "group_id = $group_id" : $db->sql_in_set('group_id', $group_id)) : ''; $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND ' . $db->sql_in_set('a.forum_id', $forum_id)) : ''; + $sql_opts = $sql_escape = ''; + if ($opts !== false) { - if (!is_array($opts)) - { - $sql_opts = (strpos($opts, '%') !== false) ? "AND ao.auth_option LIKE '" . $db->sql_escape($opts) . "'" : "AND ao.auth_option = '" . $db->sql_escape($opts) . "'"; - } - else - { - $sql_opts = 'AND ' . $db->sql_in_set('ao.auth_option', $opts); - } + $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts, $sql_escape); } $hold_ary = array(); @@ -693,7 +674,7 @@ class auth 'ORDER_BY' => 'a.forum_id, ao.auth_option' )); - $result = $db->sql_query($sql); + $result = $db->sql_query($sql . $sql_escape); while ($row = $db->sql_fetchrow($result)) { @@ -726,14 +707,14 @@ class auth // we are going to use the user_add function so include functions_user.php if it wasn't defined yet if (!function_exists('user_add')) { - include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } user_add($login['user_row'], (isset($login['cp_data'])) ? $login['cp_data'] : false); $sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type FROM ' . USERS_TABLE . " - WHERE username = '" . $db->sql_escape($username) . "'"; + WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -757,11 +738,36 @@ class auth // If login succeeded, we will log the user in... else we pass the login array through... if ($login['status'] == LOGIN_SUCCESS) { + $old_session_id = $user->session_id; + + if ($admin) + { + global $SID, $_SID; + + $cookie_expire = time() - 31536000; + $user->set_cookie('u', '', $cookie_expire); + $user->set_cookie('sid', '', $cookie_expire); + unset($cookie_expire); + + $SID = '?sid='; + $user->session_id = $_SID = ''; + } + $result = $user->session_create($login['user_row']['user_id'], $admin, $autologin, $viewonline); // Successful session creation if ($result === true) { + // If admin re-authentication we remove the old session entry because a new one has been created... + if ($admin) + { + // the login array is used because the user ids do not differ for re-authentication + $sql = 'DELETE FROM ' . SESSIONS_TABLE . " + WHERE session_id = '" . $db->sql_escape($old_session_id) . "' + AND session_user_id = {$login['user_row']['user_id']}"; + $db->sql_query($sql); + } + return array( 'status' => LOGIN_SUCCESS, 'error_msg' => false, @@ -781,6 +787,72 @@ class auth trigger_error('Authentication method not found', E_USER_ERROR); } + + /** + * Fill auth_option statement for later querying based on the supplied options + */ + function build_auth_option_statement($key, $auth_options, &$sql_opts, &$sql_escape) + { + global $db; + + if (!is_array($auth_options)) + { + if (strpos($auth_options, '%') !== false) + { + if (strpos($auth_options, '_') !== false) + { + $sql_opts = "AND $key LIKE '" . $db->sql_escape(str_replace('_', "\_", $auth_options)) . "'"; + $sql_escape = ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : ''; + } + else + { + $sql_opts = "AND $key LIKE '" . $db->sql_escape($auth_options) . "'"; + } + } + else + { + $sql_opts = "AND $key = '" . $db->sql_escape($auth_options) . "'"; + } + } + else + { + $is_like_expression = $is_underline = false; + + foreach ($auth_options as $option) + { + if (strpos($option, '%') !== false) + { + $is_like_expression = true; + } + + if (strpos($option, '_') !== false) + { + $is_underline = true; + } + } + + if (!$is_like_expression) + { + $sql_opts = 'AND ' . $db->sql_in_set($key, $auth_options); + } + else + { + $sql = array(); + + foreach ($auth_options as $option) + { + $sql[] = $key . " LIKE '" . $db->sql_escape(str_replace('_', "\_", $option)) . "'"; + } + + $sql_opts = 'AND (' . implode(' OR ', $sql) . ')'; + + if ($is_underline) + { + $sql_escape = ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : ''; + } + } + } + } } ?>
\ No newline at end of file diff --git a/phpBB/includes/auth/auth_apache.php b/phpBB/includes/auth/auth_apache.php index 3ee0f1347f..4c8293c707 100644 --- a/phpBB/includes/auth/auth_apache.php +++ b/phpBB/includes/auth/auth_apache.php @@ -136,12 +136,19 @@ function autologin_apache() return ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE) ? array() : $row; } + if (!function_exists('user_add')) + { + global $phpbb_root_path, $phpEx; + + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + } + // create the user if he does not exist yet user_add(user_row_apache($php_auth_user, $php_auth_pw)); $sql = 'SELECT * FROM ' . USERS_TABLE . " - WHERE username = '" . $db->sql_escape($php_auth_user) . "'"; + WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($php_auth_user)) . "'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -178,7 +185,7 @@ function user_row_apache($username, $password) // generate user account data return array( 'username' => $username, - 'user_password' => $password, + 'user_password' => md5($password), 'user_email' => '', 'group_id' => (int) $row['group_id'], 'user_type' => USER_NORMAL, diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php index 9477fd92c3..618ad0a387 100644 --- a/phpBB/includes/auth/auth_db.php +++ b/phpBB/includes/auth/auth_db.php @@ -22,7 +22,7 @@ function login_db(&$username, &$password) $sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type, user_login_attempts FROM ' . USERS_TABLE . " - WHERE username = '" . $db->sql_escape($username) . "'"; + WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); diff --git a/phpBB/includes/auth/auth_ldap.php b/phpBB/includes/auth/auth_ldap.php index 889f6d8661..988da577c0 100644 --- a/phpBB/includes/auth/auth_ldap.php +++ b/phpBB/includes/auth/auth_ldap.php @@ -38,7 +38,7 @@ function init_ldap() $search = @ldap_search( $ldap, $config['ldap_base_dn'], - '(' . $config['ldap_uid'] . '=' . ldap_escape(html_entity_decode($user->data['username'])) . ')', + '(' . $config['ldap_uid'] . '=' . ldap_escape(htmlspecialchars_decode($user->data['username'])) . ')', (empty($config['ldap_email'])) ? array($config['ldap_uid']) : array($config['ldap_uid'], $config['ldap_email']), 0, 1 @@ -98,7 +98,7 @@ function login_ldap(&$username, &$password) $search = @ldap_search( $ldap, $config['ldap_base_dn'], - '(' . $config['ldap_uid'] . '=' . ldap_escape(html_entity_decode($username)) . ')', + '(' . $config['ldap_uid'] . '=' . ldap_escape(htmlspecialchars_decode($username)) . ')', (empty($config['ldap_email'])) ? array($config['ldap_uid']) : array($config['ldap_uid'], $config['ldap_email']), 0, 1 @@ -108,13 +108,13 @@ function login_ldap(&$username, &$password) if (is_array($ldap_result) && sizeof($ldap_result) > 1) { - if (@ldap_bind($ldap, $ldap_result[0]['dn'], html_entity_decode($password))) + if (@ldap_bind($ldap, $ldap_result[0]['dn'], htmlspecialchars_decode($password))) { @ldap_close($ldap); $sql ='SELECT user_id, username, user_password, user_passchg, user_email, user_type FROM ' . USERS_TABLE . " - WHERE username = '" . $db->sql_escape($username) . "'"; + WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -159,7 +159,7 @@ function login_ldap(&$username, &$password) // generate user account data $ldap_user_row = array( 'username' => $username, - 'user_password' => $password, + 'user_password' => md5($password), 'user_email' => (!empty($config['ldap_email'])) ? $ldap_result[0][$config['ldap_email']][0] : '', 'group_id' => (int) $row['group_id'], 'user_type' => USER_NORMAL, diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 7293f07dc9..409aab18e4 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -155,6 +155,12 @@ class bbcode while ($row = $db->sql_fetchrow($result)) { + // To circumvent replacing newlines with <br /> for the generated html, + // we just remove newlines here. We do not do this within the admin panel to + // let the admin lay out his html code nicely + $row['bbcode_tpl'] = str_replace(array("\n", "\r"), '', $row['bbcode_tpl']); + $row['second_pass_replace'] = str_replace(array("\n", "\r"), '', $row['second_pass_replace']); + $rowset[$row['bbcode_id']] = $row; } $db->sql_freeresult($result); @@ -530,7 +536,7 @@ class bbcode $username = str_replace('\"', '"', $username); // remove newline at the beginning - if ($quote{0} == "\n") + if ($quote[0] == "\n") { $quote = substr($quote, 1); } @@ -566,7 +572,7 @@ class bbcode $code = str_replace(' ', ' ', $code); // remove newline at the beginning - if (!empty($code) && $code{0} == "\n") + if (!empty($code) && $code[0] == "\n") { $code = substr($code, 1); } diff --git a/phpBB/includes/cache.php b/phpBB/includes/cache.php index a3a251d194..6266d32c0f 100644 --- a/phpBB/includes/cache.php +++ b/phpBB/includes/cache.php @@ -70,13 +70,13 @@ class cache extends acm * Obtain list of naughty words and build preg style replacement arrays for use by the * calling script */ - function obtain_word_list(&$censors) + function obtain_word_list() { global $config, $user, $db; if (!$user->optionget('viewcensors') && $config['allow_nocensors']) { - return false; + return array(); } if (($censors = $this->get('word_censors')) === false) @@ -96,13 +96,13 @@ class cache extends acm $this->put('word_censors', $censors); } - return true; + return $censors; } /** * Obtain currently listed icons */ - function obtain_icons(&$icons) + function obtain_icons() { if (($icons = $this->get('icons')) === false) { @@ -127,13 +127,13 @@ class cache extends acm $this->put('icons', $icons); } - return; + return $icons; } /** * Obtain ranks */ - function obtain_ranks(&$ranks) + function obtain_ranks() { if (($ranks = $this->get('ranks')) === false) { @@ -168,13 +168,13 @@ class cache extends acm $this->put('ranks', $ranks); } - return; + return $ranks; } /** * Obtain allowed extensions */ - function obtain_attach_extensions(&$extensions, $forum_id = false) + function obtain_attach_extensions($forum_id = false) { if (($extensions = $this->get('_extensions')) === false) { @@ -254,19 +254,19 @@ class cache extends acm $extensions['_allowed_'] = array(); } - return; + return $extensions; } /** * Obtain active bots */ - function obtain_bots(&$bots) + function obtain_bots() { if (($bots = $this->get('bots')) === false) { global $db; - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mssql': case 'mssql_odbc': @@ -280,7 +280,7 @@ class cache extends acm $sql = 'SELECT user_id, bot_agent, bot_ip FROM ' . BOTS_TABLE . ' WHERE bot_active = 1 - ORDER BY STRLEN(bot_agent) DESC'; + ORDER BY CHAR_LENGTH(bot_agent) DESC'; break; // LENGTH supported by MySQL, IBM DB2 and Oracle for sure... @@ -303,7 +303,7 @@ class cache extends acm $this->put('bots', $bots); } - return; + return $bots; } /** @@ -354,6 +354,32 @@ class cache extends acm return $parsed_items; } + + /** + * Obtain disallowed usernames + */ + function obtain_disallowed_usernames() + { + if (($usernames = $this->get('_disallowed_usernames')) === false) + { + global $db; + + $sql = 'SELECT disallow_username + FROM ' . DISALLOW_TABLE; + $result = $db->sql_query($sql); + + $usernames = array(); + while ($row = $db->sql_fetchrow($result)) + { + $usernames[] = utf8_clean_string(str_replace('%', '.*?', preg_quote($row['disallow_username'], '$#'))); + } + $db->sql_freeresult($result); + + $this->put('_disallowed_usernames', $usernames); + } + + return $usernames; + } } ?>
\ No newline at end of file diff --git a/phpBB/includes/captcha/captcha_gd.php b/phpBB/includes/captcha/captcha_gd.php index 8a2bf70242..e249a46c04 100644 --- a/phpBB/includes/captcha/captcha_gd.php +++ b/phpBB/includes/captcha/captcha_gd.php @@ -8,3420 +8,158 @@ * */ - /** -* Main gd based captcha class -* -* Thanks to Robert Hetzler (Xore) +* Based on PHP-Class hn_captcha Version 1.3, released 11-Apr-2006 +* Original Author - Horst Nogajski, horst@nogajski.de * * @package VC */ class captcha { - /** - * Create the image containing $code - */ - function execute($code, $policy) - { - $this->$policy(str_split($code)); - } - - /** - * Send image and destroy - */ - function send_image(&$image) - { - header('Content-Type: image/png'); - header('Cache-control: no-cache, no-store'); - imagepng($image); - imagedestroy($image); - } - - /** - * - */ - function wave_height($x, $y, $factor = 1, $tweak = 1) - { - 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 draw_shape($type, $img, $x_min, $y_min, $x_max, $y_max, $color) - { - switch ($type) - { - case 'Square': - imagefilledpolygon($img, array($x_min, $y_max, $x_min, $y_min, $x_max, $y_min, $x_max, $y_max), 4, $color); - break; - - case 'TriangleUp': - imagefilledpolygon($img, array($x_min, $y_max, ($x_min + $x_max) / 2, $y_min, $x_max, $y_max), 3, $color); - break; - - case 'TriangleDown': - imagefilledpolygon($img, array($x_min, $y_min, ($x_min + $x_max) / 2, $y_max, $x_max, $y_min), 3, $color); - break; - - case 'Circle': - imagefilledellipse($img, ($x_min + $x_max) / 2, ($y_min + $y_max) / 2, $x_max - $x_min, $y_max - $y_min, $color); - break; - } - } - - /** - * - */ - function draw_pattern($seed, $img, $x_min, $y_min, $x_max, $y_max, $colors, $thickness = 1) - { - $x_size = ($x_max - $x_min) / 4; - $y_size = ($y_max - $y_min) / 4; - $bitmap = substr($seed, 16, 4); - $numcolors = sizeof($colors) - 1; - for ($y = 0; $y < 4; ++$y) - { - $map = hexdec(substr($bitmap, $y, 1)); - for ($x = 0; $x < 4; ++$x) - { - if ($map & (1 << $x)) - { - $char = hexdec(substr($seed, ($y << 2) + $x, 1)); - if (!($char >> 2)) - { - switch ($char & 3) - { - case 0: - $shape = 'Circle'; - break; - - case 1: - $shape = 'Square'; - break; - - case 2: - $shape = 'TriangleUp'; - break; - - case 3: - $shape = 'TriangleDown'; - break; - } - $this->draw_shape($shape, $img, $x_min + ($x * $x_size), $y_min + ($y * $y_size), $x_min + (($x + 1) * $x_size), $y_min + (($y + 1) * $y_size), $colors[array_rand($colors)]); - } - } - } - } - - $cells = array(); - for ($i = 0; $i < 6; ++$i) - { - $cells = hexdec(substr($seed, 20 + ($i << 1), 2)); - $x1 = $cells & 3; - $cells = $cells >> 2; - $y1 = $cells & 3; - $cells = $cells >> 2; - $x2 = $cells & 3; - $cells = $cells >> 2; - $y2 = $cells & 3; - $x1_real = $x_min + (($x1 + 0.5) * $x_size); - $y1_real = $y_min + (($y1 + 0.5) * $y_size); - $x2_real = $x_min + (($x2 + 0.5) * $x_size); - $y2_real = $y_min + (($y2 + 0.5) * $y_size); - if ($thickness > 1) - { - imagesetthickness($img, $thickness); - } - imageline($img, $x1_real, $y1_real, $x2_real, $y2_real, $colors[array_rand($colors)]); - if ($thickness > 1) - { - imagesetthickness($img, 1); - } - } - } - - /** - * - */ - function get_char_string() - { - static $chars = false; - static $charcount = 0; - if (!$chars) - { - $chars = array_merge(range('A', 'Z'), range('1', '9')); - } - $word = ''; - for ($i = mt_rand(6, 8); $i > 0; --$i) - { - $word .= $chars[array_rand($chars)]; - } - return $word; - } - - /** - * shape - */ - function policy_shape($code) - { - global $config, $user; - // Generate image - $img_x = 800; - $img_y = 250; - $img = imagecreatetruecolor($img_x, $img_y); - - // Generate colors - $c = new color_manager($img, array( - 'random' => true, - 'min_saturation' => 70, - 'min_value' => 65, - )); - - $primaries = $c->color_scheme('background', 'tetradic', false); - - $noise = array_shift($primaries); - $noise = $c->mono_range($noise, 'value', 5, false); - $primaries = $c->mono_range($primaries, 'value', 5, false); - - // Generate code characters - $characters = array(); - $sizes = array(); - $bounding_boxes = array(); - $width_avail = $img_x; - $code_num = sizeof($code); - $char_class = $this->captcha_char('char_ttf'); - for ( $i = 0; $i < $code_num; ++$i ) - { - $characters[$i] = new $char_class($code[$i]); - list($min, $max) = $characters[$i]->range(); - $sizes[$i] = mt_rand($min, $max / 2); - $box = $characters[$i]->dimensions($sizes[$i]); - $width_avail -= ($box[2] - $box[0]); - $bounding_boxes[$i] = $box; - } - - // Redistribute leftover x-space - $offset = array(); - for ( $i = 0; $i < $code_num; ++$i ) - { - $denom = ($code_num - $i); - $denom = max(1.5, $denom); - $offset[$i] = mt_rand(0, (1.5 * $width_avail) / $denom); - $width_avail -= $offset[$i]; - } - - // Add some line noise - if ($config['policy_shape_noise_line']) - { - $this->noise_line($img, 0, 0, $img_x, $img_y, $c->r('background'), $primaries, $noise); - } - - $real = mt_rand(0, 3); - $patterns = array('', '', '', ''); - for ($i = 32; $i > 0; --$i) - { - $patterns[$i & 3] .= str_pad(dechex(mt_rand(0, 65535)), 4, '0', STR_PAD_LEFT); - } - - - for ($i = 0; $i < 4; ++$i) - { - /*if ($i) - { - $y = 5 + ($i * 60); - imageline($img, 550, $y, 650, $y, $fontcolors[0]); - }*/ - $this->draw_pattern($patterns[$i], $img, 525, 10 + ($i * 60), 575, ($i + 1) * 60, $primaries); - if ($i == $real) - { - $this->draw_pattern($patterns[$i], $img, 25, 25, 225, 225, $primaries, 3); - for ($j = 0; $j < $code_num; ++$j) - { - $character = new $char_class($code[$j]); - $character->drawchar(25, 600 + ($j * 25), 35 + ($i * 60), $img, $c->r('background'), $primaries); - } - } - else - { - $word = $this->get_char_string(); - for ($j = strlen($word) - 1; $j >= 0; --$j) - { - $character = new $char_class(substr($word, $j, 1)); - $character->drawchar(25, 600 + ($j * 25), 35 + ($i * 60), $img, $c->r('background'), $primaries); - } - } - } - - $count = sizeof($user->lang['CAPTCHA']['shape']); - $line_height = $img_y / ($count + 1); - for ($i = 0; $i < $count; ++$i) - { - $text = $user->lang['CAPTCHA']['shape'][$i]; - $line_width = strlen($text) * 4.5; // ( / 2, * 9 ) - imagestring($img, 6, ($img_x / 2) - $line_width - 1, $line_height * ($i + 1) - 1, $text, $c->r('black')); - imagestring($img, 6, ($img_x / 2) - $line_width - 1, $line_height * ($i + 1) + 1, $text, $c->r('black')); - imagestring($img, 6, ($img_x / 2) - $line_width + 1, $line_height * ($i + 1) + 1, $text, $c->r('black')); - imagestring($img, 6, ($img_x / 2) - $line_width + 1, $line_height * ($i + 1) - 1, $text, $c->r('black')); - imagestring($img, 6, ($img_x / 2) - $line_width, $line_height * ($i + 1), $text, $c->r('white')); - } - - - // Add some pixel noise - if ($config['policy_shape_noise_pixel']) - { - $this->noise_pixel($img, 0, 0, $img_x, $img_y, $c->r('background'), $primaries, $noise, $config['policy_shape_noise_pixel']); - } - - // Send image - $this->send_image($img); - } - - function policy_composite($code) - { - // Generate image - $img_x = 800; - $img_y = 250; - $img = imagecreate($img_x, $img_y); - - $map = captcha_vectors(); - $fonts = captcha_load_ttf_fonts(); - - // Generate basic colors - $c = new color_manager($img, 'white'); - $c->allocate_named('primary', array( - 'random' => true, - 'min_saturation' => 50, - 'min_value' => 75, - )); - $bg_colors = $c->color_scheme('primary', 'triadic', false); - $text_colors = $c->mono_range('primary', 'saturation', 6); - $bg_colors = $c->mono_range($bg_colors, 'saturation', 6); - - // Specificy image portion dimensions. - $count = sizeof($code); - $cellsize = $img_x / $count; - $y_range = min($cellsize, $img_y); - $y_max = $img_y - $y_range; - $y_off = array(); // consecutive vertical offset of characters - $color = array(); // color of characters - $y_off[0] = mt_rand(0, $y_max); - for ($i = 1; $i < $count; ++$i) - { - // each consective character can be as much as 50% closer to the top or bottom of the image as the previous - $diff = mt_rand(-50, 50); - if ($diff > 0) - { - $y_off[$i] = $y_off[$i - 1] + ((($y_max - $y_off[$i - 1]) * $diff) / 100); - } - else - { - $y_off[$i] = $y_off[$i - 1] * ((100 + $diff) / 100); - } - } - - $range = 0.075; - - $chars = array_merge(range('A', 'Z'), range('1', '9')); - - // draw some characters. if they're within the vector spec of the code character, color them differently - for ($i = 0; $i < 8000; ++$i) - { - $degree = mt_rand(-30, 30); - $x = mt_rand(0, $img_x - 1); - $y = mt_rand(0, $img_y); - $text = $chars[array_rand($chars)]; - $char = $x / $cellsize; - $meta_x = ((($x % $cellsize) / $cellsize) * 1.5) - 0.25; - $meta_y = (($img_y - $y) - $y_off[$char]) / $y_range; - $font = $fonts[array_rand($fonts)]; - - $distance = vector_distance($map[$code[$char]], $meta_x, $meta_y, $range); - - $switch = !(rand() % 100); - - imagettftext($img, 10, $degree, $x, $y, - (($distance <= $range) xor $switch) ? - $c->r_rand($text_colors) : - $c->r_rand($bg_colors), - $font, $text); - - } - - // Send image - $this->send_image($img); - } - - function policy_stencil($code) - { - // Generate image - $img_x = 800; - $img_y = 250; - $img = imagecreatetruecolor($img_x, $img_y); - $stencil = imagecreatetruecolor($img_x, $img_y); - - $map = captcha_vectors(); - $fonts = captcha_load_ttf_fonts(); - - // Generate colors - $c = new color_manager($img, 'black'); - $cs = new color_manager($stencil, 'gray'); - - $c->allocate_named('primary', array( - 'random' => true, - 'min_saturation' => 75, - 'min_value' => 80, - )); - - $secondary = $c->color_scheme('primary', 'triadic', false); - - //imagefill($stencil, 0, 0, $black2); - //imagefill($img, 0, 0, $white1); - - $chars = array_merge(range('A', 'Z'), range('1', '9')); - $step = 20; - $density = 4; - for ($i = 0; $i < $img_x; $i += $step) - { - for ($j = 0; $j < $img_y; $j += $step) - { - for ($k = 0; $k < $density; ++$k) - { - $degree = mt_rand(-30, 30); - $x = mt_rand($i, $i + $step); - $y = mt_rand($j, $j + $step); - $char = $chars[array_rand($chars)]; - $font = $fonts[array_rand($fonts)]; - imagettftext($stencil, mt_rand(20, 30), $degree, $x, $y, $cs->r('black'), $font, $char); - } - } - } - - for ($i = 0; $i < 3; ++$i) - { - $degree1 = mt_rand(-30, 30); - $degree2 = mt_rand(-30, 30); - $x1 = mt_rand(0, $img_x - 1); - $x2 = mt_rand(0, $img_x - 1); - $y1 = mt_rand(0, $img_y); - $y2 = mt_rand(0, $img_y); - $char1 = $chars[array_rand($chars)]; - $char2 = $chars[array_rand($chars)]; - $font1 = $fonts[array_rand($fonts)]; - $font2 = $fonts[array_rand($fonts)]; - - imagettftext($img, mt_rand(75, 100), $degree1, $x1, $y1, $secondary[0], $font1, $char1); - imagettftext($img, mt_rand(75, 100), $degree2, $x2, $y2, $secondary[1], $font2, $char2); - } - - $characters = array(); - $sizes = array(); - $bounding_boxes = array(); - $width_avail = $img_x; - $code_num = sizeof($code); - $char_class = $this->captcha_char('char_ttf'); - for ($i = 0; $i < $code_num; ++$i) - { - $characters[$i] = new $char_class($code[$i]); - $sizes[$i] = mt_rand(75, 100); - $box = $characters[$i]->dimensions($sizes[$i]); - $width_avail -= ($box[2] - $box[0]); - $bounding_boxes[$i] = $box; - } - - // - // Redistribute leftover x-space - // - $offset = array(); - for ($i = 0; $i < $code_num; ++$i) - { - $denom = ($code_num - $i); - $denom = max(1.5, $denom); - $offset[$i] = mt_rand(0, (1.5 * $width_avail) / $denom); - $width_avail -= $offset[$i]; - } - - // Draw the text - $xoffset = 0; - for ($i = 0; $i < $code_num; ++$i) - { - $characters[$i] = new $char_class($code[$i]); - $dimm = $bounding_boxes[$i]; - $xoffset += ($offset[$i] - $dimm[0]); - $yoffset = mt_rand(-$dimm[1], $img_y - $dimm[3]); - $characters[$i]->drawchar($sizes[$i], $xoffset, $yoffset, $img, $c->r('background'), array($c->r('primary'))); - $xoffset += $dimm[2]; - } - - for ($i = 0; $i < $img_x; ++$i) - { - for ($j = 0; $j < $img_y; ++$j) - { - // if the stencil is not black, set the pixel in the image to gray - if (imagecolorat($stencil, $i, $j)) - { - imagesetpixel($img, $i, $j, $c->r('gray')); - } - } - } - - // Send image - $this->send_image($img); - } - - function policy_cells($code) - { - global $user; - // Generate image - $img_x = 800; - $img_y = 250; - $img = imagecreate($img_x, $img_y); - - $fonts = captcha_load_ttf_fonts(); - - $map = captcha_vectors(); - - // - // Generate colors - // - $c = new color_manager($img, 'white'); - - $c->allocate_named('primary', array( - 'random' => true, - 'min_saturation' => 30, - 'min_value' => 65, - )); - $primaries = $c->color_scheme('primary', 'tetradic'); - $bg_colors = $c->mono_range($primaries, 'value', 4, false); - shuffle($primaries); - shuffle($bg_colors); - - // Randomize the characters on the right and the left - $left_characters = array(); - $right_characters = array(); - $chars = array_merge(range('A', 'Z'), range('1', '9')); - $chars_size = sizeof($chars) - 1; - $alpha = range('A', 'Z'); - $alpha_size = sizeof($alpha) - 1; - for ($i = 0; $i < 25; ++$i) - { - $left_characters[$i] = $alpha[mt_rand(0, $alpha_size)]; - $right_characters[$i] = $chars[mt_rand(0, $chars_size)]; - } - - // Pick locations for our code, shuffle the rest into 3 separate queues - $code_count = sizeof($code); - $code_order = range(0, 24); - shuffle($code_order); - $remaining = array_splice($code_order, $code_count); - $lineups = array($code_order, array(), array(), array()); - for ($i = sizeof($remaining) - 1; $i >= 0; --$i) - { - $lineups[mt_rand(1, 3)][] = $remaining[$i]; - } - - // overwrite the randomized left and right values with our code, where applicable - for ($i = 0; $i < $code_count; ++$i) - { - $left_characters[$code_order[$i]] = $i + 1; - $right_characters[$code_order[$i]] = $code[$i]; - } - - - $offset1 = 50; - $offset2 = 550; - - // Draw the cells and right hand characters - $xs = $ys = array(); - for ($i = 0; $i < 25; ++$i) - { - $xs[$i] = $offset1 + 20 + (($i % 5) * 40) + mt_rand(-13, 13); - $ys[$i] = 45 + (intval($i / 5) * 40) + mt_rand(-13, 13); - - $bg = $c->r_rand($bg_colors); - - // fill the cells with the background colors - imagefilledrectangle($img, - $offset1 + 1 + (($i % 5) * 40), 26 + (intval($i / 5) * 40), - $offset1 + 39 + (($i % 5) * 40), 64 + (intval($i / 5) * 40), - $bg); - imagefilledrectangle($img, - $offset2 + 1 + (($i % 5) * 40), 26 + (intval($i / 5) * 40), - $offset2 + 39 + (($i % 5) * 40), 64 + (intval($i / 5) * 40), - $bg); - - $level = intval($i / 5); - $pos = $i % 5; - imagettftext($img, 12, 0, - $offset2 + 15 + ($pos * 40), 50 + ($level * 40), - $c->is_dark($bg) ? $c->r('white'): $c->r('black'), $fonts['genr102.ttf'], $right_characters[$i]); - } - - // draw the lines that appear between nodes (visual hint) - for ($k = 0; $k < 4; ++$k ) - { - $lineup = $lineups[$k]; - for ($i = 1, $size = sizeof($lineup); $i < $size; ++$i ) - { - imageline($img, - $xs[$lineup[$i - 1]], $ys[$lineup[$i - 1]], - $xs[$lineup[$i]], $ys[$lineup[$i]], - $primaries[$k]); - } - } - - // draw the actual nodes - $textcolor = $c->is_dark($primaries[0]) ? $c->r('white') : $c->r('black'); - for ($k = 0; $k < 4; ++$k ) - { - for ($j = 0, $size = sizeof($lineups[$k]); $j < $size; ++$j ) - { - $i = $lineups[$k][$j]; - imagefilledellipse($img, - $xs[$i], $ys[$i], - 20, 20, - $primaries[$k]); - imagettftext($img, 12, 0, - $xs[$i] - 5, $ys[$i] + 5, - $textcolor, $fonts['genr102.ttf'], $left_characters[$i]); - } - } - - // Draw poly behind explain text - $points = mt_rand(3, 6); - $arc = 360 / $points; - $vertices = array(); - $c_x = $img_x / 2; - $c_y = $img_y / 2; - $radius = $img_y / 2.5; - $start = deg2rad(mt_rand(0, 360)); - for ($i = 0; $i < $points; ++$i) - { - $rad = $start + deg2rad(($arc * $i) + mt_rand(-10, 10)); - $vertices[] = $c_x + (cos($rad) * $radius); - $vertices[] = $c_y + (sin($rad) * $radius); - } - imagefilledpolygon($img, $vertices, $points, $primaries[mt_rand(0,3)]); - - // draw explain text - $count = sizeof($user->lang['CAPTCHA']['cells']); - $line_height = $img_y / ($count + 1); - for ($i = 0; $i < $count; ++$i) - { - $text = $user->lang['CAPTCHA']['cells'][$i]; - $line_width = strlen($text) * 4.5; // ( / 2, * 9 ) - imagestring($img, 6, ($img_x / 2) - $line_width - 1, $line_height * ($i + 1) - 1, $text, $c->r('black')); - imagestring($img, 6, ($img_x / 2) - $line_width - 1, $line_height * ($i + 1) + 1, $text, $c->r('black')); - imagestring($img, 6, ($img_x / 2) - $line_width + 1, $line_height * ($i + 1) + 1, $text, $c->r('black')); - imagestring($img, 6, ($img_x / 2) - $line_width + 1, $line_height * ($i + 1) - 1, $text, $c->r('black')); - imagestring($img, 6, ($img_x / 2) - $line_width, $line_height * ($i + 1), $text, $c->r('white')); - } - - // Send image - $this->send_image($img); - } - - /** - * entropy - */ - function policy_entropy($code) + function execute($code) { global $config; - // Generate image - $img_x = 800; - $img_y = 250; - $img = imagecreatetruecolor($img_x, $img_y); - - // Generate colors - $c = new color_manager($img, array( - 'random' => true, - 'min_value' => 60, - ), 'hsv'); - - $scheme = $c->color_scheme('background', 'triadic', false); - $scheme = $c->mono_range($scheme, 'both', 10, false); - shuffle($scheme); - $bg_colors = array_splice($scheme, mt_rand(6, 12)); + $stats = gd_info(); - // Generate code characters - $characters = $sizes = $bounding_boxes = array(); - $width_avail = $img_x; - $code_num = sizeof($code); - - for ($i = 0; $i < $code_num; ++$i) - { - $char_class = $this->captcha_char(); - $characters[$i] = new $char_class($code[$i]); - - list($min, $max) = $characters[$i]->range(); - $sizes[$i] = mt_rand($min, $max); - $box = $characters[$i]->dimensions($sizes[$i]); - $width_avail -= ($box[2] - $box[0]); - $bounding_boxes[$i] = $box; - } - - // Redistribute leftover x-space - $offset = array(); - for ($i = 0; $i < $code_num; ++$i) + if (substr($stats['GD Version'], 0, 7) === 'bundled') { - $denom = ($code_num - $i); - $denom = max(1.5, $denom); - $offset[$i] = mt_rand(0, (1.5 * $width_avail) / $denom); - $width_avail -= $offset[$i]; + $bundled = true; } - - // Add some line noise - if ($config['policy_entropy_noise_line']) - { - $this->noise_line($img, 0, 0, $img_x, $img_y, $c->r('background'), $scheme, $bg_colors); - } - - // Draw the text - $xoffset = 0; - for ($i = 0; $i < $code_num; ++$i) - { - $dimm = $bounding_boxes[$i]; - $xoffset += ($offset[$i] - $dimm[0]); - $yoffset = mt_rand(-$dimm[1], $img_y - $dimm[3]); - $characters[$i]->drawchar($sizes[$i], $xoffset, $yoffset, $img, $c->r('background'), $scheme); - $xoffset += $dimm[2]; - } - - // Add some pixel noise - if ($config['policy_entropy_noise_pixel']) - { - $this->noise_pixel($img, 0, 0, $img_x, $img_y, $c->r('background'), $scheme, $bg_colors, $config['policy_entropy_noise_pixel']); - } - - // Send image - $this->send_image($img); - } - - /** - * 3dbitmap - */ - function policy_3dbitmap($code) - { - // Generate image - $img_x = 700; - $img_y = 225; - $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 = 90; - $plane_y = 25; - - $subdivision_factor = 2; - - // $box is the 4 points in img_space that correspond to the corners of the plane in 3-space - $box = array(array(), array(), array(), array()); - - // Top left - $box[0][0] = mt_rand(20, 40); - $box[0][1] = mt_rand(40, 60); - - // Top right - $box[1][0] = mt_rand($img_x - 80, $img_x - 60); - $box[1][1] = mt_rand(10, 30); - - // Bottom right - $box[2][0] = mt_rand($img_x - 40, $img_x - 20); - $box[2][1] = mt_rand($img_y - 50, $img_y - 30); - - // Bottom left. - // because we want to be able to make shortcuts in the 3d->2d, - // we'll calculate the 4th point so that it forms a proper trapezoid - $box[3][0] = $box[2][0] + $box[0][0] - $box[1][0]; - $box[3][1] = $box[2][1] + $box[0][1] - $box[1][1]; - $c = new color_manager($img, array( - 'random' => true, - 'min_saturation' => 50, - 'min_value' => 65, - )); - - $r1 = $c->random_color(array( - 'min_value' => 20, - 'max_value' => 50, - )); - $r2 = $c->random_color(array( - 'min_value' => 70, - 'max_value' => 100, - )); - $rdata = mt_rand(0,1) ? array( - $c->colors[$r1], - $c->colors[$r2], - ) : array( - $c->colors[$r2], - $c->colors[$r1], - ); - - $colors = array(); - for ($i = 0; $i < 60; ++$i) - { - $colors[$i - 30] = $c->allocate(array( - $rdata[0][0], - (($i * $rdata[0][1]) + ((60 - $i) * $rdata[1][1])) / 60, - (($i * $rdata[0][2]) + ((60 - $i) * $rdata[1][2])) / 60, - )); - } - - // $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[1][0] - $box[0][0]) / ($subdivision_factor * $plane_x); - $dxy = ($box[1][1] - $box[0][1]) / ($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[3][0] - $box[0][0]) / ($subdivision_factor * $plane_y); - $dyy = ($box[3][1] - $box[0][1]) / ($subdivision_factor * $plane_y); - - // Initial captcha-letter offset in planar-space - $plane_offset_x = 2; - $plane_offset_y = 5; - - // character map - $map = captcha_bitmaps(); - - // matrix - $plane = array(); - - // for each character, we'll silkscreen it into our boolean pixel plane - for ($c = 0, $code_num = sizeof($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] = $box[0]; - $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, - $img_buffer[$buffer_prev][0][1] + $dyy + $offset); - $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])) - { - $offset2 = $this->wave_height($x, $y, $subdivision_factor, 1) - 30 - $cur_height; - $img_pos_cur[1] += $offset2; - $color = $colors[20]; - } - $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); - } - } - - // Send image on it's merry way - $this->send_image($img); - } - - /** - * overlap - */ - function policy_overlap($code) - { - global $config; - $char_size = 40; - $overlap_factor = .32; - - // Generate image - $img_x = 250; - $img_y = 120; - $img = imagecreatetruecolor($img_x, $img_y); - - // Generate colors - $c = new color_manager($img, array( - 'random' => true, - 'min_saturation' => 70, - 'min_value' => 65, - )); - - $primaries = $c->color_scheme('background', 'triadic', false); - $text = mt_rand(0, 1); - $c->name_color('text', $primaries[$text]); - $noise = $c->mono_range($primaries[1 - $text], 'both', 6, false); - - // Generate code characters - $characters = $bounding_boxes = array(); - $width_avail = $img_x; - - // Get the character rendering scheme - $char_class = $this->captcha_char('char_ttf'); - $code_num = sizeof($code); - - for ($i = 0; $i < $code_num; ++$i) - { - $characters[$i] = new $char_class($code[$i], array('angle' => 0)); - $box = $characters[$i]->dimensions($char_size); - $width_avail -= ((1 - $overlap_factor) * ($box[2] - $box[0])); - $bounding_boxes[$i] = $box; - } - - // Redistribute leftover x-space - $offset = mt_rand(0, $width_avail); - - // Add some line noise - if ($config['policy_overlap_noise_line']) - { - $this->noise_line($img, 0, 0, $img_x, $img_y, $c->r('background'), array($c->r('text')), $noise); - } - - // Draw the text - $min = 10 - $bounding_boxes[0][1]; - $max = ($img_y - 10) - $bounding_boxes[0][3]; - $med = ($max + $min) / 2; - - $yoffset = mt_rand($med, $max); - $char_num = sizeof($characters); - - imagesetthickness($img, 3); - for ($i = 0; $i < $char_num; ++$i) - { - if ($i) - { - imageline($img, $old_x + mt_rand(-3, 3), $old_y - 70 + mt_rand(-3, 3), $offset + mt_rand(-3, 3), $yoffset - 70 + mt_rand(-3, 3), $c->r('text')); - imageline($img, $old_x + mt_rand(-3, 3), $old_y + 30 + mt_rand(-3, 3), $offset + mt_rand(-3, 3), $yoffset + 30 + mt_rand(-3, 3), $c->r('text')); - } - - $dimm = $bounding_boxes[$i]; - $offset -= $dimm[0]; - $characters[$i]->drawchar($char_size, $offset, $yoffset, $img, $c->r('background'), array($c->r('text'))); - - $old_x = $offset; - $old_y = $yoffset; - - $offset += $dimm[2]; - $offset -= (($dimm[2] - $dimm[0]) * $overlap_factor); - $yoffset += ($i & 1) ? ((1 - $overlap_factor) * ($dimm[3] - $dimm[1])) : ((1 - $overlap_factor) * ($dimm[1] - $dimm[3])); - } - - imagesetthickness($img, 1); - - // Add some medium pixel noise - if ($config['policy_overlap_noise_pixel']) - { - $this->noise_pixel($img, 0, 0, $img_x, $img_y, $c->r('background'), array($c->r('text')), $noise, $config['policy_overlap_noise_pixel']); - } - - // Send image - $this->send_image($img); - } - - /** - * Noise pixel - */ - function noise_pixel($img, $min_x, $min_y, $max_x, $max_y, $bg, $font, $non_font, $override = false) - { - $noise_modules = array('noise_pixel_light', 'noise_pixel_medium', 'noise_pixel_heavy'); - - if ($override == false) - { - $override = array_rand($override); - } - - // Use the module $override, else a random picked one... - $module = $noise_modules[intval($override) - 1]; - - switch ($module) - { - case 'noise_pixel_light': - - for ($x = $min_x; $x < $max_x; $x += mt_rand(9, 18)) - { - for ($y = $min_y; $y < $max_y; $y += mt_rand(4, 9)) - { - imagesetpixel($img, $x, $y, $non_font[array_rand($non_font)]); - } - } - - for ($y = $min_y; $y < $max_y; $y += mt_rand(9, 18)) - { - for ($x = $min_x; $x < $max_x; $x += mt_rand(4, 9)) - { - imagesetpixel($img, $x, $y, $non_font[array_rand($non_font)]); - } - } - - break; - - case 'noise_pixel_medium': - - for ($x = $min_x; $x < $max_x; $x += mt_rand(4, 9)) - { - for ($y = $min_y; $y < $max_y; $y += mt_rand(2, 5)) - { - imagesetpixel($img, $x, $y, $non_font[array_rand($non_font)]); - } - } - - for ($y = $min_y; $y < $max_y; $y += mt_rand(4, 9)) - { - for ($x = $min_x; $x < $max_x; $x += mt_rand(2, 5)) - { - imagesetpixel($img, $x, $y, $non_font[array_rand($non_font)]); - } - } - - break; - - case 'noise_pixel_heavy': - - for ($x = $min_x; $x < $max_x; $x += mt_rand(4, 9)) - { - for ($y = $min_y; $y < $max_y; $y++) - { - imagesetpixel($img, $x, $y, $non_font[array_rand($non_font)]); - } - } - - for ($y = $min_y; $y < $max_y; $y+= mt_rand(4, 9)) - { - for ($x = $min_x; $x < $max_x; $x++) - { - imagesetpixel($img, $x, $y, $non_font[array_rand($non_font)]); - } - } - - break; - } - } - - /** - * Noise line - */ - function noise_line($img, $min_x, $min_y, $max_x, $max_y, $bg, $font, $non_font) - { - imagesetthickness($img, 2); - $x1 = $min_x; - $x2 = $max_x; - $y1 = $min_y; - $y2 = $min_y; - - do + else { - $line = array_merge( - array_fill(0, mt_rand(30, 60), $non_font[array_rand($non_font)]), - array_fill(0, mt_rand(30, 60), $bg) - ); - - imagesetstyle($img, $line); - imageline($img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED); - - $y1 += mt_rand(12, 35); - $y2 += mt_rand(12, 35); + $bundled = false; } - while ($y1 < $max_y && $y2 < $max_y); - - $x1 = $min_x; - $x2 = $min_x; - $y1 = $min_y; - $y2 = $max_y; - do + preg_match('/[\\d.]+/', $stats['GD Version'], $version); + if (version_compare($version[0], '2.0.1', '>=')) { - $line = array_merge( - array_fill(0, mt_rand(30, 60), $non_font[array_rand($non_font)]), - array_fill(0, mt_rand(30, 60), $bg) - ); - - imagesetstyle($img, $line); - imageline($img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED); - - $x1 += mt_rand(12, 35); - $x2 += mt_rand(12, 35); + $gd_version = 2; } - while ($x1 < $max_x && $x2 < $max_x); - imagesetthickness($img, 1); - } - - /** - * Randomly determine which char class to use - * Able to define static one with override - */ - function captcha_char($override = false) - { - static $character_classes = array(); - - // Some people have GD but no TTF support - if (sizeof($character_classes) == 0) + else { - $character_classes = array('char_vector', 'char_hatches', 'char_cube3d', 'char_dots'); - - if (function_exists('imagettfbbox') && function_exists('imagettftext')) - { - $character_classes[] = 'char_ttf'; - } + $gd_version = 1; } - // Use the module $override, else a random picked one... - $class = ($override !== false && in_array($override, $character_classes)) ? $override : $character_classes[array_rand($character_classes)]; - - return $class; - } -} - -/** -* @package VC -*/ -class char_dots -{ - var $vectors; - var $space; - var $radius; - var $letter; - var $width_percent; + // set dimension of image + $lx = 360; + $ly = 96; - /** - * Constuctor - */ - function char_dots($letter = '', $args = false) - { - $width_percent = false; - if (is_array($args)) + // create the image, stay compat with older versions of GD + if ($gd_version === 2) { - $width_percent = (!empty($args['width_percent'])) ? $args['width_percent'] : false; + $func1 = 'imagecreatetruecolor'; + $func2 = 'imagecolorallocate'; } - - $this->vectors = captcha_vectors(); - $this->width_percent = (!empty($width_percent)) ? max(25, min(150, intval($width_percent))) : mt_rand(60, 90); - - $this->space = 10; - $this->radius = 3; - $this->density = 3; - $this->letter = $letter; - } - - /** - * Draw a character - */ - function drawchar($scale, $xoff, $yoff, $img, $background, $colors) - { - $vectorset = $this->vectors[$this->letter]; - $height = $scale; - $width = (($scale * $this->width_percent) / 100); - $color = $colors[array_rand($colors)]; - - if (sizeof($vectorset)) + else { - foreach ($vectorset as $veclist) - { - switch ($veclist[0]) - { - case 'line': - - $dx = ($veclist[3] - $veclist[1]) * $width; - $dy = ($veclist[4] - $veclist[2]) * -$height; - - $len = sqrt(($dx * $dx) + ($dy * $dy)); - - $inv_dx = -($dy / $len); - $inv_dy = ($dx / $len); - - for ($i = 0; $i < $len; ++$i) - { - for ($k = 0; $k <= $this->density; ++$k) - { - $shift = mt_rand(-$this->radius, $this->radius); - imagesetpixel($img, - $xoff + ($veclist[1] * $width) + (($i * $dx) / $len) + ($inv_dx * $shift), - $yoff + ((1 - $veclist[2]) * $height) + (($i * $dy) / $len) + ($inv_dy * $shift), - $color); - } - } - - break; - - case 'arc': - - $arclengthdeg = $veclist[6] - $veclist[5]; - $arclengthdeg += ( $arclengthdeg < 0 ) ? 360 : 0; - - $arclength = ((($veclist[3] * $width) + ($veclist[4] * $height)) * M_PI) / 2; - - $arclength = ($arclength * $arclengthdeg) / 360; - - $x_c = $veclist[1] * $width; - $y_c = (1 - $veclist[2]) * $height; - $increment = ($arclengthdeg / $arclength); - - for ($i = 0; $i < $arclengthdeg; $i += $increment) - { - $theta = deg2rad(($i + $veclist[5]) % 360); - $x_o = cos($theta); - $y_o = sin($theta); - $pre_width = ($veclist[3] * 0.5 * $width); - $pre_height = ($veclist[4] * 0.5 * $height); - for ($k = 0; $k <= $this->density; ++$k) - { - $shift = mt_rand(-$this->radius, $this->radius); - $x_o1 = $x_o * ($pre_width + $shift); - $y_o1 = $y_o * ($pre_height + $shift); - imagesetpixel($img, - $xoff + $x_c + $x_o1, - $yoff + $y_c + $y_o1, - $color); - } - } - - break; - - default: - // Do nothing with bad input - break; - } - } + $func1 = 'imagecreate'; + $func2 = 'imagecolorclosest'; } - } - /* - * return a roughly acceptable range of sizes for rendering with this texttype - */ - function range() - { - return array(60, 80); - } + $image = $func1($lx, $ly); - /** - * dimensions - */ - function dimensions($size) - { - return array(-4, -4, (($size * $this->width_percent) / 100) + 4, $size + 4); - } -} - -/** -* @package VC -*/ -class char_vector -{ - var $vectors; - var $width_percent; - var $letter; - - /** - * Constructor - */ - function char_vector($letter = '', $args = false) - { - $width_percent = false; - if (is_array($args)) + if ($bundled) { - $width_percent = (!empty($args['width_percent'])) ? $args['width_percent'] : false; + imageantialias($image, true); } - $this->vectors = captcha_vectors(); - $this->width_percent = (!empty($width_percent)) ? max(25, min(150, intval($width_percent))) : mt_rand(60,90); - $this->letter = $letter; - } - - /** - * Draw a character - */ - function drawchar($scale, $xoff, $yoff, $img, $background, $colors) - { - $vectorset = $this->vectors[$this->letter]; - $height = $scale; - $width = (($scale * $this->width_percent) / 100); - $color = $colors[array_rand($colors)]; + // set background color + $back = imagecolorallocate($image, mt_rand(224, 255), mt_rand(224, 255), mt_rand(224, 255)); + imagefilledrectangle($image, 0, 0, $lx, $ly, $back); - if (sizeof($vectorset)) + // allocates the 216 websafe color palette to the image + if ($gd_version === 1) { - foreach ($vectorset as $veclist) + for ($r = 0; $r <= 255; $r += 51) { - for ($i = 0; $i < 9; ++$i) + for ($g = 0; $g <= 255; $g += 51) { - $xp = $i % 3; - $yp = ($i - $xp) / 3; - $xp--; - $yp--; - - switch ($veclist[0]) + for ($b = 0; $b <= 255; $b += 51) { - case 'line': - imageline($img, - $xoff + $xp + ($veclist[1] * $width), - $yoff + $yp + ((1 - $veclist[2]) * $height), - $xoff + $xp + ($veclist[3] * $width), - $yoff + $yp + ((1 - $veclist[4]) * $height), - $color - ); - break; - - case 'arc': - imagearc($img, - $xoff + $xp + ($veclist[1] * $width), - $yoff + $yp + ((1 - $veclist[2]) * $height), - $veclist[3] * $width, - $veclist[4] * $height, - $veclist[5], - $veclist[6], - $color - ); - break; + imagecolorallocate($image, $r, $g, $b); } } } } - } - - /* - * return a roughly acceptable range of sizes for rendering with this texttype - */ - function range() - { - return array(50, 80); - } - - /** - * dimensions - */ - function dimensions($size) - { - return array(-2, -2, (($size * $this->width_percent) / 100 ) + 2, $size + 2); - } -} - -/** -* @package VC -*/ -class char_ttf -{ - var $angle = 0; - var $fontfile = ''; - var $letter = ''; - - /** - * Constructor - */ - function char_ttf($letter = '', $args = false) - { - $font = $angle = false; - - if (is_array($args)) - { - $font = (!empty($args['font'])) ? $args['font'] : false; - $angle = (isset($args['angle'])) ? $args['angle'] : false; - } - - $fonts = captcha_load_ttf_fonts(); - - if (empty($font) || !isset($fonts[$font])) - { - $font = array_rand($fonts); - } - - $this->fontfile = $fonts[$font]; - $this->angle = ($angle !== false) ? intval($angle) : mt_rand(-40, 40); - $this->letter = $letter; - } - - /** - * Draw a character - */ - function drawchar($scale, $xoff, $yoff, $img, $background, $colors) - { - $color = $colors[array_rand($colors)]; - imagettftext($img, $scale, $this->angle, $xoff, $yoff, $color, $this->fontfile, $this->letter); - } - - /* - * return a roughly acceptable range of sizes for rendering with this texttype - */ - function range() - { - return array(36, 150); - } - - /** - * Dimensions - */ - function dimensions($scale) - { - $data = imagettfbbox($scale, $this->angle, $this->fontfile, $this->letter); - return ($this->angle > 0) ? array($data[6], $data[5], $data[2], $data[1]) : array($data[0], $data[7], $data[4], $data[3]); - } -} - -/** -* @package VC -*/ -class char_hatches -{ - var $vectors; - var $space; - var $radius; - var $letter; - - /** - * Constructor - */ - function char_hatches($letter = '', $args = false) - { - $width_percent = false; - if (is_array($args)) - { - $width_percent = (!empty($args['width_percent'])) ? $args['width_percent'] : false; - } - - $this->vectors = captcha_vectors(); - $this->width_percent = (!empty($width_percent)) ? max(25, min(150, intval($width_percent))) : mt_rand(60, 90); - $this->space = 10; - $this->radius = 3; - $this->letter = $letter; - } - - /** - * Draw a character - */ - function drawchar($scale, $xoff, $yoff, $img, $background, $colors) - { - $vectorset = $this->vectors[$this->letter]; - $height = $scale; - $width = (($scale * $this->width_percent) / 100); - $color = $colors[array_rand($colors)]; - if (sizeof($vectorset)) + // fill with noise or grid + if ($config['captcha_gd_noise']) { - foreach ($vectorset as $veclist) + // random characters in background with random position, angle, color + for ($i = 0 ; $i < 72; $i++) { - switch ($veclist[0]) - { - case 'line': - $dx = ($veclist[3] - $veclist[1]) * $width; - $dy = ($veclist[4] - $veclist[2]) * -$height; - - $idx = -$dy; - $idy = $dx; - - $length = sqrt(pow($dx, 2) + pow($dy, 2)); - - $hatches = $length / $this->space; - - for ($p = 0; $p <= $hatches; ++$p) - { - if (!$p && !mt_rand(0, 9) && ($hatches > 3)) - { - continue; - } - - $xp = 1; - $yp = -2; - for ($i = 0; $i < 9; ++$i) - { - $xp += !($i % 3) ? -2 : 1; - $yp += !($i % 3) ? 1 : 0; - - $x_o = ((($p * $veclist[1]) + (($hatches - $p) * $veclist[3])) * $width ) / $hatches; - $y_o = $height - (((($p * $veclist[2]) + (($hatches - $p) * $veclist[4])) * $height ) / $hatches); - $x_1 = $xoff + $xp + $x_o; - $y_1 = $yoff + $yp + $y_o; - - $x_d1 = (($dx - $idx) * $this->radius) / $length; - $y_d1 = (($dy - $idy) * $this->radius) / $length; - - $x_d2 = (($dx - $idx) * -$this->radius) / $length; - $y_d2 = (($dy - $idy) * -$this->radius) / $length; - - imageline($img, $x_1 + $x_d1, $y_1 + $y_d1, $x_1 + $x_d2, $y_1 + $y_d2, $color); - } - } - break; - - case 'arc': - $arclengthdeg = $veclist[6] - $veclist[5]; - $arclengthdeg += ( $arclengthdeg < 0 ) ? 360 : 0; - - $arclength = ((($veclist[3] * $width) + ($veclist[4] * $height)) * M_PI) / 2; - $arclength = ($arclength * $arclengthdeg) / 360; - - $hatches = $arclength / $this->space; - - $hatchdeg = ($arclengthdeg * $this->space) / $arclength; - $shiftdeg = ($arclengthdeg * $this->radius) / $arclength; - - $x_c = $veclist[1] * $width; - $y_c = (1 - $veclist[2]) * $height; - - for ($p = 0; $p <= $arclengthdeg; $p += $hatchdeg) - { - if (!mt_rand(0, 9) && ($hatches > 3) && !$p) - { - continue; - } - - $theta1 = deg2rad(($p + $veclist[5] - $shiftdeg) % 360); - $theta2 = deg2rad(($p + $veclist[5] + $shiftdeg) % 360); - $x_o1 = cos($theta1) * (($veclist[3] * 0.5 * $width) - $this->radius); - $y_o1 = sin($theta1) * (($veclist[4] * 0.5 * $height) - $this->radius); - $x_o2 = cos($theta2) * (($veclist[3] * 0.5 * $width) + $this->radius); - $y_o2 = sin($theta2) * (($veclist[4] * 0.5 * $height) + $this->radius); - - $xp = 1; - $yp = -2; - for ($i = 0; $i < 9; ++$i) - { - $xp += !($i % 3) ? -2 : 1; - $yp += !($i % 3) ? 1 : 0; - - imageline($img, - $xoff + $xp + $x_c + $x_o1, - $yoff + $yp + $y_c + $y_o1, - $xoff + $xp + $x_c + $x_o2, - $yoff + $yp + $y_c + $y_o2, - $color - ); - } - } - break; - } + $size = mt_rand(8, 23); + $angle = mt_rand(0, 360); + $x = mt_rand(0, 360); + $y = mt_rand(0, (int)($ly - ($size / 5))); + $color = $func2($image, mt_rand(160, 224), mt_rand(160, 224), mt_rand(160, 224)); + $text = chr(mt_rand(45, 250)); + imagettftext($image, $size, $angle, $x, $y, $color, $this->get_font(), $text); } } - } - - /* - * return a roughly acceptable range of sizes for rendering with this texttype - */ - function range() - { - return array(60, 80); - } - - /** - * Dimensions - */ - function dimensions($size) - { - return array(-4, -4, (($size * $this->width_percent) / 100) + 4, $size + 4); - } -} - -/** -* @package VC -*/ -class char_cube3d -{ - // need to abstract out the cube3d from the cubechar - var $bitmaps; - - var $basis_matrix = array(array(1, 0, 0), array(0, 1, 0), array(0, 0, 1)); - var $abs_x = array(1, 0); - var $abs_y = array(0, 1); - var $x = 0; - var $y = 1; - var $z = 2; - var $letter = ''; - - function char_cube3d($letter) - { - $this->bitmaps = captcha_bitmaps(); - - $this->basis_matrix[0][0] = mt_rand(-600, 600); - $this->basis_matrix[0][1] = mt_rand(-600, 600); - $this->basis_matrix[0][2] = (mt_rand(0, 1) * 2000) - 1000; - $this->basis_matrix[1][0] = mt_rand(-1000, 1000); - $this->basis_matrix[1][1] = mt_rand(-1000, 1000); - $this->basis_matrix[1][2] = mt_rand(-1000, 1000); - - $this->normalize($this->basis_matrix[0]); - $this->normalize($this->basis_matrix[1]); - $this->basis_matrix[2] = $this->cross_product($this->basis_matrix[0], $this->basis_matrix[1]); - $this->normalize($this->basis_matrix[2]); - - // $this->basis_matrix[1] might not be (probably isn't) orthogonal to $basis_matrix[0] - $this->basis_matrix[1] = $this->cross_product($this->basis_matrix[0], $this->basis_matrix[2]); - $this->normalize($this->basis_matrix[1]); - - // Make sure our cube is facing into the canvas (assuming +z == in) - for ($i = 0; $i < 3; ++$i) + else { - if ($this->basis_matrix[$i][2] < 0) + // generate grid + for ($i = 0; $i < $lx; $i += 13) { - $this->basis_matrix[$i][0] *= -1; - $this->basis_matrix[$i][1] *= -1; - $this->basis_matrix[$i][2] *= -1; + $color = $func2($image, mt_rand(160, 224), mt_rand(160, 224), mt_rand(160, 224)); + imageline($image, $i, 0, $i, $ly, $color); } - } - - // Force our "z" basis vector to be the one with greatest absolute z value - $this->x = 0; - $this->y = 1; - $this->z = 2; - - // Swap "y" with "z" - if ($this->basis_matrix[1][2] > $this->basis_matrix[2][2]) - { - $this->z = 1; - $this->y = 2; - } - - // Swap "x" with "z" - if ($this->basis_matrix[0][2] > $this->basis_matrix[$this->z][2]) - { - $this->x = $this->z; - $this->z = 0; - } - - // Still need to determine which of $x,$y are which. - // wrong orientation if y's y-component is less than it's x-component - // likewise if x's x-component is less than it's y-component - // if they disagree, go with the one with the greater weight difference. - // rotate if positive - $weight = (abs($this->basis_matrix[$this->x][1]) - abs($this->basis_matrix[$this->x][0])) + - (abs($this->basis_matrix[$this->y][0]) - abs($this->basis_matrix[$this->y][1])); - - // Swap "x" with "y" - if ($weight > 0) - { - list($this->x, $this->y) = array($this->y, $this->x); - } - - $this->abs_x = array($this->basis_matrix[$this->x][0], $this->basis_matrix[$this->x][1]); - $this->abs_y = array($this->basis_matrix[$this->y][0], $this->basis_matrix[$this->y][1]); - - if ($this->abs_x[0] < 0) - { - $this->abs_x[0] *= -1; - $this->abs_x[1] *= -1; - } - - if ($this->abs_y[1] > 0) - { - $this->abs_y[0] *= -1; - $this->abs_y[1] *= -1; - } - - $this->letter = $letter; - } - - /** - * - */ - function draw($im, $scale, $xoff, $yoff, $face, $xshadow, $yshadow) - { - $origin = array(0, 0, 0); - $xvec = $this->scale($this->basis_matrix[$this->x], $scale); - $yvec = $this->scale($this->basis_matrix[$this->y], $scale); - $face_corner = $this->sum2($xvec, $yvec); - - $zvec = $this->scale($this->basis_matrix[$this->z], $scale); - $x_corner = $this->sum2($xvec, $zvec); - $y_corner = $this->sum2($yvec, $zvec); - - imagefilledpolygon($im, $this->gen_poly($xoff, $yoff, $origin, $xvec, $x_corner, $zvec), 4, $yshadow); - imagefilledpolygon($im, $this->gen_poly($xoff, $yoff, $origin, $yvec, $y_corner, $zvec), 4, $xshadow); - imagefilledpolygon($im, $this->gen_poly($xoff, $yoff, $origin, $xvec, $face_corner, $yvec), 4, $face); - } - - /** - * Draw a character - */ - function drawchar($scale, $xoff, $yoff, $img, $background, $colors) - { - $width = $this->bitmaps['width']; - $height = $this->bitmaps['height']; - $bitmap = $this->bitmaps['data'][$this->letter]; - - $color1 = $colors[array_rand($colors)]; - $color2 = $colors[array_rand($colors)]; - - $swapx = ($this->basis_matrix[$this->x][0] > 0); - $swapy = ($this->basis_matrix[$this->y][1] < 0); - - for ($y = 0; $y < $height; ++$y) - { - for ($x = 0; $x < $width; ++$x) + for ($i = 0; $i < $ly; $i += 11) { - $xp = ($swapx) ? ($width - $x - 1) : $x; - $yp = ($swapy) ? ($height - $y - 1) : $y; - - if ($bitmap[$height - $yp - 1][$xp]) - { - $dx = $this->scale($this->abs_x, ($xp - ($swapx ? ($width / 2) : ($width / 2) - 1)) * $scale); - $dy = $this->scale($this->abs_y, ($yp - ($swapy ? ($height / 2) : ($height / 2) - 1)) * $scale); - $xo = $xoff + $dx[0] + $dy[0]; - $yo = $yoff + $dx[1] + $dy[1]; - - $origin = array(0, 0, 0); - $xvec = $this->scale($this->basis_matrix[$this->x], $scale); - $yvec = $this->scale($this->basis_matrix[$this->y], $scale); - $face_corner = $this->sum2($xvec, $yvec); - - $zvec = $this->scale($this->basis_matrix[$this->z], $scale); - $x_corner = $this->sum2($xvec, $zvec); - $y_corner = $this->sum2($yvec, $zvec); - - imagefilledpolygon($img, $this->gen_poly($xo, $yo, $origin, $xvec, $x_corner,$zvec), 4, $color1); - imagefilledpolygon($img, $this->gen_poly($xo, $yo, $origin, $yvec, $y_corner,$zvec), 4, $color2); - - $face = $this->gen_poly($xo, $yo, $origin, $xvec, $face_corner, $yvec); - - imagefilledpolygon($img, $face, 4, $background); - imagepolygon($img, $face, 4, $color1); - } + $color = $func2($image, mt_rand(160, 224), mt_rand(160, 224), mt_rand(160, 224)); + imageline($image, 0, $i, $lx, $i, $color); } } - } - - /* - * return a roughly acceptable range of sizes for rendering with this texttype - */ - function range() - { - return array(5, 10); - } - /** - * Vector length - */ - function vectorlen($vector) - { - return sqrt(pow($vector[0], 2) + pow($vector[1], 2) + pow($vector[2], 2)); - } - - /** - * Normalize - */ - function normalize(&$vector, $length = 1) - { - $length = (( $length < 1) ? 1 : $length); - $length /= $this->vectorlen($vector); - $vector[0] *= $length; - $vector[1] *= $length; - $vector[2] *= $length; - } - - /** - * - */ - function cross_product($vector1, $vector2) - { - $retval = array(0, 0, 0); - $retval[0] = (($vector1[1] * $vector2[2]) - ($vector1[2] * $vector2[1])); - $retval[1] = -(($vector1[0] * $vector2[2]) - ($vector1[2] * $vector2[0])); - $retval[2] = (($vector1[0] * $vector2[1]) - ($vector1[1] * $vector2[0])); + $len = strlen($code); - return $retval; - } - - /** - * - */ - function sum($vector1, $vector2) - { - return array($vector1[0] + $vector2[0], $vector1[1] + $vector2[1], $vector1[2] + $vector2[2]); - } - - /** - * - */ - function sum2($vector1, $vector2) - { - return array($vector1[0] + $vector2[0], $vector1[1] + $vector2[1]); - } - - /** - * - */ - function scale($vector, $length) - { - if (sizeof($vector) == 2) + for ($i = 0, $x = mt_rand(20, 40); $i < $len; $i++) { - return array($vector[0] * $length, $vector[1] * $length); - } + $text = strtoupper($code[$i]); + $angle = mt_rand(-30, 30); + $size = mt_rand(20, 40); + $y = mt_rand((int)($size * 1.5), (int)($ly - ($size / 7))); - return array($vector[0] * $length, $vector[1] * $length, $vector[2] * $length); - } + $color = $func2($image, mt_rand(0, 127), mt_rand(0, 127), mt_rand(0, 127)); + $shadow = $func2($image, mt_rand(127, 254), mt_rand(127, 254), mt_rand(127, 254)); + $font = $this->get_font(); - /** - * - */ - function gen_poly($xoff, $yoff, &$vec1, &$vec2, &$vec3, &$vec4) - { - $poly = array(); - $poly[0] = $xoff + $vec1[0]; - $poly[1] = $yoff + $vec1[1]; - $poly[2] = $xoff + $vec2[0]; - $poly[3] = $yoff + $vec2[1]; - $poly[4] = $xoff + $vec3[0]; - $poly[5] = $yoff + $vec3[1]; - $poly[6] = $xoff + $vec4[0]; - $poly[7] = $yoff + $vec4[1]; + imagettftext($image, $size, $angle, $x + (int)($size / 15), $y, $shadow, $font, $text); + imagettftext($image, $size, $angle, $x, $y - (int)($size / 15), $color, $font, $text); - return $poly; - } - - /** - * dimensions - */ - function dimensions($size) - { - $xn = $this->scale($this->basis_matrix[$this->x], -($this->bitmaps['width'] / 2) * $size); - $xp = $this->scale($this->basis_matrix[$this->x], ($this->bitmaps['width'] / 2) * $size); - $yn = $this->scale($this->basis_matrix[$this->y], -($this->bitmaps['height'] / 2) * $size); - $yp = $this->scale($this->basis_matrix[$this->y], ($this->bitmaps['height'] / 2) * $size); - - $p = array(); - $p[0] = $this->sum2($xn, $yn); - $p[1] = $this->sum2($xp, $yn); - $p[2] = $this->sum2($xp, $yp); - $p[3] = $this->sum2($xn, $yp); - - $min_x = $max_x = $p[0][0]; - $min_y = $max_y = $p[0][1]; - - for ($i = 1; $i < 4; ++$i) - { - $min_x = ($min_x > $p[$i][0]) ? $p[$i][0] : $min_x; - $min_y = ($min_y > $p[$i][1]) ? $p[$i][1] : $min_y; - $max_x = ($max_x < $p[$i][0]) ? $p[$i][0] : $max_x; - $max_y = ($max_y < $p[$i][1]) ? $p[$i][1] : $max_y; + $x += $size + 4; } - return array($min_x, $min_y, $max_x, $max_y); - } -} - -/** -* Return bitmaps -*/ -function captcha_bitmaps() -{ - return array( - 'width' => 9, - 'height' => 15, - 'data' => array( - 'A' => array( - array(0,0,0,0,1,0,0,0,0), - array(0,0,0,1,0,1,0,0,0), - array(0,0,0,1,0,1,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,0,1,0,0,0,1,0,0), - array(0,0,1,0,0,0,1,0,0), - array(0,1,0,0,0,0,0,1,0), - array(0,1,0,0,0,0,0,1,0), - array(0,1,1,1,1,1,1,1,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), - ), - 'B' => 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,1,0), - 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,1,0), - array(1,1,1,1,1,1,1,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,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,0), - 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), - ), - '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,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), - ), - 'E' => 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(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,1,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,1,1,1,1,1,1,1,1), - ), - 'F' => 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(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(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), - ), - '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,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,1,1,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), - ), - 'H' => 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,1,1,1,1,1,1,1,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), - ), - 'I' => 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,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(1,1,1,1,1,1,1,1,1), - ), - 'J' => array( - array(1,1,1,1,1,1,1,1,1), - array(0,0,0,0,0,1,0,0,0), - array(0,0,0,0,0,1,0,0,0), - array(0,0,0,0,0,1,0,0,0), - array(0,0,0,0,0,1,0,0,0), - array(0,0,0,0,0,1,0,0,0), - array(0,0,0,0,0,1,0,0,0), - array(0,0,0,0,0,1,0,0,0), - array(0,0,0,0,0,1,0,0,0), - array(0,0,0,0,0,1,0,0,0), - array(0,0,0,0,0,1,0,0,0), - array(1,0,0,0,0,1,0,0,0), - array(1,0,0,0,0,1,0,0,0), - array(0,1,0,0,1,0,0,0,0), - array(0,0,1,1,0,0,0,0,0), - ), - 'K' => array( // New 'K', supplied by NeoThermic - array(1,0,0,0,0,0,0,0,1), - array(1,0,0,0,0,0,0,1,0), - 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(1,0,0,0,0,0,0,1,0), - array(1,0,0,0,0,0,0,0,1), - ), - 'L' => array( - array(0,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(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,1,1,1,1,1,1,1,1), - ), - 'M' => array( - array(1,1,0,0,0,0,0,1,1), - array(1,1,0,0,0,0,0,1,1), - array(1,0,1,0,0,0,1,0,1), - array(1,0,1,0,0,0,1,0,1), - array(1,0,1,0,0,0,1,0,1), - array(1,0,0,1,0,1,0,0,1), - array(1,0,0,1,0,1,0,0,1), - array(1,0,0,1,0,1,0,0,1), - array(1,0,0,0,1,0,0,0,1), - array(1,0,0,0,1,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), - ), - 'N' => array( - array(1,1,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,1,0,0,0,0,0,1), - array(1,0,0,1,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,1,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,1,0,0,1), - array(1,0,0,0,0,0,1,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,1,1), - ), - 'O' => 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(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), - ), - 'P' => 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,1,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(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), - ), - 'Q' => 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(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,1,0,0,1), - array(1,0,0,0,0,0,1,0,1), - array(0,1,0,0,0,0,0,1,0), - array(0,0,1,1,1,1,1,0,1), - ), - 'R' => 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,1,0), - array(1,1,1,1,1,1,1,0,0), - array(1,1,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(1,0,0,0,0,0,0,1,0), - array(1,0,0,0,0,0,0,0,1), - ), - 'S' => 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(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,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), - ), - '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,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), - ), - '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(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), - ), - '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(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,1,0,0,0,1,0,0), - array(0,0,1,0,0,0,1,0,0), - array(0,0,1,0,0,0,1,0,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,1,0,1,0,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), - ), - 'W' => array( // New 'W', supplied by MHobbit - 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,1,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,0,1,0,1,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,0,1,0,0,0,1,0,1), - array(1,0,1,0,0,0,1,0,1), - array(1,1,0,0,0,0,0,1,1), - array(1,1,0,0,0,0,0,1,1), - ), - '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,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,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,0,1,0,1,0,0,0), - array(0,0,1,0,0,0,1,0,0), - array(0,1,0,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), - ), - 'Y' => 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,1,0,0,0,0,0,1,0), - array(0,0,1,0,0,0,1,0,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,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), - ), - 'Z' => array( // New 'Z' supplied by Anon - 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,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,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,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,0), - array(1,0,0,0,0,0,0,0,1), - array(1,1,1,1,1,1,1,1,1), - ), - '1' => array( - 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,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), - ), - '2' => array( // New '2' supplied by Anon - 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,1,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,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,1,1,1,1,1,1,1,1), - array(0,0,0,0,0,0,0,0,0), - ), - '3' => 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(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,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,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), - ), - '4' => array( - 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,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,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,1,0), - array(0,0,0,0,0,0,0,1,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(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,0,1), - 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), - ), - '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,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(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), - ), - '7' => array( - array(1,1,1,1,1,1,1,1,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,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,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,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(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), - ), - '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(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(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), - ), - '9' => 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(1,0,0,0,0,0,0,0,1), - array(1,0,0,0,0,0,0,1,1), - array(0,1,0,0,0,0,1,0,1), - array(0,0,1,1,1,1,0,0,1), - array(0,0,0,0,0,0,0,0,1), - array(0,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), - ), - ) - ); -} - - -/** -* Load True Type Fonts -*/ -function captcha_load_ttf_fonts() -{ - static $load_files = array(); - - if (sizeof($load_files) > 0) - { - return $load_files; + // Output image + header('Content-Type: image/png'); + header('Cache-control: no-cache, no-store'); + imagepng($image); + imagedestroy($image); } - global $phpbb_root_path; - - $dr = opendir($phpbb_root_path . 'includes/captcha/fonts'); - while (false !== ($entry = readdir($dr))) + function get_font() { - if (strtolower(pathinfo($entry, PATHINFO_EXTENSION)) == 'ttf') - { - $load_files[$entry] = $phpbb_root_path . 'includes/captcha/fonts/' . $entry; - } - } - closedir($dr); - - return $load_files; -} - - -/** -* Return vectors -*/ -function captcha_vectors() -{ - return array( - 'A' => array( - array('line', 0.00, 0.00, 0.50, 1.00, 1.10714871779, 1.11803398875), - array('line', 1.00, 0.00, 0.50, 1.00, 2.0344439358, 1.11803398875), - array('line', 0.25, 0.50, 0.75, 0.50, 0.00, 0.50), - ), - 'B' => array( - array('line', 0.00, 0.00, 0.00, 1.00, 1.57079632679, 1.00), - array('line', 0.00, 1.00, 0.70, 1.00, 0.00, 0.70), - array('line', 0.00, 0.50, 0.70, 0.50, 0.00, 0.70), - array('line', 0.00, 0.00, 0.70, 0.00, 0.00, 0.70), - array('arc', 0.70, 0.75, 0.60, 0.50, 270, 90), - array('arc', 0.70, 0.25, 0.60, 0.50, 270, 90), - ), - 'C' => array( - array('arc', 0.50, 0.50, 1.00, 1.00, 45, 315), - ), - 'D' => array( - array('line', 0.00, 0.00, 0.00, 1.00, 1.57079632679, 1.00), - array('line', 0.00, 0.00, 0.50, 0.00, 0.00, 0.50), - array('line', 0.00, 1.00, 0.50, 1.00, 0.00, 0.50), - array('arc', 0.50, 0.50, 1.00, 1.00, 270, 90), - ), - 'E' => array( - array('line', 0.00, 0.00, 1.00, 0.00, 0.00, 1.00), - array('line', 0.00, 0.00, 0.00, 1.00, 1.57079632679, 1.00), - array('line', 0.00, 1.00, 1.00, 1.00, 0.00, 1.00), - array('line', 0.00, 0.50, 0.50, 0.50, 0.00, 0.50), - ), - 'F' => array( - array('line', 0.00, 0.00, 0.00, 1.00, 1.57079632679, 1.00), - array('line', 0.00, 1.00, 1.00, 1.00, 0.00, 1.00), - array('line', 0.00, 0.50, 0.50, 0.50, 0.00, 0.50), - ), - 'G' => array( - array('line', 0.50, 0.50, 1.00, 0.50, 0.00, 0.50), - array('line', 1.00, 0.00, 1.00, 0.50, 1.57079632679, 0.50), - array('arc', 0.50, 0.50, 1.00, 1.00, 0, 315), - ), - 'H' => array( - array('line', 0.00, 0.00, 0.00, 1.00, 1.57079632679, 1.00), - array('line', 1.00, 0.00, 1.00, 1.00, 1.57079632679, 1.00), - array('line', 0.00, 0.50, 1.00, 0.50, 0.00, 1.00), - ), - 'I' => array( - array('line', 0.00, 0.00, 1.00, 0.00, 0.00, 1.00), - array('line', 0.00, 1.00, 1.00, 1.00, 0.00, 1.00), - array('line', 0.50, 0.00, 0.50, 1.00, 1.57079632679, 1.00), - ), - 'J' => array( - array('line', 1.00, 1.00, 1.00, 0.25, -1.57079632679, 0.75), - array('arc', 0.50, 0.25, 1.00, 0.50, 0, 180), - ), - 'K' => array( - array('line', 0.00, 0.00, 0.00, 1.00, 1.57079632679, 1.00), - array('line', 0.00, 0.50, 1.00, 1.00, 0.463647609001, 1.11803398875), - array('line', 0.00, 0.50, 1.00, 0.00, -0.463647609001, 1.11803398875), - ), - 'L' => array( - array('line', 0.00, 0.00, 0.00, 1.00, 1.57079632679, 1.00), - array('line', 0.00, 0.00, 1.00, 0.00, 0.00, 1.00), - ), - 'M' => array( - array('line', 0.00, 0.00, 0.00, 1.00, 1.57079632679, 1.00), - array('line', 0.50, 0.50, 0.00, 1.00, 2.35619449019, 0.707106781187), - array('line', 0.50, 0.50, 1.00, 1.00, 0.785398163397, 0.707106781187), - array('line', 1.00, 0.00, 1.00, 1.00, 1.57079632679, 1.00), - ), - 'N' => array( - array('line', 0.00, 0.00, 0.00, 1.00, 1.57079632679, 1.00), - array('line', 0.00, 1.00, 1.00, 0.00, -0.785398163397, 1.41421356237), - array('line', 1.00, 0.00, 1.00, 1.00, 1.57079632679, 1.00), - ), - 'O' => array( - array('arc', 0.50, 0.50, 1.00, 1.00, 0, 360), - ), - 'P' => array( - array('line', 0.00, 0.00, 0.00, 1.00, 1.57079632679, 1.00), - array('line', 0.00, 1.00, 0.70, 1.00, 0.00, 0.70), - array('line', 0.00, 0.50, 0.70, 0.50, 0.00, 0.70), - array('arc', 0.70, 0.75, 0.60, 0.50, 270, 90), - ), - 'Q' => array( - array('line', 0.70, 0.30, 1.00, 0.00, -0.785398163397, 0.424264068712), - array('arc', 0.50, 0.50, 1.00, 1.00, 0, 360), - ), - 'R' => array( - array('line', 0.00, 0.00, 0.00, 1.00, 1.57079632679, 1.00), - array('line', 0.00, 1.00, 0.70, 1.00, 0.00, 0.70), - array('line', 0.00, 0.50, 0.70, 0.50, 0.00, 0.70), - array('line', 0.50, 0.50, 1.00, 0.00, -0.785398163397, 0.707106781187), - array('arc', 0.70, 0.75, 0.60, 0.50, 270, 90), - ), - 'S' => array( - array('arc', 0.50, 0.75, 1.00, 0.50, 90, 360), - array('arc', 0.50, 0.25, 1.00, 0.50, 270, 180), - ), - 'T' => array( - array('line', 0.00, 1.00, 1.00, 1.00, 0.00, 1.00), - array('line', 0.50, 0.00, 0.50, 1.00, 1.57079632679, 1.00), - ), - 'U' => array( - array('line', 0.00, 1.00, 0.00, 0.25, -1.57079632679, 0.75), - array('line', 1.00, 1.00, 1.00, 0.25, -1.57079632679, 0.75), - array('arc', 0.50, 0.25, 1.00, 0.50, 0, 180), - ), - 'V' => array( - array('line', 0.00, 1.00, 0.50, 0.00, -1.10714871779, 1.11803398875), - array('line', 1.00, 1.00, 0.50, 0.00, -2.0344439358, 1.11803398875), - ), - 'W' => array( - array('line', 0.00, 1.00, 0.25, 0.00, -1.32581766367, 1.0307764064), - array('line', 0.50, 0.50, 0.25, 0.00, -2.0344439358, 0.559016994375), - array('line', 0.50, 0.50, 0.75, 0.00, -1.10714871779, 0.559016994375), - array('line', 1.00, 1.00, 0.75, 0.00, -1.81577498992, 1.0307764064), - ), - 'X' => array( - array('line', 0.00, 1.00, 1.00, 0.00, -0.785398163397, 1.41421356237), - array('line', 0.00, 0.00, 1.00, 1.00, 0.785398163397, 1.41421356237), - ), - 'Y' => array( - array('line', 0.00, 1.00, 0.50, 0.50, -0.785398163397, 0.707106781187), - array('line', 1.00, 1.00, 0.50, 0.50, -2.35619449019, 0.707106781187), - array('line', 0.50, 0.50, 0.50, 0.00, -1.57079632679, 0.50), - ), - 'Z' => array( - array('line', 0.00, 1.00, 1.00, 1.00, 0.00, 1.00), - array('line', 0.00, 0.00, 1.00, 1.00, 0.785398163397, 1.41421356237), - array('line', 0.00, 0.00, 1.00, 0.00, 0.00, 1.00), - ), - '1' => array( - array('line', 0.00, 0.75, 0.50, 1.00, 0.463647609001, 0.559016994375), - array('line', 0.50, 0.00, 0.50, 1.00, 1.57079632679, 1.00), - array('line', 0.00, 0.00, 1.00, 0.00, 0.00, 1.00), - ), - '2' => array( - array('line', 0.00, 0.00, 1.00, 0.00, 0.00, 1.00), - array('arc', 0.50, 0.70, 1.00, 0.60, 180, 360), - array('arc', 0.50, 0.70, 1.00, 0.70, 0, 90), - array('arc', 0.50, 0.00, 1.00, 0.70, 180, 270), - ), - '3' => array( - array('arc', 0.50, 0.75, 1.00, 0.50, 180, 90), - array('arc', 0.50, 0.25, 1.00, 0.50, 270, 180), - ), - '4' => array( - array('line', 0.70, 0.00, 0.70, 1.00, 1.57079632679, 1.00), - array('line', 0.00, 0.50, 0.70, 1.00, 0.620249485983, 0.860232526704), - array('line', 0.00, 0.50, 1.00, 0.50, 0.00, 1.00), - ), - '5' => array( - array('line', 0.00, 1.00, 1.00, 1.00, 0.00, 1.00), - array('line', 0.00, 1.00, 0.00, 0.60, -1.57079632679, 0.4), - array('line', 0.00, 0.60, 0.50, 0.60, 0.00, 0.50), - array('arc', 0.50, 0.30, 1.00, 0.60, 270, 180), - ), - '6' => array( - array('arc', 0.50, 0.50, 1.00, 1.00, 90, 315), - array('arc', 0.50, 0.30, 0.80, 0.60, 0, 360), - ), - '7' => array( - array('line', 0.00, 1.00, 1.00, 1.00, 0.00, 1.00), - array('line', 0.50, 0.00, 1.00, 1.00, 1.10714871779, 1.11803398875), - ), - '8' => array( - array('arc', 0.50, 0.75, 1.00, 0.50, 0, 360), - array('arc', 0.50, 0.25, 1.00, 0.50, 0, 360), - ), - '9' => array( - array('arc', 0.50, 0.50, 1.00, 1.00, 270, 135), - array('arc', 0.50, 0.70, 0.80, 0.60, 0, 360), - ) - ); -} - -class color_manager -{ - var $img; - var $mode; - var $colors; - var $named_colors; - var $named_rgb = array( - 'red' => array(0xff, 0x00, 0x00), - 'maroon' => array(0x80, 0x00, 0x00), - 'yellow' => array(0xff, 0xff, 0x00), - 'olive' => array(0x80, 0x80, 0x00), - 'lime' => array(0x00, 0xff, 0x00), - 'green' => array(0x00, 0x80, 0x00), - 'aqua' => array(0x00, 0xff, 0xff), - 'teal' => array(0x00, 0x80, 0x80), - 'blue' => array(0x00, 0x00, 0xff), - 'navy' => array(0x00, 0x00, 0x80), - 'fuchsia' => array(0xff, 0x00, 0xff), - 'purple' => array(0x80, 0x00, 0x80), - 'white' => array(0xff, 0xff, 0xff), - 'silver' => array(0xc0, 0xc0, 0xc0), - 'gray' => array(0x80, 0x80, 0x80), - 'black' => array(0x00, 0x00, 0x00), - ); - - /** - * Create the color manager, link it to - * the image resource - */ - function color_manager($img, $background = false, $mode = 'ahsv') - { - $this->img = $img; - $this->mode = $mode; - $this->colors = array(); - $this->named_colors = array(); - if ($background !== false) - { - $bg = $this->allocate_named('background', $background); - imagefill($this->img, 0, 0, $bg); - } - } + static $fonts = array(); - /** - * Lookup a named color resource - */ - function r($named_color) - { - if (isset($this->named_colors[$named_color])) - { - return $this->named_colors[$named_color]; - } - if (isset($this->named_rgb[$named_color])) + if (!sizeof($fonts)) { - return $this->allocate_named($named_color, $this->named_rgb[$named_color], 'rgb'); - } - return false; - } - - /** - * Assign a name to a color resource - */ - function name_color($name, $resource) - { - $this->named_colors[$name] = $resource; - } + global $phpbb_root_path; - /** - * random color resource - */ - function r_rand($colors) - { - return $colors[array_rand($colors)]; - } - - /** - * names and allocates a color resource - */ - function allocate_named($name, $color, $mode = false) - { - $resource = $this->allocate($color, $mode); - if ($resource !== false) - { - $this->name_color($name, $resource); - } - return $resource; - } - - /** - * allocates a specified color into the image - */ - function allocate($color, $mode = false) - { - if ($mode === false) - { - $mode = $this->mode; - } - if (!is_array($color)) - { - if (isset($this->named_rgb[$color])) + $dr = opendir($phpbb_root_path . 'includes/captcha/fonts'); + while (false !== ($entry = readdir($dr))) { - return $this->allocate_named($color, $this->named_rgb[$color], 'rgb'); - } - if (!is_int($color)) - { - return false; - } - $mode = 'rgb'; - $color = array( - 255 & ($color >> 16), - 255 & ($color >> 8), - 255 & $color, - ); - } - - if (isset($color['mode'])) - { - $mode = $color['mode']; - unset($color['mode']); - } - if (isset($color['random'])) - { - unset($color['random']); - // everything else is params - return $this->random_color($color, $mode); - } - - $rgb = color_manager::model_convert($color, $mode, 'rgb'); - $store = ($this->mode == 'rgb') ? $rgb : color_manager::model_convert($color, $mode, $this->mode); - $resource = imagecolorallocate($this->img, $rgb[0], $rgb[1], $rgb[2]); - - $this->colors[$resource] = $store; - - return $resource; - } - - /** - * randomly generates a color, with optional params - */ - function random_color($params = array(), $mode = false) - { - if ($mode === false) - { - $mode = $this->mode; - } - switch ($mode) - { - case 'rgb': - - // @TODO random rgb generation. do we intend to do this, or is it just too tedious? - - break; - - case 'ahsv': - case 'hsv': - default: - - $default_params = array( - 'hue_bias' => false, // degree / 'r'/'g'/'b'/'c'/'m'/'y' /'o' - 'hue_range' => false, // if hue bias, then difference range +/- from bias - 'min_saturation' => 30, // 0 - 100 - 'max_saturation' => 100, // 0 - 100 - 'min_value' => 30, // 0 - 100 - 'max_value' => 100, // 0 - 100 - ); - - $alt = ($mode == 'ahsv'); - - $params = array_merge($default_params, $params); - - $min_hue = 0; - $max_hue = 359; - $min_saturation = max(0, $params['min_saturation']); - $max_saturation = min(100, $params['max_saturation']); - $min_value = max(0, $params['min_value']); - $max_value = min(100, $params['max_value']); - - if ($params['hue_bias'] !== false) - { - if (is_numeric($params['hue_bias'])) - { - $h = intval($params['hue_bias']) % 360; - } - else - { - switch ($params['hue_bias']) - { - case 'o': - $h = $alt ? 60 : 30; - break; - - case 'y': - $h = $alt ? 120 : 60; - break; - - case 'g': - $h = $alt ? 180 : 120; - break; - - case 'c': - $h = $alt ? 210 : 180; - break; - - case 'b': - $h = 240; - break; - - case 'm': - $h = 300; - break; - - case 'r': - default: - $h = 0; - break; - } - } - - $min_hue = $h + 360; - $max_hue = $h + 360; - - if ($params['hue_range']) - { - $min_hue -= min(180, $params['hue_range']); - $max_hue += min(180, $params['hue_range']); - } - } - - $h = mt_rand($min_hue, $max_hue); - $s = mt_rand($min_saturation, $max_saturation); - $v = mt_rand($min_value, $max_value); - - return $this->allocate(array($h, $s, $v), $mode); - - break; - } - } - - function color_scheme($resource, $scheme, $include_original = true) - { - $mode = (in_array($this->mode, array('hsv', 'ahsv'), true) ? $this->mode : 'hsv'); - if (($pre = $this->r($resource)) !== false) - { - $resource = $pre; - } - $color = color_manager::model_convert($this->colors[$resource], $this->mode, $mode); - $results = $include_original ? array($resource) : array(); - - switch ($scheme) - { - case 'complement': - - $color2 = $color; - $color2[0] += 180; - $results[] = $this->allocate($color2, $mode); - - break; - - case 'triadic': - - $color2 = $color3 = $color; - $color2[0] += 120; - $color3[0] += 240; - $results[] = $this->allocate($color2, $mode); - $results[] = $this->allocate($color3, $mode); - - break; - - case 'tetradic': - - $color2 = $color3 = $color4 = $color; - $color2[0] += 30; - $color3[0] += 180; - $color4[0] += 210; - $results[] = $this->allocate($color2, $mode); - $results[] = $this->allocate($color3, $mode); - $results[] = $this->allocate($color4, $mode); - - break; - - case 'analogous': - - $color2 = $color3 = $color; - $color2[0] += 30; - $color3[0] += 330; - $results[] = $this->allocate($color2, $mode); - $results[] = $this->allocate($color3, $mode); - - break; - } - return $results; - } - - function mono_range($resource, $type = 'both', $count = 5, $include_original = true) - { - if (is_array($resource)) - { - $results = array(); - for ($i = 0, $size = sizeof($resource); $i < $size; ++$i) - { - $results = array_merge($results, $this->mono_range($resource[$i], $type, $count, $include_original)); - } - return $results; - } - $mode = (in_array($this->mode, array('hsv', 'ahsv'), true) ? $this->mode : 'ahsv'); - if (($pre = $this->r($resource)) !== false) - { - $resource = $pre; - } - $color = color_manager::model_convert($this->colors[$resource], $this->mode, $mode); - - $results = array(); - if ($include_original) - { - $results[] = $resource; - $count--; - } - - switch ($type) - { - case 'saturation': - - $pivot = $color[1]; - $num_below = intval(($pivot * $count) / 100); - $num_above = $count - $num_below; - - for ($i = $num_above; $i > 0; --$i) - { - $color[1] = (($i * 100) + (($num_above - $i) * $pivot)) / $num_above; - $results[] = $this->allocate($color, $mode); - } - - ++$num_below; - - for ($i = $num_below - 1; $i > 0; --$i) - { - $color[1] = ($i * $pivot) / $num_below;; - $results[] = $this->allocate($color, $mode); - } - - return $results; - - break; - - case 'value': - - $pivot = $color[2]; - $num_below = intval(($pivot * $count) / 100); - $num_above = $count - $num_below; - - for ($i = $num_above; $i > 0; --$i) - { - $color[2] = (($i * 100) + (($num_above - $i) * $pivot)) / $num_above; - $results[] = $this->allocate($color, $mode); - } - - ++$num_below; - - for ($i = $num_below - 1; $i > 0; --$i) - { - $color[2] = ($i * $pivot) / $num_below;; - $results[] = $this->allocate($color, $mode); - } - - return $results; - - break; - - case 'both': - - // This is a hard problem. I chicken out and do an even triangle - // the problem is that it disregards the original saturation and value, - // and as such a generated result might come arbitrarily close to our original value. - $length = ceil(sqrt($count * 2)); - for ($i = $length; $i > 0; --$i) - { - for ($j = $i; $j > 0; --$j) - { - $color[1] = ($i * 100) / $length; - $color[2] = ($j * 100) / $i; - $results[] = $this->allocate($color, $mode); - --$count; - if (!$count) - { - return $results; - } - } - } - - return $results; - - break; - } - - return false; - } - - function is_dark($resource) - { - $color = (($pre = $this->r($resource)) !== false) ? $this->colors[$pre] : $this->colors[$resource]; - switch($this->mode) - { - case 'ahsv': - case 'hsv': - - return ($color[2] <= 50); - - break; - - case 'rgb': - - return (max($color[0], $color[1], $color[2]) <= 128); - - break; - } - return false; - } - - /** - * Convert from one color model to another - * - * note: properly following coding standards here yields unweildly amounts of whitespace, rendering this less than easily readable - * - */ - function model_convert($color, $from_model, $to_model) - { - if ($from_model == $to_model) - { - return $color; - } - switch ($to_model) - { - case 'hsv': - switch($from_model) - { - case 'ahsv': - return color_manager::ah2h($color); - break; - - case 'rgb': - return color_manager::rgb2hsv($color); - break; - } - break; - - case 'ahsv': - switch($from_model) + if (strtolower(pathinfo($entry, PATHINFO_EXTENSION)) == 'ttf') { - case 'hsv': - return color_manager::h2ah($color); - break; - - case 'rgb': - return color_manager::h2ah(color_manager::rgb2hsv($color)); - break; - } - break; - - case 'rgb': - switch($from_model) - { - case 'hsv': - return color_manager::hsv2rgb($color); - break; - - case 'ahsv': - return color_manager::hsv2rgb(color_manager::ah2h($color)); - break; + $fonts[] = $phpbb_root_path . 'includes/captcha/fonts/' . $entry; } - break; - } - return false; - } - - /** - * Slightly altered from wikipedia's algorithm - */ - function hsv2rgb($hsv) - { - color_manager::normalize_hue($hsv[0]); - $h = $hsv[0]; - $s = min(1, max(0, $hsv[1] / 100)); - $v = min(1, max(0, $hsv[2] / 100)); - - $hi = floor($hsv[0] / 60); // calculate hue sector - - $p = $v * (1 - $s); // calculate opposite color - $f = ($h / 60) - $hi; // calculate distance between hex vertices - if (!($hi & 1)) // coming in or going out? - { - $f = 1 - $f; - } - $q = $v * (1 - ($f * $s)); // calculate adjacent color - - switch ($hi) - { - case 0: - $rgb = array($v, $q, $p); - break; - - case 1: - $rgb = array($q, $v, $p); - break; - - case 2: - $rgb = array($p, $v, $q); - break; - - case 3: - $rgb = array($p, $q, $v); - break; - - case 4: - $rgb = array($q, $p, $v); - break; - - case 5: - $rgb = array($v, $p, $q); - break; - - default: - return array(0, 0, 0); - break; - } - return array(255 * $rgb[0], 255 * $rgb[1], 255 * $rgb[2]); - } - - /** - * (more than) Slightly altered from wikipedia's algorithm - */ - function rgb2hsv($rgb) - { - $r = min(255, max(0, $rgb[0])); - $g = min(255, max(0, $rgb[1])); - $b = min(255, max(0, $rgb[2])); - $max = max($r, $g, $b); - $min = min($r, $g, $b); - - $v = $max / 255; - $s = (!$max) ? 0 : 1 - ($min / $max); - $h = $max - $min; // if max - min is 0, we want hue to be 0 anyway. - if ($h) - { - switch ($max) - { - case $g: - $h = 120 + (60 * ($b - $r) / $h); - break; - - case $b: - $h = 240 + (60 * ($r - $g) / $h); - break; - - case $r: - $h = 360 + (60 * ($g - $b) / $h); - break; } + closedir($dr); } - color_manager::normalize_hue($h); - return array($h, $s * 100, $v * 100); - } - - /** - * Bleh - */ - function normalize_hue(&$hue) - { - $hue %= 360; - if ($hue < 0) - { - $hue += 360; - } - } - - /** - * Alternate hue to hue - */ - function ah2h($ahue) - { - if (is_array($ahue)) - { - $ahue[0] = color_manager::ah2h($ahue[0]); - return $ahue; - } - color_manager::normalize_hue($ahue); - if ($ahue >= 240) // blue through red is already ok - { - return $ahue; - } - if ($ahue >= 180) // ahue green is at 180 - { - // return (240 - (2 * (240 - $ahue))); - return (2 * $ahue) - 240; // equivalent - } - if ($ahue >= 120) // ahue yellow is at 120 (RYB rather than RGB) - { - return $ahue - 60; - } - return $ahue / 2; - } - /** - * hue to Alternate hue - */ - function h2ah($hue) - { - if (is_array($hue)) - { - $hue[0] = color_manager::h2ah($hue[0]); - return $hue; - } - color_manager::normalize_hue($hue); - if ($hue >= 240) // blue through red is already ok - { - return $hue; - } - else if ($hue <= 60) - { - return $hue * 2; - } - else if ($hue <= 120) - { - return $hue + 60; - } - else - { - return ($hue + 240) / 2; - } + return $fonts[array_rand($fonts)]; } } -function vector_distance(&$char, $x, $y, $range = 0.1) -{ - $distance = $range + 1; - foreach ($char AS $vector) - { - $d = $range + 1; - switch ($vector[0]) - { - case 'arc': - - $dx = $x - $vector[1]; - $dy = -($y - $vector[2]); //because our arcs are upside-down.... - if (abs($dx) > abs($dy)) - { - $phi = rad2deg(atan(($dy * $vector[3])/($dx * $vector[4]))); - $phi += ($dx < 0) ? 180 : 360; - $phi %= 360; - } - else - { - $phi = 90 - rad2deg(atan(($dx * $vector[4])/($dy * $vector[3]))); - $phi += ($dy < 0) ? 180 : 360; - $phi %= 360; - } - - $internal = $vector[6] > $vector[5]; //external wraps over the 360 point - $low = $phi >= $vector[5]; //phi is above our low range - $high = $phi <= $vector[6]; //phi is below our high range. - if ($internal ? ($low && $high) : ($low || $high)) //if it wraps, it can only be one or the other - { - $radphi = deg2rad($phi); // i'm awesome. or not. - $px = cos($radphi) * 0.5 * $vector[3]; - $py = sin($radphi) * 0.5 * $vector[4]; - $d = sqrt(pow($px - $dx, 2) + pow($py - $dy, 2)); - } - - break; - - case 'line': - - $bx = $x - $vector[1]; - $by = $y - $vector[2]; - $dx = cos($vector[5]); - $dy = sin($vector[5]); - $r = ($by * $dx) - ($bx * $dy); - if ($r < $range && $r > -$range) - { - if (abs($dx) > abs($dy)) - { - $s = (($bx + ($dy * $r)) / $dx); - } - else - { - $s = (($by + ($dx * $r)) / $dy); - } - if ($s > -$range) - { - if ($s < 0) - { - $d = sqrt(pow($s, 2) + pow($r, 2)); - } - elseif ($s < $vector[6]) - { - $d = $r; - } - elseif ($s < $vector[6] + $range) - { - $d = sqrt(pow($s - $vector[6], 2) + pow($r, 2)); - } - } - } - - break; - } - $distance = min($distance, abs($d)); - } - return $distance; -} ?>
\ No newline at end of file diff --git a/phpBB/includes/captcha/captcha_non_gd.php b/phpBB/includes/captcha/captcha_non_gd.php index e247823a5e..e4ab36f30b 100644 --- a/phpBB/includes/captcha/captcha_non_gd.php +++ b/phpBB/includes/captcha/captcha_non_gd.php @@ -11,6 +11,7 @@ /** * Main non-gd captcha class +* @ignore * @package VC */ class captcha diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 61016b5b31..652bda40a6 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -27,8 +27,11 @@ define('USER_NORMAL', 0); define('USER_INACTIVE', 1); define('USER_IGNORE', 2); define('USER_FOUNDER', 3); -//define('USER_BOT', 2); -//define('USER_GUEST', 4); + +define('INACTIVE_REGISTER', 1); +define('INACTIVE_PROFILE', 2); +define('INACTIVE_MANUAL', 3); +define('INACTIVE_REMIND', 4); // ACL define('ACL_NEVER', 0); @@ -61,6 +64,19 @@ define('ITEM_UNLOCKED', 0); define('ITEM_LOCKED', 1); define('ITEM_MOVED', 2); +// Forum Flags +define('FORUM_FLAG_LINK_TRACK', 1); +define('FORUM_FLAG_PRUNE_POLL', 2); +define('FORUM_FLAG_PRUNE_ANNOUNCE', 4); +define('FORUM_FLAG_PRUNE_STICKY', 8); +define('FORUM_FLAG_ACTIVE_TOPICS', 16); +define('FORUM_FLAG_POST_REVIEW', 32); + +// Optional text flags +define('OPTION_FLAG_BBCODE', 1); +define('OPTION_FLAG_SMILIES', 2); +define('OPTION_FLAG_LINKS', 4); + // Topic types define('POST_NORMAL', 0); define('POST_STICKY', 1); @@ -114,7 +130,8 @@ define('ATTACHMENT_CATEGORY_IMAGE', 1); // Inline Images define('ATTACHMENT_CATEGORY_WM', 2); // Windows Media Files - Streaming define('ATTACHMENT_CATEGORY_RM', 3); // Real Media Files - Streaming define('ATTACHMENT_CATEGORY_THUMB', 4); // Not used within the database, only while displaying posts -//define('SWF_CAT', 5); // Replaced by [flash]? or an additional possibility? +define('ATTACHMENT_CATEGORY_FLASH', 5); // Flash/SWF files +define('ATTACHMENT_CATEGORY_QUICKTIME', 6); // Quicktime/Mov files // BBCode UID length define('BBCODE_UID_LEN', 5); @@ -130,6 +147,7 @@ define('FIELD_BOOL', 4); define('FIELD_DROPDOWN', 5); define('FIELD_DATE', 6); + // Additional constants @@ -172,7 +190,6 @@ define('PROFILE_FIELDS_DATA_TABLE', $table_prefix . 'profile_fields_data'); define('PROFILE_FIELDS_LANG_TABLE', $table_prefix . 'profile_fields_lang'); define('PROFILE_LANG_TABLE', $table_prefix . 'profile_lang'); define('RANKS_TABLE', $table_prefix . 'ranks'); -define('RATINGS_TABLE', $table_prefix . 'ratings'); define('REPORTS_TABLE', $table_prefix . 'reports'); define('REPORTS_REASONS_TABLE', $table_prefix . 'reports_reasons'); define('SEARCH_RESULTS_TABLE', $table_prefix . 'search_results'); @@ -193,7 +210,6 @@ define('TOPICS_TRACK_TABLE', $table_prefix . 'topics_track'); define('TOPICS_WATCH_TABLE', $table_prefix . 'topics_watch'); define('USER_GROUP_TABLE', $table_prefix . 'user_group'); define('USERS_TABLE', $table_prefix . 'users'); -define('USERS_NOTES_TABLE', $table_prefix . 'users_notes'); define('WARNINGS_TABLE', $table_prefix . 'warnings'); define('WORDS_TABLE', $table_prefix . 'words'); define('ZEBRA_TABLE', $table_prefix . 'zebra'); diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index f774b5dcc3..d2d3efedaa 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -39,6 +39,11 @@ class dbal var $sql_error_sql = ''; /** + * Current sql layer + */ + var $sql_layer = ''; + + /** * Constructor */ function dbal() @@ -48,6 +53,10 @@ class dbal 'normal' => 0, 'total' => 0, ); + + // Fill default sql layer based on the class being called. + // This can be changed by the specified layer itself later if needed. + $this->sql_layer = substr(get_class($this), 5); } /** @@ -110,12 +119,12 @@ class dbal */ function sql_fetchrowset($query_id = false) { - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } - if ($query_id) + if ($query_id !== false) { $result = array(); while ($row = $this->sql_fetchrow($query_id)) @@ -130,8 +139,40 @@ class dbal } /** + * Fetch field + * if rownum is false, the current row is used, else it is pointing to the row (zero-based) + */ + function sql_fetchfield($field, $rownum = false, $query_id = false) + { + global $cache; + + if ($query_id === false) + { + $query_id = $this->query_result; + } + + if ($query_id !== false) + { + if ($rownum !== false) + { + $this->sql_rowseek($rownum, $query_id); + } + + if (!is_object($query_id) && isset($cache->sql_rowset[$query_id])) + { + return $cache->sql_fetchfield($query_id, $field); + } + + $row = $this->sql_fetchrow($query_id); + return (isset($row[$field])) ? $row[$field] : false; + } + + return false; + } + + /** * SQL Transaction - * @access: private + * @access private */ function sql_transaction($status = 'begin') { @@ -211,6 +252,12 @@ class dbal $ary = array(); foreach ($assoc_ary as $id => $sql_ary) { + // If by accident the sql array is only one-dimensional we build a normal insert statement + if (!is_array($sql_ary)) + { + return $this->sql_build_array('INSERT', $assoc_ary); + } + $values = array(); foreach ($sql_ary as $key => $var) { @@ -234,27 +281,75 @@ class dbal return $query; } + /** + * Build IN, NOT IN, = and <> sql comparison string. + * @access public + */ function sql_in_set($field, $array, $negate = false) { if (!sizeof($array)) { - trigger_error('No values specified for SQL IN comparison', E_USER_ERROR); + // Not optimal, but at least the backtrace should help in identifying where the problem lies. + $this->sql_error('No values specified for SQL IN comparison'); } - $values = array(); - foreach ($array as $var) + if (!is_array($array)) { - $values[] = $this->_sql_validate_value($var); + $array = array($array); } - if (sizeof($values) == 1) + if (sizeof($array) == 1) { - return $field . ($negate ? ' <> ' : ' = ') . $values[0]; + @reset($array); + $var = current($array); + + return $field . ($negate ? ' <> ' : ' = ') . $this->_sql_validate_value($var); } else { - return $field . ($negate ? ' NOT IN ' : ' IN ' ) . '(' . implode(', ', $values) . ')'; + return $field . ($negate ? ' NOT IN ' : ' IN ' ) . '(' . implode(', ', array_map(array($this, '_sql_validate_value'), $array)) . ')'; + } + } + + /** + * Run more than one insert statement. + * + * @param $sql_ary array multi-dimensional array holding the statement data. + * @param $table string table name to run the statements on + * + * @return bool false if no statements were executed. + * @access public + */ + function sql_multi_insert($table, &$sql_ary) + { + if (!sizeof($sql_ary)) + { + return false; } + + switch ($this->sql_layer) + { + case 'mysql': + case 'mysql4': + case 'mysqli': + case 'sqlite': + $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('MULTI_INSERT', $sql_ary)); + break; + + default: + foreach ($sql_ary as $ary) + { + if (!is_array($ary)) + { + return false; + } + + $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $ary)); + } + break; + } + + return true; } /** @@ -354,7 +449,7 @@ class dbal if (!$this->return_on_error) { - $message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . $error['message'] . ' [' . $error['code'] . ']'; + $message = '<u>SQL ERROR</u> [ ' . $this->sql_layer . ' ]<br /><br />' . $error['message'] . ' [' . $error['code'] . ']'; // Show complete SQL error and path to administrators only // Additionally show complete error on installation or if extended debug mode is enabled @@ -364,7 +459,7 @@ class dbal // Print out a nice backtrace... $backtrace = get_backtrace(); - $message .= ($sql) ? '<br /><br /><u>SQL</u><br /><br />' . $sql : ''; + $message .= ($sql) ? '<br /><br /><u>SQL</u><br /><br />' . htmlspecialchars($sql) : ''; $message .= ($backtrace) ? '<br /><br /><u>BACKTRACE</u><br />' . $backtrace : ''; $message .= '<br />'; } @@ -409,7 +504,7 @@ class dbal { global $cache, $starttime, $phpbb_root_path, $user; - if (empty($_GET['explain'])) + if (empty($_REQUEST['explain'])) { return false; } @@ -453,7 +548,7 @@ class dbal <br /> <p><b>Page generated in ' . round($totaltime, 4) . " seconds with {$this->num_queries['normal']} queries" . (($this->num_queries['cached']) ? " + {$this->num_queries['cached']} " . (($this->num_queries['cached'] == 1) ? 'query' : 'queries') . ' returning data from cache' : '') . '</b></p> - <p>Time spent on ' . SQL_LAYER . ' queries: <b>' . round($this->sql_time, 5) . 's</b> | Time spent on PHP: <b>' . round($totaltime - $this->sql_time, 5) . 's</b></p> + <p>Time spent on ' . $this->sql_layer . ' queries: <b>' . round($this->sql_time, 5) . 's</b> | Time spent on PHP: <b>' . round($totaltime - $this->sql_time, 5) . 's</b></p> <br /><br /> ' . $this->sql_report . ' @@ -504,7 +599,7 @@ class dbal else { $error = $this->sql_error(); - $this->sql_report .= '<b style="color: red">FAILED</b> - ' . SQL_LAYER . ' Error ' . $error['code'] . ': ' . htmlspecialchars($error['message']); + $this->sql_report .= '<b style="color: red">FAILED</b> - ' . $this->sql_layer . ' Error ' . $error['code'] . ': ' . htmlspecialchars($error['message']); } $this->sql_report .= '</p><br /><br />'; diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 7ea5dd3612..7fd034c7dc 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -9,24 +9,18 @@ */ /** +* @ignore */ if (!defined('IN_PHPBB')) { exit; } -/** -* @ignore -*/ -if (!defined('SQL_LAYER')) -{ - - define('SQL_LAYER', 'firebird'); - include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); +include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** * Firebird/Interbase Database Abstraction Layer -* Minimum Requirement is Firebird 1.5+/Interbase 7.1+ +* Minimum Requirement is Firebird 2.0 * @package dbal */ class dbal_firebird extends dbal @@ -66,7 +60,7 @@ class dbal_firebird extends dbal /** * SQL Transaction - * @access: private + * @access private */ function _sql_transaction($status = 'begin') { @@ -107,7 +101,7 @@ class dbal_firebird extends dbal $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); - if (!$this->query_result) + if ($this->query_result === false) { if (($this->query_result = @ibase_query($this->db_connect_id, $query)) === false) { @@ -122,7 +116,8 @@ class dbal_firebird extends dbal } else { - @ibase_commit(); + // way cooler than ibase_commit_ret :D + @ibase_query('COMMIT RETAIN;'); } } @@ -165,27 +160,6 @@ class dbal_firebird extends dbal } /** - * Return number of rows - * Not used within core code - */ - function sql_numrows($query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_numrows($query_id); - } - - return false; - } - - /** * Return number of affected rows */ function sql_affectedrows() @@ -208,7 +182,7 @@ class dbal_firebird extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -218,6 +192,11 @@ class dbal_firebird extends dbal return $cache->sql_fetchrow($query_id); } + if ($query_id === false) + { + return false; + } + $row = array(); $cur_row = @ibase_fetch_object($query_id, IBASE_TEXT); @@ -228,60 +207,41 @@ class dbal_firebird extends dbal foreach (get_object_vars($cur_row) as $key => $value) { - $row[strtolower($key)] = trim(str_replace("\\0", "\0", str_replace("\\n", "\n", $value))); + $row[strtolower($key)] = trim(str_replace(array("\\0", "\\n"), array("\0", "\n"), $value)); } return (sizeof($row)) ? $row : false; } /** - * Fetch field - * if rownum is false, the current row is used, else it is pointing to the row (zero-based) + * Seek to given row number + * rownum is zero-based */ - function sql_fetchfield($field, $rownum = false, $query_id = false) + function sql_rowseek($rownum, $query_id = false) { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } - if ($query_id) + if (isset($cache->sql_rowset[$query_id])) { - if ($rownum !== false) - { - $this->sql_rowseek($rownum, $query_id); - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_fetchfield($query_id, $field); - } - - $row = $this->sql_fetchrow($query_id); - return isset($row[$field]) ? $row[$field] : false; + return $cache->sql_rowseek($rownum, $query_id); } - return false; - } - - /** - * Seek to given row number - * rownum is zero-based - */ - function sql_rowseek($rownum, $query_id = false) - { - global $cache; - - if (!$query_id) + if ($query_id === false) { - $query_id = $this->query_result; + return; } - if (isset($cache->sql_rowset[$query_id])) + $this->sql_freeresult($query_id); + $query_id = $this->sql_query($this->last_query_text); + + if ($query_id === false) { - return $cache->sql_rowseek($query_id, $rownum); + return false; } // We do not fetch the row for rownum == 0 because then the next resultset would be the second row @@ -303,7 +263,7 @@ class dbal_firebird extends dbal { $query_id = $this->query_result; - if ($query_id && $this->last_query_text != '') + if ($query_id !== false && $this->last_query_text != '') { if ($this->query_result && preg_match('#^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)#is', $this->last_query_text, $tablename)) { @@ -331,7 +291,7 @@ class dbal_firebird extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -355,12 +315,12 @@ class dbal_firebird extends dbal */ function sql_escape($msg) { - return (@ini_get('magic_quotes_sybase') || strtolower(@ini_get('magic_quotes_sybase')) == 'on') ? str_replace('\\\'', '\'', addslashes($msg)) : str_replace('\'', '\'\'', stripslashes($msg)); + return (@ini_get('magic_quotes_sybase') == 1 || strtolower(@ini_get('magic_quotes_sybase')) == 'on') ? str_replace('\\\'', '\'', addslashes($msg)) : str_replace('\'', '\'\'', stripslashes($msg)); } /** * Build db-specific query data - * @access: private + * @access private */ function _sql_custom_build($stage, $data) { @@ -369,7 +329,7 @@ class dbal_firebird extends dbal /** * return sql error array - * @access: private + * @access private */ function _sql_error() { @@ -381,7 +341,7 @@ class dbal_firebird extends dbal /** * Close sql connection - * @access: private + * @access private */ function _sql_close() { @@ -395,7 +355,7 @@ class dbal_firebird extends dbal /** * Build db-specific report - * @access: private + * @access private */ function _sql_report($mode, $query = '') { @@ -423,9 +383,6 @@ class dbal_firebird extends dbal break; } } - } -} // if ... define - ?>
\ No newline at end of file diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index fe6cf75b12..f95f99969c 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -9,20 +9,14 @@ */ /** +* @ignore */ if (!defined('IN_PHPBB')) { exit; } -/** -* @ignore -*/ -if (!defined('SQL_LAYER')) -{ - - define('SQL_LAYER', 'mssql'); - include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); +include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** * MSSQL Database Abstraction Layer @@ -79,7 +73,7 @@ class dbal_mssql extends dbal /** * SQL Transaction - * @access: private + * @access private */ function _sql_transaction($status = 'begin') { @@ -122,10 +116,13 @@ class dbal_mssql extends dbal $this->sql_report('start', $query); } + // For now, MSSQL has no real UTF-8 support + $query = utf8_decode($query); + $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); - if (!$this->query_result) + if ($this->query_result === false) { if (($this->query_result = @mssql_query($query, $this->db_connect_id)) === false) { @@ -169,30 +166,26 @@ class dbal_mssql extends dbal { $this->query_result = false; - // if $total is set to 0 we do not want to limit the number of rows - if ($total == 0) + // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows) + if ($total) { - $total = -1; - } - - $row_offset = ($total) ? $offset : ''; - $num_rows = ($total) ? $total : $offset; - - if (strpos($query, 'SELECT DISTINCT') === 0) - { - $query = 'SELECT DISTINCT TOP ' . ($row_offset + $num_rows) . ' ' . substr($query, 15); - } - else - { - $query = 'SELECT TOP ' . ($row_offset + $num_rows) . ' ' . substr($query, 6); + // We need to grab the total number of rows + the offset number of rows to get the correct result + if (strpos($query, 'SELECT DISTINCT') === 0) + { + $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15); + } + else + { + $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6); + } } $result = $this->sql_query($query, $cache_ttl); - // Seek by $row_offset rows - if ($row_offset) + // Seek by $offset rows + if ($offset) { - $this->sql_rowseek($result, $row_offset); + $this->sql_rowseek($offset, $result); } return $result; @@ -204,27 +197,6 @@ class dbal_mssql extends dbal } /** - * Return number of rows - * Not used within core code - */ - function sql_numrows($query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_numrows($query_id); - } - - return ($query_id) ? @mssql_num_rows($query_id) : false; - } - - /** * Return number of affected rows */ function sql_affectedrows() @@ -239,7 +211,7 @@ class dbal_mssql extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -249,6 +221,11 @@ class dbal_mssql extends dbal return $cache->sql_fetchrow($query_id); } + if ($query_id === false) + { + return false; + } + $row = @mssql_fetch_assoc($query_id); // I hope i am able to remove this later... hopefully only a PHP or MSSQL bug @@ -264,38 +241,6 @@ class dbal_mssql extends dbal } /** - * Fetch field - * if rownum is false, the current row is used, else it is pointing to the row (zero-based) - */ - function sql_fetchfield($field, $rownum = false, $query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if ($query_id) - { - if ($rownum !== false) - { - $this->sql_rowseek($rownum, $query_id); - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_fetchfield($query_id, $field); - } - - $row = $this->sql_fetchrow($query_id); - return isset($row[$field]) ? $row[$field] : false; - } - - return false; - } - - /** * Seek to given row number * rownum is zero-based */ @@ -303,17 +248,17 @@ class dbal_mssql extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } if (isset($cache->sql_rowset[$query_id])) { - return $cache->sql_rowseek($query_id, $rownum); + return $cache->sql_rowseek($rownum, $query_id); } - return ($query_id) ? @mssql_data_seek($query_id, $rownum) : false; + return ($query_id !== false) ? @mssql_data_seek($query_id, $rownum) : false; } /** @@ -342,7 +287,7 @@ class dbal_mssql extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -371,7 +316,7 @@ class dbal_mssql extends dbal /** * return sql error array - * @access: private + * @access private */ function _sql_error() { @@ -410,7 +355,7 @@ class dbal_mssql extends dbal /** * Build db-specific query data - * @access: private + * @access private */ function _sql_custom_build($stage, $data) { @@ -419,7 +364,7 @@ class dbal_mssql extends dbal /** * Close sql connection - * @access: private + * @access private */ function _sql_close() { @@ -428,7 +373,7 @@ class dbal_mssql extends dbal /** * Build db-specific report - * @access: private + * @access private */ function _sql_report($mode, $query = '') { @@ -486,9 +431,6 @@ class dbal_mssql extends dbal break; } } - } -} // if ... define - ?>
\ No newline at end of file diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php index e1b2675a23..12e3ca686e 100644 --- a/phpBB/includes/db/mssql_odbc.php +++ b/phpBB/includes/db/mssql_odbc.php @@ -9,20 +9,14 @@ */ /** +* @ignore */ if (!defined('IN_PHPBB')) { exit; } -/** -* @ignore -*/ -if (!defined('SQL_LAYER')) -{ - - define('SQL_LAYER', 'mssql_odbc'); - include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); +include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** * Unified ODBC functions @@ -73,7 +67,7 @@ class dbal_mssql_odbc extends dbal /** * SQL Transaction - * @access: private + * @access private */ function _sql_transaction($status = 'begin') { @@ -120,11 +114,14 @@ class dbal_mssql_odbc extends dbal $this->sql_report('start', $query); } + // For now, MSSQL has no real UTF-8 support + $query = utf8_decode($query); + $this->last_query_text = $query; $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); - if (!$this->query_result) + if ($this->query_result === false) { if (($this->query_result = @odbc_exec($this->db_connect_id, $query)) === false) { @@ -168,33 +165,26 @@ class dbal_mssql_odbc extends dbal { $this->query_result = false; - // if $total is set to 0 we do not want to limit the number of rows - if ($total == 0) - { - $total = -1; - } - - $row_offset = ($total) ? $offset : 0; - $num_rows = ($total) ? $total : $offset; - - if (strpos($query, 'SELECT DISTINCT') === 0) - { - $query = 'SELECT DISTINCT TOP ' . ($row_offset + $num_rows) . ' ' . substr($query, 15); - } - else + // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows) + if ($total) { - $query = 'SELECT TOP ' . ($row_offset + $num_rows) . ' ' . substr($query, 6); + // We need to grab the total number of rows + the offset number of rows to get the correct result + if (strpos($query, 'SELECT DISTINCT') === 0) + { + $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15); + } + else + { + $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6); + } } $result = $this->sql_query($query, $cache_ttl); - // Seek by $row_offset rows - if ($row_offset) + // Seek by $offset rows + if ($offset) { - for ($i = 0; $i < $row_offset; $i++) - { - $this->sql_fetchrow($result); - } + $this->sql_rowseek($offset, $result); } return $result; @@ -206,27 +196,6 @@ class dbal_mssql_odbc extends dbal } /** - * Return number of rows - * Not used within core code - */ - function sql_numrows($query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_numrows($query_id); - } - - return ($query_id) ? @odbc_num_rows($query_id) : false; - } - - /** * Return number of affected rows */ function sql_affectedrows() @@ -241,7 +210,7 @@ class dbal_mssql_odbc extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -251,39 +220,7 @@ class dbal_mssql_odbc extends dbal return $cache->sql_fetchrow($query_id); } - return ($query_id) ? @odbc_fetch_array($query_id) : false; - } - - /** - * Fetch field - * if rownum is false, the current row is used, else it is pointing to the row (zero-based) - */ - function sql_fetchfield($field, $rownum = false, $query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if ($query_id) - { - if ($rownum !== false) - { - $this->sql_rowseek($rownum, $query_id); - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_fetchfield($query_id, $field); - } - - $row = $this->sql_fetchrow($query_id); - return isset($row[$field]) ? $row[$field] : false; - } - - return false; + return ($query_id !== false) ? @odbc_fetch_array($query_id) : false; } /** @@ -294,20 +231,25 @@ class dbal_mssql_odbc extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } if (isset($cache->sql_rowset[$query_id])) { - return $cache->sql_rowseek($query_id, $rownum); + return $cache->sql_rowseek($rownum, $query_id); + } + + if ($query_id === false) + { + return false; } $this->sql_freeresult($query_id); $query_id = $this->sql_query($this->last_query_text); - if (!$query_id) + if ($query_id === false) { return false; } @@ -352,7 +294,7 @@ class dbal_mssql_odbc extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -381,7 +323,7 @@ class dbal_mssql_odbc extends dbal /** * Build db-specific query data - * @access: private + * @access private */ function _sql_custom_build($stage, $data) { @@ -390,7 +332,7 @@ class dbal_mssql_odbc extends dbal /** * return sql error array - * @access: private + * @access private */ function _sql_error() { @@ -402,7 +344,7 @@ class dbal_mssql_odbc extends dbal /** * Close sql connection - * @access: private + * @access private */ function _sql_close() { @@ -411,7 +353,7 @@ class dbal_mssql_odbc extends dbal /** * Build db-specific report - * @access: private + * @access private */ function _sql_report($mode, $query = '') { @@ -469,9 +411,6 @@ class dbal_mssql_odbc extends dbal break; } } - } -} // if ... define - ?>
\ No newline at end of file diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index 7e363721a9..89a6e21d70 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -9,31 +9,31 @@ */ /** +* @ignore */ if (!defined('IN_PHPBB')) { exit; } -/** -* @ignore -*/ -if (!defined('SQL_LAYER')) -{ - - define('SQL_LAYER', 'mysql'); - include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); +include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** -* MySQL Database Abstraction Layer -* Minimum Requirement is 3.23+/4.0+/4.1+ +* MySQL4 Database Abstraction Layer +* Compatible with: +* MySQL 3.23+ +* MySQL 4.0+ +* MySQL 4.1+ +* MySQL 5.0+ * @package dbal */ class dbal_mysql extends dbal { + var $mysql_version; + /** * Connect to server - * @access: public + * @access public */ function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false) { @@ -42,12 +42,26 @@ class dbal_mysql extends dbal $this->server = $sqlserver . (($port) ? ':' . $port : ''); $this->dbname = $database; + $this->sql_layer = 'mysql4'; + $this->db_connect_id = ($this->persistency) ? @mysql_pconnect($this->server, $this->user, $sqlpassword) : @mysql_connect($this->server, $this->user, $sqlpassword); if ($this->db_connect_id && $this->dbname != '') { if (@mysql_select_db($this->dbname)) { + // Determine what version we are using and if it natively supports UNICODE + $this->mysql_version = mysql_get_server_info($this->db_connect_id); + + if (version_compare($this->mysql_version, '4.1.3', '>=')) + { + @mysql_query("SET NAMES 'utf8'", $this->db_connect_id); + } + else if (version_compare($this->mysql_version, '4.0.0', '<')) + { + $this->sql_layer = 'mysql'; + } + return $this->db_connect_id; } } @@ -60,12 +74,12 @@ class dbal_mysql extends dbal */ function sql_server_info() { - return 'MySQL ' . @mysql_get_server_info($this->db_connect_id); + return 'MySQL ' . $this->mysql_version; } /** * SQL Transaction - * @access: private + * @access private */ function _sql_transaction($status = 'begin') { @@ -111,7 +125,7 @@ class dbal_mysql extends dbal $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); - if (!$this->query_result) + if ($this->query_result === false) { if (($this->query_result = @mysql_query($query, $this->db_connect_id)) === false) { @@ -158,7 +172,8 @@ class dbal_mysql extends dbal // if $total is set to 0 we do not want to limit the number of rows if ($total == 0) { - $total = -1; + // Having a value of -1 was always a bug + $total = '18446744073709551615'; } $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total); @@ -172,27 +187,6 @@ class dbal_mysql extends dbal } /** - * Return number of rows - * Not used within core code - */ - function sql_numrows($query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_numrows($query_id); - } - - return ($query_id) ? @mysql_num_rows($query_id) : false; - } - - /** * Return number of affected rows */ function sql_affectedrows() @@ -207,7 +201,7 @@ class dbal_mysql extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -217,47 +211,7 @@ class dbal_mysql extends dbal return $cache->sql_fetchrow($query_id); } - return ($query_id) ? @mysql_fetch_assoc($query_id) : false; - } - - /** - * Fetch field - * if rownum is false, the current row is used, else it is pointing to the row (zero-based) - */ - function sql_fetchfield($field, $rownum = false, $query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if ($query_id) - { - if ($rownum === false) - { - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_fetchfield($query_id, $field); - } - - $row = $this->sql_fetchrow($query_id); - return isset($row[$field]) ? $row[$field] : false; - } - else - { - if (isset($cache->sql_rowset[$query_id])) - { - $cache->sql_rowseek($query_id, $rownum); - return $cache->sql_fetchfield($query_id, $field); - } - - return @mysql_result($query_id, $rownum, $field); - } - } - - return false; + return ($query_id !== false) ? @mysql_fetch_assoc($query_id) : false; } /** @@ -268,17 +222,17 @@ class dbal_mysql extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } if (isset($cache->sql_rowset[$query_id])) { - return $cache->sql_rowseek($query_id, $rownum); + return $cache->sql_rowseek($rownum, $query_id); } - return ($query_id) ? @mysql_data_seek($query_id, $rownum) : false; + return ($query_id !== false) ? @mysql_data_seek($query_id, $rownum) : false; } /** @@ -296,7 +250,7 @@ class dbal_mysql extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -324,13 +278,13 @@ class dbal_mysql extends dbal { return @mysql_real_escape_string($msg); } - + return @mysql_real_escape_string($msg, $this->db_connect_id); } /** * Build db-specific query data - * @access: private + * @access private */ function _sql_custom_build($stage, $data) { @@ -343,10 +297,10 @@ class dbal_mysql extends dbal return $data; } - + /** * return sql error array - * @access: private + * @access private */ function _sql_error() { @@ -366,7 +320,7 @@ class dbal_mysql extends dbal /** * Close sql connection - * @access: private + * @access private */ function _sql_close() { @@ -375,7 +329,7 @@ class dbal_mysql extends dbal /** * Build db-specific report - * @access: private + * @access private */ function _sql_report($mode, $query = '') { @@ -433,9 +387,6 @@ class dbal_mysql extends dbal break; } } - } -} // if ... define - ?>
\ No newline at end of file diff --git a/phpBB/includes/db/mysql4.php b/phpBB/includes/db/mysql4.php deleted file mode 100644 index 071f4c4b55..0000000000 --- a/phpBB/includes/db/mysql4.php +++ /dev/null @@ -1,443 +0,0 @@ -<?php -/** -* -* @package dbal -* @version $Id$ -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License -* -*/ - -/** -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - -/** -* @ignore -*/ -if (!defined('SQL_LAYER')) -{ - - define('SQL_LAYER', 'mysql4'); - include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); - -/** -* MySQL4 Database Abstraction Layer -* Compatible with: -* MySQL 4.0+ -* MySQL 4.1+ -* MySQL 5.0+ -* @package dbal -*/ -class dbal_mysql4 extends dbal -{ - /** - * Connect to server - */ - function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false) - { - $this->persistency = $persistency; - $this->user = $sqluser; - $this->server = $sqlserver . (($port) ? ':' . $port : ''); - $this->dbname = $database; - - $this->db_connect_id = ($this->persistency) ? @mysql_pconnect($this->server, $this->user, $sqlpassword) : @mysql_connect($this->server, $this->user, $sqlpassword); - - if ($this->db_connect_id && $this->dbname != '') - { - if (@mysql_select_db($this->dbname)) - { - return $this->db_connect_id; - } - } - - return $this->sql_error(''); - } - - /** - * Version information about used database - */ - function sql_server_info() - { - return 'MySQL ' . @mysql_get_server_info($this->db_connect_id); - } - - /** - * SQL Transaction - * @access: private - */ - function _sql_transaction($status = 'begin') - { - switch ($status) - { - case 'begin': - return @mysql_query('BEGIN', $this->db_connect_id); - break; - - case 'commit': - return @mysql_query('COMMIT', $this->db_connect_id); - break; - - case 'rollback': - return @mysql_query('ROLLBACK', $this->db_connect_id); - break; - } - - return true; - } - - /** - * Base query method - * - * @param string $query Contains the SQL query which shall be executed - * @param int $cache_ttl Either 0 to avoid caching or the time in seconds which the result shall be kept in cache - * @return mixed When casted to bool the returned value returns true on success and false on failure - * - * @access public - */ - function sql_query($query = '', $cache_ttl = 0) - { - if ($query != '') - { - global $cache; - - // EXPLAIN only in extra debug mode - if (defined('DEBUG_EXTRA')) - { - $this->sql_report('start', $query); - } - - $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; - $this->sql_add_num_queries($this->query_result); - - if (!$this->query_result) - { - if (($this->query_result = @mysql_query($query, $this->db_connect_id)) === false) - { - $this->sql_error($query); - } - - if (defined('DEBUG_EXTRA')) - { - $this->sql_report('stop', $query); - } - - if ($cache_ttl && method_exists($cache, 'sql_save')) - { - $this->open_queries[(int) $this->query_result] = $this->query_result; - $cache->sql_save($query, $this->query_result, $cache_ttl); - } - else if (strpos($query, 'SELECT') === 0 && $this->query_result) - { - $this->open_queries[(int) $this->query_result] = $this->query_result; - } - } - else if (defined('DEBUG_EXTRA')) - { - $this->sql_report('fromcache', $query); - } - } - else - { - return false; - } - - return ($this->query_result) ? $this->query_result : false; - } - - /** - * Build LIMIT query - */ - function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) - { - if ($query != '') - { - $this->query_result = false; - - // if $total is set to 0 we do not want to limit the number of rows - if ($total == 0) - { - // Because MySQL 4.1+ no longer supports -1 in LIMIT queries we set it to the maximum value - $total = '18446744073709551615'; - } - - $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total); - - return $this->sql_query($query, $cache_ttl); - } - else - { - return false; - } - } - - /** - * Return number of rows - * Not used within core code - */ - function sql_numrows($query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_numrows($query_id); - } - - return ($query_id) ? @mysql_num_rows($query_id) : false; - } - - /** - * Return number of affected rows - */ - function sql_affectedrows() - { - return ($this->db_connect_id) ? @mysql_affected_rows($this->db_connect_id) : false; - } - - /** - * Fetch current row - */ - function sql_fetchrow($query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_fetchrow($query_id); - } - - return ($query_id) ? @mysql_fetch_assoc($query_id) : false; - } - - /** - * Fetch field - * if rownum is false, the current row is used, else it is pointing to the row (zero-based) - */ - function sql_fetchfield($field, $rownum = false, $query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if ($query_id) - { - if ($rownum === false) - { - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_fetchfield($query_id, $field); - } - - $row = $this->sql_fetchrow($query_id); - return isset($row[$field]) ? $row[$field] : false; - } - else - { - if (isset($cache->sql_rowset[$query_id])) - { - $cache->sql_rowseek($query_id, $rownum); - return $cache->sql_fetchfield($query_id, $field); - } - - return @mysql_result($query_id, $rownum, $field); - } - } - - return false; - } - - /** - * Seek to given row number - * rownum is zero-based - */ - function sql_rowseek($rownum, $query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_rowseek($query_id, $rownum); - } - - return ($query_id) ? @mysql_data_seek($query_id, $rownum) : false; - } - - /** - * Get last inserted id after insert statement - */ - function sql_nextid() - { - return ($this->db_connect_id) ? @mysql_insert_id($this->db_connect_id) : false; - } - - /** - * Free sql result - */ - function sql_freeresult($query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_freeresult($query_id); - } - - if (isset($this->open_queries[(int) $query_id])) - { - unset($this->open_queries[(int) $query_id]); - return @mysql_free_result($query_id); - } - - return false; - } - - /** - * Escape string used in sql query - */ - function sql_escape($msg) - { - if (!$this->db_connect_id) - { - return @mysql_real_escape_string($msg); - } - - return @mysql_real_escape_string($msg, $this->db_connect_id); - } - - /** - * Build db-specific query data - * @access: private - */ - function _sql_custom_build($stage, $data) - { - switch ($stage) - { - case 'FROM': - $data = '(' . $data . ')'; - break; - } - - return $data; - } - - /** - * return sql error array - * @access: private - */ - function _sql_error() - { - if (!$this->db_connect_id) - { - return array( - 'message' => @mysql_error(), - 'code' => @mysql_errno() - ); - } - - return array( - 'message' => @mysql_error($this->db_connect_id), - 'code' => @mysql_errno($this->db_connect_id) - ); - } - - /** - * Close sql connection - * @access: private - */ - function _sql_close() - { - return @mysql_close($this->db_connect_id); - } - - /** - * Build db-specific report - * @access: private - */ - function _sql_report($mode, $query = '') - { - switch ($mode) - { - case 'start': - - $explain_query = $query; - if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) - { - $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; - } - else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) - { - $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; - } - - if (preg_match('/^SELECT/', $explain_query)) - { - $html_table = false; - - if ($result = @mysql_query("EXPLAIN $explain_query", $this->db_connect_id)) - { - while ($row = @mysql_fetch_assoc($result)) - { - $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); - } - } - @mysql_free_result($result); - - if ($html_table) - { - $this->html_hold .= '</table>'; - } - } - - break; - - case 'fromcache': - $endtime = explode(' ', microtime()); - $endtime = $endtime[0] + $endtime[1]; - - $result = @mysql_query($query, $this->db_connect_id); - while ($void = @mysql_fetch_assoc($result)) - { - // Take the time spent on parsing rows into account - } - @mysql_free_result($result); - - $splittime = explode(' ', microtime()); - $splittime = $splittime[0] + $splittime[1]; - - $this->sql_report('record_fromcache', $query, $endtime, $splittime); - - break; - } - } -} - -} // if ... define - -?>
\ No newline at end of file diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index fa4d3ffdc7..86700744fb 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -9,20 +9,14 @@ */ /** +* @ignore */ if (!defined('IN_PHPBB')) { exit; } -/** -* @ignore -*/ -if (!defined('SQL_LAYER')) -{ - - define('SQL_LAYER', 'mysqli'); - include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); +include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** * MySQLi Database Abstraction Layer @@ -48,10 +42,8 @@ class dbal_mysqli extends dbal if ($this->db_connect_id && $this->dbname != '') { - if (@mysqli_select_db($this->db_connect_id, $this->dbname)) - { - return $this->db_connect_id; - } + @mysqli_query($this->db_connect_id, "SET NAMES 'utf8'"); + return $this->db_connect_id; } return $this->sql_error(''); @@ -67,7 +59,7 @@ class dbal_mysqli extends dbal /** * SQL Transaction - * @access: private + * @access private */ function _sql_transaction($status = 'begin') { @@ -117,7 +109,7 @@ class dbal_mysqli extends dbal $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); - if (!$this->query_result) + if ($this->query_result === false) { if (($this->query_result = @mysqli_query($this->db_connect_id, $query)) === false) { @@ -174,27 +166,6 @@ class dbal_mysqli extends dbal } /** - * Return number of rows - * Not used within core code - */ - function sql_numrows($query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if (!is_object($query_id) && isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_numrows($query_id); - } - - return ($query_id) ? @mysqli_num_rows($query_id) : false; - } - - /** * Return number of affected rows */ function sql_affectedrows() @@ -209,7 +180,7 @@ class dbal_mysqli extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -219,39 +190,7 @@ class dbal_mysqli extends dbal return $cache->sql_fetchrow($query_id); } - return ($query_id) ? @mysqli_fetch_assoc($query_id) : false; - } - - /** - * Fetch field - * if rownum is false, the current row is used, else it is pointing to the row (zero-based) - */ - function sql_fetchfield($field, $rownum = false, $query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if ($query_id) - { - if ($rownum !== false) - { - $this->sql_rowseek($rownum, $query_id); - } - - if (!is_object($query_id) && isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_fetchfield($query_id, $field); - } - - $row = $this->sql_fetchrow($query_id); - return isset($row[$field]) ? $row[$field] : false; - } - - return false; + return ($query_id !== false) ? @mysqli_fetch_assoc($query_id) : false; } /** @@ -262,17 +201,17 @@ class dbal_mysqli extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } if (!is_object($query_id) && isset($cache->sql_rowset[$query_id])) { - return $cache->sql_rowseek($query_id, $rownum); + return $cache->sql_rowseek($rownum, $query_id); } - return ($query_id) ? @mysqli_data_seek($query_id, $rownum) : false; + return ($query_id !== false) ? @mysqli_data_seek($query_id, $rownum) : false; } /** @@ -290,7 +229,7 @@ class dbal_mysqli extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -313,7 +252,7 @@ class dbal_mysqli extends dbal /** * Build db-specific query data - * @access: private + * @access private */ function _sql_custom_build($stage, $data) { @@ -329,7 +268,7 @@ class dbal_mysqli extends dbal /** * return sql error array - * @access: private + * @access private */ function _sql_error() { @@ -349,7 +288,7 @@ class dbal_mysqli extends dbal /** * Close sql connection - * @access: private + * @access private */ function _sql_close() { @@ -358,7 +297,7 @@ class dbal_mysqli extends dbal /** * Build db-specific report - * @access: private + * @access private */ function _sql_report($mode, $query = '') { @@ -418,6 +357,4 @@ class dbal_mysqli extends dbal } } -} // if ... define - ?>
\ No newline at end of file diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php index fc5bf6f78e..e8a0ce3605 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -9,20 +9,14 @@ */ /** +* @ignore */ if (!defined('IN_PHPBB')) { exit; } -/** -* @ignore -*/ -if(!defined('SQL_LAYER')) -{ - - define('SQL_LAYER', 'oracle'); - include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); +include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** * Oracle Database Abstraction Layer @@ -42,7 +36,7 @@ class dbal_oracle extends dbal $this->server = $sqlserver . (($port) ? ':' . $port : ''); $this->dbname = $database; - $this->db_connect_id = ($this->persistency) ? @ociplogon($this->user, $sqlpassword, $this->server) : @ocinlogon($this->user, $sqlpassword, $this->server); + $this->db_connect_id = ($this->persistency) ? @ociplogon($this->user, $sqlpassword, $this->server, 'UTF8') : @ocinlogon($this->user, $sqlpassword, $this->server, 'UTF8'); return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); } @@ -57,7 +51,7 @@ class dbal_oracle extends dbal /** * SQL Transaction - * @access: private + * @access private */ function _sql_transaction($status = 'begin') { @@ -104,7 +98,7 @@ class dbal_oracle extends dbal $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); - if (!$this->query_result) + if ($this->query_result === false) { $in_transaction = false; if (!$this->transaction) @@ -116,7 +110,63 @@ class dbal_oracle extends dbal $in_transaction = true; } + $array = array(); + + // We overcome Oracle's 4000 char limit by binding vars + if (preg_match('/^(INSERT INTO[^(]+)\\(([^()]+)\\) VALUES[^(]+\\(([^()]+)\\)$/', $query, $regs)) + { + if (strlen($regs[3]) > 4000) + { + $cols = explode(', ', $regs[2]); + $vals = explode(', ', $regs[3]); + foreach ($vals as $key => $value) + { + if (strlen($value) > 4002) // check to see if this thing is greater than the max + 'x2 + { + $vals[$key] = ':' . strtoupper($cols[$key]); + $array[$vals[$key]] = substr($value, 1, -1); + } + } + $query = $regs[1] . '(' . implode(', ', $cols) . ') VALUES (' . implode(', ', $vals) . ')'; + } + } + else if (preg_match('/^(UPDATE.*?)SET (.*)(\\sWHERE.*)$/s', $query, $regs)) + { + if (strlen($regs[2]) > 4000) + { + $args = explode(', ', $regs[2]); + $cols = array(); + foreach ($args as $value) + { + $temp_array = explode('=', $value); + $cols[$temp_array[0]] = $temp_array[1]; + } + + foreach ($cols as $col => $val) + { + if (strlen($val) > 4003) // check to see if this thing is greater than the max + 'x2 + a space + { + $cols[$col] = ' :' . strtoupper(rtrim($col)); + $array[ltrim($cols[$col])] = substr(trim($val), 2, -1); + } + } + + $art = array(); + foreach ($cols as $col => $val) + { + $art[] = $col . '=' . $val; + } + $query = $regs[1] . 'SET ' . implode(', ', $art) . $regs[3]; + } + } + $this->query_result = @ociparse($this->db_connect_id, $query); + + foreach ($array as $key => $value) + { + @ocibindbyname($this->query_result, $key, $array[$key], -1); + } + $success = @ociexecute($this->query_result, OCI_DEFAULT); if (!$success) @@ -226,33 +276,6 @@ class dbal_oracle extends dbal } /** - * Return number of rows - * Not used within core code - */ - function sql_numrows($query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_numrows($query_id); - } - - $result = @ocifetchstatement($query_id, $this->rowset); - - // OCIFetchStatment kills our query result so we have to execute the statment again - // if we ever want to use the query_id again. - @ociexecute($query_id, OCI_DEFAULT); - - return $result; - } - - /** * Return number of affected rows */ function sql_affectedrows() @@ -267,7 +290,7 @@ class dbal_oracle extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -277,56 +300,29 @@ class dbal_oracle extends dbal return $cache->sql_fetchrow($query_id); } - $row = array(); - $result = @ocifetchinto($query_id, $row, OCI_ASSOC + OCI_RETURN_NULLS); - - if (!$result || !$row) - { - return false; - } - - $result_row = array(); - foreach ($row as $key => $value) - { - // OCI->CLOB? - if (is_object($value)) - { - $value = $value->load(); - } - - $result_row[strtolower($key)] = $value; - } - - return ($query_id) ? $result_row : false; - } - - /** - * Fetch field - * if rownum is false, the current row is used, else it is pointing to the row (zero-based) - */ - function sql_fetchfield($field, $rownum = false, $query_id = false) - { - global $cache; - - if (!$query_id) + if ($query_id !== false) { - $query_id = $this->query_result; - } + $row = array(); + $result = @ocifetchinto($query_id, $row, OCI_ASSOC + OCI_RETURN_NULLS); - if ($query_id) - { - if ($rownum !== false) + if (!$result || !$row) { - $this->sql_rowseek($rownum, $query_id); + return false; } - if (isset($cache->sql_rowset[$query_id])) + $result_row = array(); + foreach ($row as $key => $value) { - return $cache->sql_fetchfield($query_id, $field); + // OCI->CLOB? + if (is_object($value)) + { + $value = $value->load(); + } + + $result_row[strtolower($key)] = $value; } - $row = $this->sql_fetchrow($query_id); - return isset($row[$field]) ? $row[$field] : false; + return $result_row; } return false; @@ -340,17 +336,17 @@ class dbal_oracle extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } if (isset($cache->sql_rowset[$query_id])) { - return $cache->sql_rowseek($query_id, $rownum); + return $cache->sql_rowseek($rownum, $query_id); } - if (!$query_id) + if ($query_id === false) { return false; } @@ -377,13 +373,13 @@ class dbal_oracle extends dbal { $query_id = $this->query_result; - if ($query_id && $this->last_query_text != '') + if ($query_id !== false && $this->last_query_text != '') { if (preg_match('#^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)#is', $this->last_query_text, $tablename)) { $query = 'SELECT ' . $tablename[1] . '_seq.currval FROM DUAL'; $stmt = @ociparse($this->db_connect_id, $query); - @ociexecute($stmt, OCI_DEFAULT ); + @ociexecute($stmt, OCI_DEFAULT); $temp_result = @ocifetchinto($stmt, $temp_array, OCI_ASSOC + OCI_RETURN_NULLS); @ocifreestatement($stmt); @@ -409,7 +405,7 @@ class dbal_oracle extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -443,7 +439,7 @@ class dbal_oracle extends dbal /** * return sql error array - * @access: private + * @access private */ function _sql_error() { @@ -465,7 +461,7 @@ class dbal_oracle extends dbal /** * Close sql connection - * @access: private + * @access private */ function _sql_close() { @@ -474,7 +470,7 @@ class dbal_oracle extends dbal /** * Build db-specific report - * @access: private + * @access private */ function _sql_report($mode, $query = '') { @@ -505,10 +501,6 @@ class dbal_oracle extends dbal break; } } - - } -} // if ... define - ?>
\ No newline at end of file diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index 1836952346..c06786a795 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -9,20 +9,14 @@ */ /** +* @ignore */ if (!defined('IN_PHPBB')) { exit; } -/** -* @ignore -*/ -if (!defined('SQL_LAYER')) -{ - - define('SQL_LAYER', 'postgres'); - include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); +include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** * PostgreSQL Database Abstraction Layer @@ -38,48 +32,45 @@ class dbal_postgres extends dbal */ function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false) { - $this->connect_string = ''; + $connect_string = ''; if ($sqluser) { - $this->connect_string .= "user=$sqluser "; + $connect_string .= "user=$sqluser "; } if ($sqlpassword) { - $this->connect_string .= "password=$sqlpassword "; + $connect_string .= "password=$sqlpassword "; } if ($sqlserver) { if (strpos($sqlserver, ':') !== false) { - list($sqlserver, $sqlport) = explode(':', $sqlserver); - $this->connect_string .= "host=$sqlserver port=$sqlport "; + list($sqlserver, $port) = explode(':', $sqlserver); } - else + + if ($sqlserver !== 'localhost') { - if ($sqlserver != "localhost") - { - $this->connect_string .= "host=$sqlserver "; - } - - if ($port) - { - $this->connect_string .= "port=$port "; - } + $connect_string .= "host=$sqlserver "; + } + + if ($port) + { + $connect_string .= "port=$port "; } } if ($database) { $this->dbname = $database; - $this->connect_string .= "dbname=$database"; + $connect_string .= "dbname=$database"; } $this->persistency = $persistency; - $this->db_connect_id = ($this->persistency) ? @pg_pconnect($this->connect_string) : @pg_connect($this->connect_string); + $this->db_connect_id = ($this->persistency) ? @pg_pconnect($connect_string) : @pg_connect($connect_string); return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); } @@ -98,6 +89,8 @@ class dbal_postgres extends dbal { $query_id = @pg_query($this->db_connect_id, 'select version()'); $row = @pg_fetch_assoc($query_id, null); + @pg_free_result($query_id); + $version = $row['version']; return ((!empty($version)) ? ' ' . $version : ''); } @@ -105,7 +98,7 @@ class dbal_postgres extends dbal /** * SQL Transaction - * @access: private + * @access private */ function _sql_transaction($status = 'begin') { @@ -152,7 +145,7 @@ class dbal_postgres extends dbal $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); - if (!$this->query_result) + if ($this->query_result === false) { if (($this->query_result = @pg_query($this->db_connect_id, $query)) === false) { @@ -189,7 +182,7 @@ class dbal_postgres extends dbal /** * Build db-specific query data - * @access: private + * @access private */ function _sql_custom_build($stage, $data) { @@ -222,27 +215,6 @@ class dbal_postgres extends dbal } /** - * Return number of rows - * Not used within core code - */ - function sql_numrows($query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_numrows($query_id); - } - - return ($query_id) ? @pg_num_rows($query_id) : false; - } - - /** * Return number of affected rows */ function sql_affectedrows() @@ -257,7 +229,7 @@ class dbal_postgres extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -267,48 +239,7 @@ class dbal_postgres extends dbal return $cache->sql_fetchrow($query_id); } - $row = @pg_fetch_assoc($query_id, null); - if ($row) - { - foreach ($row as $key => $value) - { - $row[$key] = (strpos($key, 'bitfield') === false) ? $value : pg_unescape_bytea($value); - } - } - - return ($query_id) ? $row : false; - } - - /** - * Fetch field - * if rownum is false, the current row is used, else it is pointing to the row (zero-based) - */ - function sql_fetchfield($field, $rownum = false, $query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if ($query_id) - { - if ($rownum !== false) - { - $this->sql_rowseek($rownum, $query_id); - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_fetchfield($query_id, $field); - } - - $row = $this->sql_fetchrow($query_id); - return isset($row[$field]) ? $row[$field] : false; - } - - return false; + return ($query_id !== false) ? @pg_fetch_assoc($query_id, null) : false; } /** @@ -319,17 +250,17 @@ class dbal_postgres extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } if (isset($cache->sql_rowset[$query_id])) { - return $cache->sql_rowseek($query_id, $rownum); + return $cache->sql_rowseek($rownum, $query_id); } - return ($query_id) ? @pg_result_seek($query_id, $rownum) : false; + return ($query_id !== false) ? @pg_result_seek($query_id, $rownum) : false; } /** @@ -339,7 +270,7 @@ class dbal_postgres extends dbal { $query_id = $this->query_result; - if ($query_id && $this->last_query_text != '') + if ($query_id !== false && $this->last_query_text != '') { if (preg_match("/^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)/is", $this->last_query_text, $tablename)) { @@ -368,7 +299,7 @@ class dbal_postgres extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -398,7 +329,7 @@ class dbal_postgres extends dbal /** * return sql error array - * @access: private + * @access private */ function _sql_error() { @@ -410,7 +341,7 @@ class dbal_postgres extends dbal /** * Close sql connection - * @access: private + * @access private */ function _sql_close() { @@ -419,7 +350,7 @@ class dbal_postgres extends dbal /** * Build db-specific report - * @access: private + * @access private */ function _sql_report($mode, $query = '') { @@ -477,9 +408,6 @@ class dbal_postgres extends dbal break; } } - } -} // if ... defined - ?>
\ No newline at end of file diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php index cd6d40e3c7..708376881c 100644 --- a/phpBB/includes/db/sqlite.php +++ b/phpBB/includes/db/sqlite.php @@ -9,20 +9,14 @@ */ /** +* @ignore */ if (!defined('IN_PHPBB')) { exit; } -/** -* @ignore -*/ -if (!defined('SQL_LAYER')) -{ - - define('SQL_LAYER', 'sqlite'); - include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); +include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** * Sqlite Database Abstraction Layer @@ -63,7 +57,7 @@ class dbal_sqlite extends dbal /** * SQL Transaction - * @access: private + * @access private */ function _sql_transaction($status = 'begin') { @@ -109,7 +103,7 @@ class dbal_sqlite extends dbal $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); - if (!$this->query_result) + if ($this->query_result === false) { if (($this->query_result = @sqlite_query($query, $this->db_connect_id)) === false) { @@ -170,27 +164,6 @@ class dbal_sqlite extends dbal } /** - * Return number of rows - * Not used within core code - */ - function sql_numrows($query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_numrows($query_id); - } - - return ($query_id) ? @sqlite_num_rows($query_id) : false; - } - - /** * Return number of affected rows */ function sql_affectedrows() @@ -205,7 +178,7 @@ class dbal_sqlite extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -215,40 +188,7 @@ class dbal_sqlite extends dbal return $cache->sql_fetchrow($query_id); } - $row = @sqlite_fetch_array($query_id, SQLITE_ASSOC); - - return $row; - } - - /** - * Fetch field - * if rownum is false, the current row is used, else it is pointing to the row (zero-based) - */ - function sql_fetchfield($field, $rownum = false, $query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if ($query_id) - { - if ($rownum !== false) - { - $this->sql_rowseek($rownum, $query_id); - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_fetchfield($query_id, $field); - } - - return @sqlite_column($query_id, $field); - } - - return false; + return ($query_id !== false) ? @sqlite_fetch_array($query_id, SQLITE_ASSOC) : false; } /** @@ -259,17 +199,17 @@ class dbal_sqlite extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } if (isset($cache->sql_rowset[$query_id])) { - return $cache->sql_rowseek($query_id, $rownum); + return $cache->sql_rowseek($rownum, $query_id); } - return ($query_id) ? @sqlite_seek($query_id, $rownum) : false; + return ($query_id !== false) ? @sqlite_seek($query_id, $rownum) : false; } /** @@ -287,7 +227,7 @@ class dbal_sqlite extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -310,7 +250,7 @@ class dbal_sqlite extends dbal /** * return sql error array - * @access: private + * @access private */ function _sql_error() { @@ -322,7 +262,7 @@ class dbal_sqlite extends dbal /** * Build db-specific query data - * @access: private + * @access private */ function _sql_custom_build($stage, $data) { @@ -331,7 +271,7 @@ class dbal_sqlite extends dbal /** * Close sql connection - * @access: private + * @access private */ function _sql_close() { @@ -340,7 +280,7 @@ class dbal_sqlite extends dbal /** * Build db-specific report - * @access: private + * @access private */ function _sql_report($mode, $query = '') { @@ -367,9 +307,6 @@ class dbal_sqlite extends dbal break; } } - } -} // if ... define - ?>
\ No newline at end of file diff --git a/phpBB/includes/diff/diff.php b/phpBB/includes/diff/diff.php new file mode 100644 index 0000000000..fd2d557a19 --- /dev/null +++ b/phpBB/includes/diff/diff.php @@ -0,0 +1,781 @@ +<?php +/** +* +* @package phpBB3 +* @version $Id$ +* @copyright (c) 2006 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +// Include renderer and engine +include_once($phpbb_root_path . 'includes/diff/engine.' . $phpEx); +include_once($phpbb_root_path . 'includes/diff/renderer.' . $phpEx); + +/** +* Code from pear.php.net, Text_Diff-0.2.1 (beta) package +* http://pear.php.net/package/Text_Diff/ +* +* Modified by Acyd Burn to meet our coding standards +* and being able to integrate into phpBB +*/ + +/** +* General API for generating and formatting diffs - the differences between +* two sequences of strings. +* +* The PHP diff code used in this package was originally written by Geoffrey +* T. Dairiki and is used with his permission. +* +* @package phpBB3 +* @author Geoffrey T. Dairiki <dairiki@dairiki.org> +*/ +class diff +{ + /** + * Array of changes. + * @var array + */ + var $_edits; + + /** + * Computes diffs between sequences of strings. + * + * @param array $from_lines An array of strings. Typically these are lines from a file. + * @param array $to_lines An array of strings. + */ + function diff($from_lines, $to_lines) + { + $diff_engine = &new diff_engine(); + $this->_edits = call_user_func_array(array($diff_engine, 'diff'), array($from_lines, $to_lines)); + } + + /** + * Returns the array of differences. + */ + function get_diff() + { + return $this->_edits; + } + + /** + * Computes a reversed diff. + * + * Example: + * <code> + * $diff = &new diff($lines1, $lines2); + * $rev = $diff->reverse(); + * </code> + * + * @return diff A Diff object representing the inverse of the original diff. + * Note that we purposely don't return a reference here, since + * this essentially is a clone() method. + */ + function reverse() + { + if (version_compare(zend_version(), '2', '>')) + { + $rev = clone($this); + } + else + { + $rev = $this; + } + + $rev->_edits = array(); + + foreach ($this->_edits as $edit) + { + $rev->_edits[] = $edit->reverse(); + } + + return $rev; + } + + /** + * Checks for an empty diff. + * + * @return boolean True if two sequences were identical. + */ + function is_empty() + { + foreach ($this->_edits as $edit) + { + if (!is_a($edit, 'diff_op_copy')) + { + return false; + } + } + return true; + } + + /** + * Computes the length of the Longest Common Subsequence (LCS). + * + * This is mostly for diagnostic purposes. + * + * @return integer The length of the LCS. + */ + function lcs() + { + $lcs = 0; + + foreach ($this->_edits as $edit) + { + if (is_a($edit, 'diff_op_copy')) + { + $lcs += sizeof($edit->orig); + } + } + return $lcs; + } + + /** + * Gets the original set of lines. + * + * This reconstructs the $from_lines parameter passed to the constructor. + * + * @return array The original sequence of strings. + */ + function get_original() + { + $lines = array(); + + foreach ($this->_edits as $edit) + { + if ($edit->orig) + { + array_splice($lines, sizeof($lines), 0, $edit->orig); + } + } + return $lines; + } + + /** + * Gets the final set of lines. + * + * This reconstructs the $to_lines parameter passed to the constructor. + * + * @return array The sequence of strings. + */ + function get_final() + { + $lines = array(); + + foreach ($this->_edits as $edit) + { + if ($edit->final) + { + array_splice($lines, sizeof($lines), 0, $edit->final); + } + } + return $lines; + } + + /** + * Removes trailing newlines from a line of text. This is meant to be used with array_walk(). + * + * @param string $line The line to trim. + * @param integer $key The index of the line in the array. Not used. + */ + function trim_newlines(&$line, $key) + { + $line = str_replace(array("\n", "\r"), '', $line); + } + + /** + * Checks a diff for validity. + * + * This is here only for debugging purposes. + */ + function _check($from_lines, $to_lines) + { + if (serialize($from_lines) != serialize($this->get_original())) + { + trigger_error("[diff] Reconstructed original doesn't match", E_USER_ERROR); + } + + if (serialize($to_lines) != serialize($this->get_final())) + { + trigger_error("[diff] Reconstructed final doesn't match", E_USER_ERROR); + } + + $rev = $this->reverse(); + + if (serialize($to_lines) != serialize($rev->get_original())) + { + trigger_error("[diff] Reversed original doesn't match", E_USER_ERROR); + } + + if (serialize($from_lines) != serialize($rev->get_final())) + { + trigger_error("[diff] Reversed final doesn't match", E_USER_ERROR); + } + + $prevtype = null; + + foreach ($this->_edits as $edit) + { + if ($prevtype == get_class($edit)) + { + trigger_error("[diff] Edit sequence is non-optimal", E_USER_ERROR); + } + $prevtype = get_class($edit); + } + + return true; + } +} + +/** +* @package phpBB3 +* @author Geoffrey T. Dairiki <dairiki@dairiki.org> +*/ +class mapped_diff extends diff +{ + /** + * Computes a diff between sequences of strings. + * + * This can be used to compute things like case-insensitve diffs, or diffs + * which ignore changes in white-space. + * + * @param array $from_lines An array of strings. + * @param array $to_lines An array of strings. + * @param array $mapped_from_lines This array should have the same size number of elements as $from_lines. + * The elements in $mapped_from_lines and $mapped_to_lines are what is actually + * compared when computing the diff. + * @param array $mapped_to_lines This array should have the same number of elements as $to_lines. + */ + function mapped_diff($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) + { + if (sizeof($from_lines) != sizeof($mapped_from_lines) || sizeof($to_lines) != sizeof($mapped_to_lines)) + { + return false; + } + + parent::diff($mapped_from_lines, $mapped_to_lines); + + $xi = $yi = 0; + for ($i = 0; $i < sizeof($this->_edits); $i++) + { + $orig = &$this->_edits[$i]->orig; + if (is_array($orig)) + { + $orig = array_slice($from_lines, $xi, sizeof($orig)); + $xi += sizeof($orig); + } + + $final = &$this->_edits[$i]->final; + if (is_array($final)) + { + $final = array_slice($to_lines, $yi, sizeof($final)); + $yi += sizeof($final); + } + } + } +} + +/** +* @package phpBB3 +* @author Geoffrey T. Dairiki <dairiki@dairiki.org> +* +* @access private +*/ +class diff_op +{ + var $orig; + var $final; + + function reverse() + { + trigger_error('[diff] Abstract method', E_USER_ERROR); + } + + function norig() + { + return ($this->orig) ? sizeof($this->orig) : 0; + } + + function nfinal() + { + return ($this->final) ? sizeof($this->final) : 0; + } +} + +/** +* @package phpBB3 +* @author Geoffrey T. Dairiki <dairiki@dairiki.org> +* +* @access private +*/ +class diff_op_copy extends diff_op +{ + function diff_op_copy($orig, $final = false) + { + if (!is_array($final)) + { + $final = $orig; + } + $this->orig = $orig; + $this->final = $final; + } + + function &reverse() + { + $reverse = &new diff_op_copy($this->final, $this->orig); + return $reverse; + } +} + +/** +* @package phpBB3 +* @author Geoffrey T. Dairiki <dairiki@dairiki.org> +* +* @access private +*/ +class diff_op_delete extends diff_op +{ + function diff_op_delete($lines) + { + $this->orig = $lines; + $this->final = false; + } + + function &reverse() + { + $reverse = &new diff_op_add($this->orig); + return $reverse; + } +} + +/** +* @package phpBB3 +* @author Geoffrey T. Dairiki <dairiki@dairiki.org> +* +* @access private +*/ +class diff_op_add extends diff_op +{ + function diff_op_add($lines) + { + $this->final = $lines; + $this->orig = false; + } + + function &reverse() + { + $reverse = &new diff_op_delete($this->final); + return $reverse; + } +} + +/** +* @package phpBB3 +* @author Geoffrey T. Dairiki <dairiki@dairiki.org> +* +* @access private +*/ +class diff_op_change extends diff_op +{ + function diff_op_change($orig, $final) + { + $this->orig = $orig; + $this->final = $final; + } + + function &reverse() + { + $reverse = &new diff_op_change($this->final, $this->orig); + return $reverse; + } +} + + +/** +* A class for computing three way diffs. +* +* @package phpBB3 +* @author Geoffrey T. Dairiki <dairiki@dairiki.org> +*/ +class diff3 extends diff +{ + /** + * Conflict counter. + * @var integer + */ + var $_conflicting_blocks = 0; + + /** + * Computes diff between 3 sequences of strings. + * + * @param array $orig The original lines to use. + * @param array $final1 The first version to compare to. + * @param array $final2 The second version to compare to. + */ + function diff3($orig, $final1, $final2) + { + $engine = new diff_engine(); + $this->_edits = $this->_diff3($engine->diff($orig, $final1), $engine->diff($orig, $final2)); + } + + /** + * Return merged output + * + * @param string $label1 the cvs file version/label from the original set of lines + * @param string $label2 the cvs file version/label from the new set of lines + * @param string $label_sep the explanation between label1 and label2 - more of a helper for the user + * @param bool $get_conflicts if set to true only the number of conflicts is returned + * @param bool $merge_new if set to true the merged output will have the new file contents on a conflicting merge + * + * @return mixed the merged output + */ + function merged_output($label1 = 'CURRENT_FILE', $label2 = 'NEW_FILE', $label_sep = 'DIFF_SEP_EXPLAIN', $get_conflicts = false, $merge_new = false) + { + global $user; + + if ($get_conflicts) + { + foreach ($this->_edits as $edit) + { + if ($edit->is_conflict()) + { + $this->_conflicting_blocks++; + } + } + + return $this->_conflicting_blocks; + } + + $label1 = (!empty($user->lang[$label1])) ? $user->lang[$label1] : $label1; + $label2 = (!empty($user->lang[$label2])) ? $user->lang[$label2] : $label2; + $label_sep = (!empty($user->lang[$label_sep])) ? $user->lang[$label_sep] : $label_sep; + + $lines = array(); + + foreach ($this->_edits as $edit) + { + if ($edit->is_conflict()) + { + if (!$merge_new) + { + $lines = array_merge($lines, array('<<<<<<<' . ($label1 ? ' ' . $label1 : '')), $edit->final1, array('=======' . ($label_sep ? ' ' . $label_sep : '')), $edit->final2, array('>>>>>>>' . ($label2 ? ' ' . $label2 : ''))); + } + else + { + $lines = array_merge($lines, $edit->final1); + } + $this->_conflicting_blocks++; + } + else + { + $lines = array_merge($lines, $edit->merged()); + } + } + + return $lines; + } + + /** + * Merge the output and use the new file code for conflicts + */ + function merged_new_output() + { + $lines = array(); + + foreach ($this->_edits as $edit) + { + if ($edit->is_conflict()) + { + $lines = array_merge($lines, $edit->final2); + } + else + { + $lines = array_merge($lines, $edit->merged()); + } + } + + return $lines; + } + + /** + * Merge the output and use the original file code for conflicts + */ + function merged_orig_output() + { + $lines = array(); + + foreach ($this->_edits as $edit) + { + if ($edit->is_conflict()) + { + $lines = array_merge($lines, $edit->final1); + } + else + { + $lines = array_merge($lines, $edit->merged()); + } + } + + return $lines; + } + + /** + * Get conflicting block(s) + */ + function get_conflicts() + { + $conflicts = array(); + + foreach ($this->_edits as $edit) + { + if ($edit->is_conflict()) + { + $conflicts[] = array($edit->final1, $edit->final2); + } + } + + return $conflicts; + } + + /** + * @access private + */ + function _diff3($edits1, $edits2) + { + $edits = array(); + $bb = &new diff3_block_builder(); + + $e1 = current($edits1); + $e2 = current($edits2); + + while ($e1 || $e2) + { + if ($e1 && $e2 && is_a($e1, 'diff_op_copy') && is_a($e2, 'diff_op_copy')) + { + // We have copy blocks from both diffs. This is the (only) time we want to emit a diff3 copy block. + // Flush current diff3 diff block, if any. + if ($edit = $bb->finish()) + { + $edits[] = $edit; + } + + $ncopy = min($e1->norig(), $e2->norig()); + $edits[] = &new diff3_op_copy(array_slice($e1->orig, 0, $ncopy)); + + if ($e1->norig() > $ncopy) + { + array_splice($e1->orig, 0, $ncopy); + array_splice($e1->final, 0, $ncopy); + } + else + { + $e1 = next($edits1); + } + + if ($e2->norig() > $ncopy) + { + array_splice($e2->orig, 0, $ncopy); + array_splice($e2->final, 0, $ncopy); + } + else + { + $e2 = next($edits2); + } + } + else + { + if ($e1 && $e2) + { + if ($e1->orig && $e2->orig) + { + $norig = min($e1->norig(), $e2->norig()); + $orig = array_splice($e1->orig, 0, $norig); + array_splice($e2->orig, 0, $norig); + $bb->input($orig); + } + else + { + $norig = 0; + } + + if (is_a($e1, 'diff_op_copy')) + { + $bb->out1(array_splice($e1->final, 0, $norig)); + } + + if (is_a($e2, 'diff_op_copy')) + { + $bb->out2(array_splice($e2->final, 0, $norig)); + } + } + + if ($e1 && ! $e1->orig) + { + $bb->out1($e1->final); + $e1 = next($edits1); + } + + if ($e2 && ! $e2->orig) + { + $bb->out2($e2->final); + $e2 = next($edits2); + } + } + } + + if ($edit = $bb->finish()) + { + $edits[] = $edit; + } + + return $edits; + } +} + +/** +* @package phpBB3 +* @author Geoffrey T. Dairiki <dairiki@dairiki.org> +* +* @access private +*/ +class diff3_op +{ + function diff3_op($orig = false, $final1 = false, $final2 = false) + { + $this->orig = $orig ? $orig : array(); + $this->final1 = $final1 ? $final1 : array(); + $this->final2 = $final2 ? $final2 : array(); + } + + function merged() + { + if (!isset($this->_merged)) + { + if ($this->final1 === $this->final2) + { + $this->_merged = &$this->final1; + } + else if ($this->final1 === $this->orig) + { + $this->_merged = &$this->final2; + } + else if ($this->final2 === $this->orig) + { + $this->_merged = &$this->final1; + } + else + { + $this->_merged = false; + } + } + + return $this->_merged; + } + + function is_conflict() + { + return ($this->merged() === false) ? true : false; + } +} + +/** +* @package phpBB3 +* @author Geoffrey T. Dairiki <dairiki@dairiki.org> +* +* @access private +*/ +class diff3_op_copy extends diff3_op +{ + function diff3_op_copy($lines = false) + { + $this->orig = $lines ? $lines : array(); + $this->final1 = &$this->orig; + $this->final2 = &$this->orig; + } + + function merged() + { + return $this->orig; + } + + function is_conflict() + { + return false; + } +} + +/** +* @package phpBB3 +* @author Geoffrey T. Dairiki <dairiki@dairiki.org> +* +* @access private +*/ +class diff3_block_builder +{ + function diff3_block_builder() + { + $this->_init(); + } + + function input($lines) + { + if ($lines) + { + $this->_append($this->orig, $lines); + } + } + + function out1($lines) + { + if ($lines) + { + $this->_append($this->final1, $lines); + } + } + + function out2($lines) + { + if ($lines) + { + $this->_append($this->final2, $lines); + } + } + + function is_empty() + { + return !$this->orig && !$this->final1 && !$this->final2; + } + + function finish() + { + if ($this->is_empty()) + { + return false; + } + else + { + $edit = &new diff3_op($this->orig, $this->final1, $this->final2); + $this->_init(); + return $edit; + } + } + + function _init() + { + $this->orig = $this->final1 = $this->final2 = array(); + } + + function _append(&$array, $lines) + { + array_splice($array, sizeof($array), 0, $lines); + } +} + +?>
\ No newline at end of file diff --git a/phpBB/includes/diff/engine.php b/phpBB/includes/diff/engine.php new file mode 100644 index 0000000000..c230d865cd --- /dev/null +++ b/phpBB/includes/diff/engine.php @@ -0,0 +1,512 @@ +<?php +/** +* +* @package phpBB3 +* @version $Id$ +* @copyright (c) 2006 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* Code from pear.php.net, Text_Diff-0.2.1 (beta) package +* http://pear.php.net/package/Text_Diff/ +* +* Modified by Acyd Burn to meet our coding standards +* and being able to integrate into phpBB +*/ + +/** +* Class used internally by Diff to actually compute the diffs. This class is +* implemented using native PHP code. +* +* The algorithm used here is mostly lifted from the perl module +* Algorithm::Diff (version 1.06) by Ned Konz, which is available at: +* http://www.perl.com/CPAN/authors/id/N/NE/NEDKONZ/Algorithm-Diff-1.06.zip +* +* More ideas are taken from: +* http://www.ics.uci.edu/~eppstein/161/960229.html +* +* Some ideas (and a bit of code) are taken from analyze.c, of GNU +* diffutils-2.7, which can be found at: +* ftp://gnudist.gnu.org/pub/gnu/diffutils/diffutils-2.7.tar.gz +* +* Some ideas (subdivision by NCHUNKS > 2, and some optimizations) are from +* Geoffrey T. Dairiki <dairiki@dairiki.org>. The original PHP version of this +* code was written by him, and is used/adapted with his permission. +* +* @author Geoffrey T. Dairiki <dairiki@dairiki.org> +* @package phpBB3 +* +* @access private +*/ +class diff_engine +{ + function diff($from_lines, $to_lines) + { + array_walk($from_lines, array('diff', 'trim_newlines')); + array_walk($to_lines, array('diff', 'trim_newlines')); + + $n_from = sizeof($from_lines); + $n_to = sizeof($to_lines); + + $this->xchanged = $this->ychanged = $this->xv = $this->yv = $this->xind = $this->yind = array(); + unset($this->seq, $this->in_seq, $this->lcs); + + // Skip leading common lines. + for ($skip = 0; $skip < $n_from && $skip < $n_to; $skip++) + { + if ($from_lines[$skip] !== $to_lines[$skip]) + { + break; + } + $this->xchanged[$skip] = $this->ychanged[$skip] = false; + } + + // Skip trailing common lines. + $xi = $n_from; + $yi = $n_to; + + for ($endskip = 0; --$xi > $skip && --$yi > $skip; $endskip++) + { + if ($from_lines[$xi] !== $to_lines[$yi]) + { + break; + } + $this->xchanged[$xi] = $this->ychanged[$yi] = false; + } + + // Ignore lines which do not exist in both files. + for ($xi = $skip; $xi < $n_from - $endskip; $xi++) + { + $xhash[$from_lines[$xi]] = 1; + } + + for ($yi = $skip; $yi < $n_to - $endskip; $yi++) + { + $line = $to_lines[$yi]; + + if (($this->ychanged[$yi] = empty($xhash[$line]))) + { + continue; + } + $yhash[$line] = 1; + $this->yv[] = $line; + $this->yind[] = $yi; + } + + for ($xi = $skip; $xi < $n_from - $endskip; $xi++) + { + $line = $from_lines[$xi]; + + if (($this->xchanged[$xi] = empty($yhash[$line]))) + { + continue; + } + $this->xv[] = $line; + $this->xind[] = $xi; + } + + // Find the LCS. + $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); + + // Compute the edit operations. + $edits = array(); + $xi = $yi = 0; + + while ($xi < $n_from || $yi < $n_to) + { + // Skip matching "snake". + $copy = array(); + + while ($xi < $n_from && $yi < $n_to && !$this->xchanged[$xi] && !$this->ychanged[$yi]) + { + $copy[] = $from_lines[$xi++]; + $yi++; + } + + if ($copy) + { + $edits[] = &new diff_op_copy($copy); + } + + // Find deletes & adds. + $delete = array(); + while ($xi < $n_from && $this->xchanged[$xi]) + { + $delete[] = $from_lines[$xi++]; + } + + $add = array(); + while ($yi < $n_to && $this->ychanged[$yi]) + { + $add[] = $to_lines[$yi++]; + } + + if ($delete && $add) + { + $edits[] = &new diff_op_change($delete, $add); + } + else if ($delete) + { + $edits[] = &new diff_op_delete($delete); + } + else if ($add) + { + $edits[] = &new diff_op_add($add); + } + } + + return $edits; + } + + /** + * Divides the Largest Common Subsequence (LCS) of the sequences (XOFF, + * XLIM) and (YOFF, YLIM) into NCHUNKS approximately equally sized segments. + * + * Returns (LCS, PTS). LCS is the length of the LCS. PTS is an array of + * NCHUNKS+1 (X, Y) indexes giving the diving points between sub + * sequences. The first sub-sequence is contained in (X0, X1), (Y0, Y1), + * the second in (X1, X2), (Y1, Y2) and so on. Note that (X0, Y0) == + * (XOFF, YOFF) and (X[NCHUNKS], Y[NCHUNKS]) == (XLIM, YLIM). + * + * This function assumes that the first lines of the specified portions of + * the two files do not match, and likewise that the last lines do not + * match. The caller must trim matching lines from the beginning and end + * of the portions it is going to specify. + */ + function _diag($xoff, $xlim, $yoff, $ylim, $nchunks) + { + $flip = false; + + if ($xlim - $xoff > $ylim - $yoff) + { + // Things seems faster (I'm not sure I understand why) when the shortest sequence is in X. + $flip = true; + list($xoff, $xlim, $yoff, $ylim) = array($yoff, $ylim, $xoff, $xlim); + } + + if ($flip) + { + for ($i = $ylim - 1; $i >= $yoff; $i--) + { + $ymatches[$this->xv[$i]][] = $i; + } + } + else + { + for ($i = $ylim - 1; $i >= $yoff; $i--) + { + $ymatches[$this->yv[$i]][] = $i; + } + } + + $this->lcs = 0; + $this->seq[0]= $yoff - 1; + $this->in_seq = array(); + $ymids[0] = array(); + + $numer = $xlim - $xoff + $nchunks - 1; + $x = $xoff; + + for ($chunk = 0; $chunk < $nchunks; $chunk++) + { + if ($chunk > 0) + { + for ($i = 0; $i <= $this->lcs; $i++) + { + $ymids[$i][$chunk - 1] = $this->seq[$i]; + } + } + + $x1 = $xoff + (int)(($numer + ($xlim-$xoff)*$chunk) / $nchunks); + + for (; $x < $x1; $x++) + { + $line = $flip ? $this->yv[$x] : $this->xv[$x]; + if (empty($ymatches[$line])) + { + continue; + } + $matches = $ymatches[$line]; + + foreach ($matches as $y) + { + if (empty($this->in_seq[$y])) + { + $k = $this->_lcs_pos($y); + $ymids[$k] = $ymids[$k - 1]; + break; + } + } + + while (list($junk, $y) = each($matches)) + { + if ($y > $this->seq[$k - 1]) + { + // Optimization: this is a common case: next match is just replacing previous match. + $this->in_seq[$this->seq[$k]] = false; + $this->seq[$k] = $y; + $this->in_seq[$y] = 1; + } + else if (empty($this->in_seq[$y])) + { + $k = $this->_lcs_pos($y); + $ymids[$k] = $ymids[$k - 1]; + } + } + } + } + + $seps[] = $flip ? array($yoff, $xoff) : array($xoff, $yoff); + $ymid = $ymids[$this->lcs]; + + for ($n = 0; $n < $nchunks - 1; $n++) + { + $x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $n) / $nchunks); + $y1 = $ymid[$n] + 1; + $seps[] = $flip ? array($y1, $x1) : array($x1, $y1); + } + $seps[] = $flip ? array($ylim, $xlim) : array($xlim, $ylim); + + return array($this->lcs, $seps); + } + + function _lcs_pos($ypos) + { + $end = $this->lcs; + + if ($end == 0 || $ypos > $this->seq[$end]) + { + $this->seq[++$this->lcs] = $ypos; + $this->in_seq[$ypos] = 1; + return $this->lcs; + } + + $beg = 1; + while ($beg < $end) + { + $mid = (int)(($beg + $end) / 2); + if ($ypos > $this->seq[$mid]) + { + $beg = $mid + 1; + } + else + { + $end = $mid; + } + } + + $this->in_seq[$this->seq[$end]] = false; + $this->seq[$end] = $ypos; + $this->in_seq[$ypos] = 1; + + return $end; + } + + /** + * Finds LCS of two sequences. + * + * The results are recorded in the vectors $this->{x,y}changed[], by + * storing a 1 in the element for each line that is an insertion or + * deletion (ie. is not in the LCS). + * + * The subsequence of file 0 is (XOFF, XLIM) and likewise for file 1. + * + * Note that XLIM, YLIM are exclusive bounds. All line numbers are + * origin-0 and discarded lines are not counted. + */ + function _compareseq($xoff, $xlim, $yoff, $ylim) + { + // Slide down the bottom initial diagonal. + while ($xoff < $xlim && $yoff < $ylim && $this->xv[$xoff] == $this->yv[$yoff]) + { + ++$xoff; + ++$yoff; + } + + // Slide up the top initial diagonal. + while ($xlim > $xoff && $ylim > $yoff && $this->xv[$xlim - 1] == $this->yv[$ylim - 1]) + { + --$xlim; + --$ylim; + } + + if ($xoff == $xlim || $yoff == $ylim) + { + $lcs = 0; + } + else + { + // This is ad hoc but seems to work well. + // $nchunks = sqrt(min($xlim - $xoff, $ylim - $yoff) / 2.5); + // $nchunks = max(2,min(8,(int)$nchunks)); + $nchunks = min(7, $xlim - $xoff, $ylim - $yoff) + 1; + list($lcs, $seps) = $this->_diag($xoff, $xlim, $yoff, $ylim, $nchunks); + } + + if ($lcs == 0) + { + // X and Y sequences have no common subsequence: mark all changed. + while ($yoff < $ylim) + { + $this->ychanged[$this->yind[$yoff++]] = 1; + } + + while ($xoff < $xlim) + { + $this->xchanged[$this->xind[$xoff++]] = 1; + } + } + else + { + // Use the partitions to split this problem into subproblems. + reset($seps); + $pt1 = $seps[0]; + + while ($pt2 = next($seps)) + { + $this->_compareseq($pt1[0], $pt2[0], $pt1[1], $pt2[1]); + $pt1 = $pt2; + } + } + } + + /** + * Adjusts inserts/deletes of identical lines to join changes as much as possible. + * + * We do something when a run of changed lines include a line at one end + * and has an excluded, identical line at the other. We are free to + * choose which identical line is included. 'compareseq' usually chooses + * the one at the beginning, but usually it is cleaner to consider the + * following identical line to be the "change". + * + * This is extracted verbatim from analyze.c (GNU diffutils-2.7). + */ + function _shift_boundaries($lines, &$changed, $other_changed) + { + $i = 0; + $j = 0; + + $len = sizeof($lines); + $other_len = sizeof($other_changed); + + while (1) + { + // Scan forward to find the beginning of another run of + // changes. Also keep track of the corresponding point in the other file. + // + // Throughout this code, $i and $j are adjusted together so that + // the first $i elements of $changed and the first $j elements of + // $other_changed both contain the same number of zeros (unchanged lines). + // + // Furthermore, $j is always kept so that $j == $other_len or $other_changed[$j] == false. + while ($j < $other_len && $other_changed[$j]) + { + $j++; + } + + while ($i < $len && ! $changed[$i]) + { + $i++; + $j++; + + while ($j < $other_len && $other_changed[$j]) + { + $j++; + } + } + + if ($i == $len) + { + break; + } + + $start = $i; + + // Find the end of this run of changes. + while (++$i < $len && $changed[$i]) + { + continue; + } + + do + { + // Record the length of this run of changes, so that we can later determine whether the run has grown. + $runlength = $i - $start; + + // Move the changed region back, so long as the previous unchanged line matches the last changed one. + // This merges with previous changed regions. + while ($start > 0 && $lines[$start - 1] == $lines[$i - 1]) + { + $changed[--$start] = 1; + $changed[--$i] = false; + + while ($start > 0 && $changed[$start - 1]) + { + $start--; + } + + while ($other_changed[--$j]) + { + continue; + } + } + + // Set CORRESPONDING to the end of the changed run, at the last point where it corresponds to a changed run in the + // other file. CORRESPONDING == LEN means no such point has been found. + $corresponding = $j < $other_len ? $i : $len; + + // Move the changed region forward, so long as the first changed line matches the following unchanged one. + // This merges with following changed regions. + // Do this second, so that if there are no merges, the changed region is moved forward as far as possible. + while ($i < $len && $lines[$start] == $lines[$i]) + { + $changed[$start++] = false; + $changed[$i++] = 1; + + while ($i < $len && $changed[$i]) + { + $i++; + } + + $j++; + if ($j < $other_len && $other_changed[$j]) + { + $corresponding = $i; + while ($j < $other_len && $other_changed[$j]) + { + $j++; + } + } + } + } + while ($runlength != $i - $start); + + // If possible, move the fully-merged run of changes back to a corresponding run in the other file. + while ($corresponding < $i) + { + $changed[--$start] = 1; + $changed[--$i] = 0; + + while ($other_changed[--$j]) + { + continue; + } + } + } + } +} + +?>
\ No newline at end of file diff --git a/phpBB/includes/diff/renderer.php b/phpBB/includes/diff/renderer.php new file mode 100644 index 0000000000..408addb858 --- /dev/null +++ b/phpBB/includes/diff/renderer.php @@ -0,0 +1,832 @@ +<?php +/** +* +* @package phpBB3 +* @version $Id$ +* @copyright (c) 2006 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* Code from pear.php.net, Text_Diff-0.2.1 (beta) package +* http://pear.php.net/package/Text_Diff/ +* +* Modified by Acyd Burn to meet our coding standards +* and being able to integrate into phpBB +*/ + +/** +* A class to render Diffs in different formats. +* +* This class renders the diff in classic diff format. It is intended that +* this class be customized via inheritance, to obtain fancier outputs. +* +* @package phpBB3 +*/ +class diff_renderer +{ + /** + * Number of leading context "lines" to preserve. + * + * This should be left at zero for this class, but subclasses may want to + * set this to other values. + */ + var $_leading_context_lines = 0; + + /** + * Number of trailing context "lines" to preserve. + * + * This should be left at zero for this class, but subclasses may want to + * set this to other values. + */ + var $_trailing_context_lines = 0; + + /** + * Constructor. + */ + function diff_renderer($params = array()) + { + foreach ($params as $param => $value) + { + $v = '_' . $param; + if (isset($this->$v)) + { + $this->$v = $value; + } + } + } + + /** + * Get any renderer parameters. + * + * @return array All parameters of this renderer object. + */ + function get_params() + { + $params = array(); + foreach (get_object_vars($this) as $k => $v) + { + if ($k[0] == '_') + { + $params[substr($k, 1)] = $v; + } + } + + return $params; + } + + /** + * Renders a diff. + * + * @param diff $diff A diff object. + * + * @return string The formatted output. + */ + function render(&$diff) + { + $xi = $yi = 1; + $block = false; + $context = array(); + + // Create a new diff object if it is a 3-way diff + if (is_a($diff, 'diff3')) + { + $diff3 = &$diff; + $diff = &new diff($diff3->get_original(), $diff3->merged_output()); + unset($diff3); + } + + $nlead = $this->_leading_context_lines; + $ntrail = $this->_trailing_context_lines; + + $output = $this->_start_diff(); + $diffs = $diff->get_diff(); + + foreach ($diffs as $i => $edit) + { + if (is_a($edit, 'diff_op_copy')) + { + if (is_array($block)) + { + $keep = ($i == sizeof($diffs) - 1) ? $ntrail : $nlead + $ntrail; + if (sizeof($edit->orig) <= $keep) + { + $block[] = $edit; + } + else + { + if ($ntrail) + { + $context = array_slice($edit->orig, 0, $ntrail); + $block[] = &new diff_op_copy($context); + } + + $output .= $this->_block($x0, $ntrail + $xi - $x0, $y0, $ntrail + $yi - $y0, $block); + $block = false; + } + } + $context = $edit->orig; + } + else + { + if (!is_array($block)) + { + $context = array_slice($context, sizeof($context) - $nlead); + $x0 = $xi - sizeof($context); + $y0 = $yi - sizeof($context); + $block = array(); + + if ($context) + { + $block[] = &new diff_op_copy($context); + } + } + $block[] = $edit; + } + + $xi += ($edit->orig) ? sizeof($edit->orig) : 0; + $yi += ($edit->final) ? sizeof($edit->final) : 0; + } + + if (is_array($block)) + { + $output .= $this->_block($x0, $xi - $x0, $y0, $yi - $y0, $block); + } + + return $output . $this->_end_diff(); + } + + function _block($xbeg, $xlen, $ybeg, $ylen, &$edits) + { + $output = $this->_start_block($this->_block_header($xbeg, $xlen, $ybeg, $ylen)); + + foreach ($edits as $edit) + { + switch (get_class($edit)) + { + case 'diff_op_copy': + $output .= $this->_context($edit->orig); + break; + + case 'diff_op_add': + $output .= $this->_added($edit->final); + break; + + case 'diff_op_delete': + $output .= $this->_deleted($edit->orig); + break; + + case 'diff_op_change': + $output .= $this->_changed($edit->orig, $edit->final); + break; + } + } + + return $output . $this->_end_block(); + } + + function _start_diff() + { + return ''; + } + + function _end_diff() + { + return ''; + } + + function _block_header($xbeg, $xlen, $ybeg, $ylen) + { + if ($xlen > 1) + { + $xbeg .= ',' . ($xbeg + $xlen - 1); + } + + if ($ylen > 1) + { + $ybeg .= ',' . ($ybeg + $ylen - 1); + } + + return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg; + } + + function _start_block($header) + { + return $header . "\n"; + } + + function _end_block() + { + return ''; + } + + function _lines($lines, $prefix = ' ') + { + return $prefix . implode("\n$prefix", $lines) . "\n"; + } + + function _context($lines) + { + return $this->_lines($lines, ' '); + } + + function _added($lines) + { + return $this->_lines($lines, '> '); + } + + function _deleted($lines) + { + return $this->_lines($lines, '< '); + } + + function _changed($orig, $final) + { + return $this->_deleted($orig) . "---\n" . $this->_added($final); + } + + /** + * Our function to get the diff + */ + function get_diff_content($diff) + { + return $this->render($diff); + } +} + +/** +* Renders a unified diff +* @package phpBB3 +*/ +class diff_renderer_unified extends diff_renderer +{ + var $_leading_context_lines = 4; + var $_trailing_context_lines = 4; + + /** + * Our function to get the diff + */ + function get_diff_content($diff) + { + return nl2br($this->render($diff)); + } + + function _block_header($xbeg, $xlen, $ybeg, $ylen) + { + if ($xlen != 1) + { + $xbeg .= ',' . $xlen; + } + + if ($ylen != 1) + { + $ybeg .= ',' . $ylen; + } + return '<div class="diff"><big class="info">@@ -' . $xbeg . ' +' . $ybeg . ' @@</big></div>'; + } + + function _context($lines) + { + return '<pre class="diff context">' . htmlspecialchars($this->_lines($lines, ' ')) . '</pre>'; + } + + function _added($lines) + { + return '<pre class="diff added">' . htmlspecialchars($this->_lines($lines, '+')) . '</pre>'; + } + + function _deleted($lines) + { + return '<pre class="diff removed">' . htmlspecialchars($this->_lines($lines, '-')) . '</pre>'; + } + + function _changed($orig, $final) + { + return $this->_deleted($orig) . $this->_added($final); + } + + function _start_diff() + { + $start = '<div class="file">'; + + return $start; + } + + function _end_diff() + { + return '</div>'; + } + + function _end_block() + { + return ''; + } +} + +/** +* "Inline" diff renderer. +* +* This class renders diffs in the Wiki-style "inline" format. +* +* @author Ciprian Popovici +* @package phpBB3 +*/ +class diff_renderer_inline extends diff_renderer +{ + var $_leading_context_lines = 10000; + var $_trailing_context_lines = 10000; + + // Prefix and suffix for inserted text + var $_ins_prefix = '<span class="ins">'; + var $_ins_suffix = '</span>'; + + // Prefix and suffix for deleted text + var $_del_prefix = '<span class="del">'; + var $_del_suffix = '</span>'; + + var $_block_head = ''; + + // What are we currently splitting on? Used to recurse to show word-level + var $_split_level = 'lines'; + + /** + * Our function to get the diff + */ + function get_diff_content($diff) + { + return '<pre>' . nl2br($this->render($diff)) . '</pre>'; + } + + function _start_diff() + { + return ''; + } + + function _end_diff() + { + return ''; + } + + function _block_header($xbeg, $xlen, $ybeg, $ylen) + { + return $this->_block_head; + } + + function _start_block($header) + { + return $header; + } + + function _lines($lines, $prefix = ' ', $encode = true) + { + if ($encode) + { + array_walk($lines, array(&$this, '_encode')); + } + + if ($this->_split_level == 'words') + { + return implode('', $lines); + } + else + { + return implode("\n", $lines) . "\n"; + } + } + + function _added($lines) + { + array_walk($lines, array(&$this, '_encode')); + $lines[0] = $this->_ins_prefix . $lines[0]; + $lines[sizeof($lines) - 1] .= $this->_ins_suffix; + return $this->_lines($lines, ' ', false); + } + + function _deleted($lines, $words = false) + { + array_walk($lines, array(&$this, '_encode')); + $lines[0] = $this->_del_prefix . $lines[0]; + $lines[sizeof($lines) - 1] .= $this->_del_suffix; + return $this->_lines($lines, ' ', false); + } + + function _changed($orig, $final) + { + // If we've already split on words, don't try to do so again - just display. + if ($this->_split_level == 'words') + { + $prefix = ''; + while ($orig[0] !== false && $final[0] !== false && substr($orig[0], 0, 1) == ' ' && substr($final[0], 0, 1) == ' ') + { + $prefix .= substr($orig[0], 0, 1); + $orig[0] = substr($orig[0], 1); + $final[0] = substr($final[0], 1); + } + + return $prefix . $this->_deleted($orig) . $this->_added($final); + } + + $text1 = implode("\n", $orig); + $text2 = implode("\n", $final); + + // Non-printing newline marker. + $nl = "\0"; + + // We want to split on word boundaries, but we need to preserve whitespace as well. + // Therefore we split on words, but include all blocks of whitespace in the wordlist. + $diff = &new diff($this->_split_on_words($text1, $nl), $this->_split_on_words($text2, $nl)); + + // Get the diff in inline format. + $renderer = &new diff_renderer_inline(array_merge($this->get_params(), array('split_level' => 'words'))); + + // Run the diff and get the output. + return str_replace($nl, "\n", $renderer->render($diff)) . "\n"; + } + + function _split_on_words($string, $newline_escape = "\n") + { + // Ignore \0; otherwise the while loop will never finish. + $string = str_replace("\0", '', $string); + + $words = array(); + $length = strlen($string); + $pos = 0; + + $tab_there = true; + while ($pos < $length) + { + // Check for tabs... do not include them + if ($tab_there && substr($string, $pos, 1) === "\t") + { + $words[] = "\t"; + $pos++; + + continue; + } + else + { + $tab_there = false; + } + + // Eat a word with any preceding whitespace. + $spaces = strspn(substr($string, $pos), " \n"); + $nextpos = strcspn(substr($string, $pos + $spaces), " \n"); + $words[] = str_replace("\n", $newline_escape, substr($string, $pos, $spaces + $nextpos)); + $pos += $spaces + $nextpos; + } + + return $words; + } + + function _encode(&$string) + { + $string = htmlspecialchars($string); + } +} + +/** +* "raw" diff renderer. +* This class could be used to output a raw unified patch file +* +* @package phpBB3 +*/ +class diff_renderer_raw extends diff_renderer +{ + var $_leading_context_lines = 4; + var $_trailing_context_lines = 4; + + /** + * Our function to get the diff + */ + function get_diff_content($diff) + { + return '<textarea style="height: 400px;" class="full">' . htmlspecialchars($this->render($diff)) . '</textarea>'; + } + + function _block_header($xbeg, $xlen, $ybeg, $ylen) + { + if ($xlen != 1) + { + $xbeg .= ',' . $xlen; + } + + if ($ylen != 1) + { + $ybeg .= ',' . $ylen; + } + return '@@ -' . $xbeg . ' +' . $ybeg . ' @@'; + } + + function _context($lines) + { + return $this->_lines($lines, ' '); + } + + function _added($lines) + { + return $this->_lines($lines, '+'); + } + + function _deleted($lines) + { + return $this->_lines($lines, '-'); + } + + function _changed($orig, $final) + { + return $this->_deleted($orig) . $this->_added($final); + } +} + +/** +* "chora (Horde)" diff renderer - similar style. +* This renderer class is a modified human_readable function from the Horde Framework. +* +* @package phpBB3 +*/ +class diff_renderer_side_by_side extends diff_renderer +{ + var $_leading_context_lines = 3; + var $_trailing_context_lines = 3; + + var $lines = array(); + + // Hold the left and right columns of lines for change blocks. + var $cols; + var $state; + + var $data = false; + + /** + * Our function to get the diff + */ + function get_diff_content($diff) + { + global $user; + + $output = ''; + $output .= '<table cellspacing="0" class="hrdiff"> +<caption> + <span class="unmodified"> </span> ' . $user->lang['LINE_UNMODIFIED'] . ' + <span class="added"> </span> ' . $user->lang['LINE_ADDED'] . ' + <span class="modified"> </span> ' . $user->lang['LINE_MODIFIED'] . ' + <span class="removed"> </span> ' . $user->lang['LINE_REMOVED'] . ' +</caption> +<tbody> +'; + + $this->render($diff); + + // Is the diff empty? + if (!sizeof($this->lines)) + { + $output .= '<tr><th colspan="2">' . $user->lang['NO_VISIBLE_CHANGES'] . '</th></tr>'; + } + else + { + // Iterate through every header block of changes + foreach ($this->lines as $header) + { + $output .= '<tr><th>Line ' . $header['oldline'] . '</th><th>' . $user->lang['LINE'] . ' ' . $header['newline'] . '</th></tr>'; + + // Each header block consists of a number of changes (add, remove, change). + $current_context = ''; + + foreach ($header['contents'] as $change) + { + if (!empty($current_context) && $change['type'] != 'empty') + { + $line = $current_context; + $current_context = ''; + + $output .= '<tr class="unmodified"><td><pre>' . ((strlen($line)) ? $line : ' ') . '</pre></td> + <td><pre>' . ((strlen($line)) ? $line : ' ') . '</pre></td></tr>'; + } + + switch ($change['type']) + { + case 'add': + $line = ''; + + foreach ($change['lines'] as $_line) + { + $line .= htmlspecialchars($_line) . '<br />'; + } + + $output .= '<tr><td class="added_empty"> </td><td class="added"><pre>' . ((strlen($line)) ? $line : ' ') . '</pre></td></tr>'; + break; + + case 'remove': + $line = ''; + + foreach ($change['lines'] as $_line) + { + $line .= htmlspecialchars($_line) . '<br />'; + } + + $output .= '<tr><td class="removed"><pre>' . ((strlen($line)) ? $line : ' ') . '</pre></td><td class="removed_empty"> </td></tr>'; + break; + + case 'empty': + $current_context .= htmlspecialchars($change['line']) . '<br />'; + break; + + case 'change': + // Pop the old/new stacks one by one, until both are empty. + $oldsize = sizeof($change['old']); + $newsize = sizeof($change['new']); + $left = $right = ''; + + for ($row = 0, $row_max = max($oldsize, $newsize); $row < $row_max; ++$row) + { + $left .= isset($change['old'][$row]) ? htmlspecialchars($change['old'][$row]) : ''; + $left .= '<br />'; + $right .= isset($change['new'][$row]) ? htmlspecialchars($change['new'][$row]) : ''; + $right .= '<br />'; + } + + $output .= '<tr>'; + + if (!empty($left)) + { + $output .= '<td class="modified"><pre>' . $left . '</pre></td>'; + } + else if ($row < $oldsize) + { + $output .= '<td class="modified"> </td>'; + } + else + { + $output .= '<td class="unmodified"> </td>'; + } + + if (!empty($right)) + { + $output .= '<td class="modified"><pre>' . $right . '</pre></td>'; + } + else if ($row < $newsize) + { + $output .= '<td class="modified"> </td>'; + } + else + { + $output .= '<td class="unmodified"> </td>'; + } + + $output .= '</tr>'; + break; + } + } + + if (!empty($current_context)) + { + $line = $current_context; + $current_context = ''; + + $output .= '<tr class="unmodified"><td><pre>' . ((strlen($line)) ? $line : ' ') . '</pre></td>'; + $output .= '<td><pre>' . ((strlen($line)) ? $line : ' ') . '</pre></td></tr>'; + } + } + } + + $output .= '</tbody></table>'; + + return $output; + } + + function _start_diff() + { + $this->lines = array(); + + $this->data = false; + $this->cols = array(array(), array()); + $this->state = 'empty'; + + return ''; + } + + function _end_diff() + { + // Just flush any remaining entries in the columns stack. + switch ($this->state) + { + case 'add': + $this->data['contents'][] = array('type' => 'add', 'lines' => $this->cols[0]); + break; + + case 'remove': + // We have some removal lines pending in our stack, so flush them. + $this->data['contents'][] = array('type' => 'remove', 'lines' => $this->cols[0]); + break; + + case 'change': + // We have both remove and addition lines, so this is a change block. + $this->data['contents'][] = array('type' => 'change', 'old' => $this->cols[0], 'new' => $this->cols[1]); + break; + } + + if ($this->data !== false) + { + $this->lines[] = $this->data; + } + + return ''; + } + + function _block_header($xbeg, $xlen, $ybeg, $ylen) + { + // Push any previous header information to the return stack. + if ($this->data !== false) + { + $this->lines[] = $this->data; + } + + $this->data = array('type' => 'header', 'oldline' => $xbeg, 'newline' => $ybeg, 'contents' => array()); + $this->state = 'dump'; + } + + function _added($lines) + { + array_walk($lines, array(&$this, '_perform_add')); + } + + function _perform_add($line) + { + if ($this->state == 'empty') + { + return ''; + } + + // This is just an addition line. + if ($this->state == 'dump' || $this->state == 'add') + { + // Start adding to the addition stack. + $this->cols[0][] = $line; + $this->state = 'add'; + } + else + { + // This is inside a change block, so start accumulating lines. + $this->state = 'change'; + $this->cols[1][] = $line; + } + } + + function _deleted($lines) + { + array_walk($lines, array(&$this, '_perform_delete')); + } + + function _perform_delete($line) + { + // This is a removal line. + $this->state = 'remove'; + $this->cols[0][] = $line; + } + + function _context($lines) + { + array_walk($lines, array(&$this, '_perform_context')); + } + + function _perform_context($line) + { + // An empty block with no action. + switch ($this->state) + { + case 'add': + $this->data['contents'][] = array('type' => 'add', 'lines' => $this->cols[0]); + break; + + case 'remove': + // We have some removal lines pending in our stack, so flush them. + $this->data['contents'][] = array('type' => 'remove', 'lines' => $this->cols[0]); + break; + + case 'change': + // We have both remove and addition lines, so this is a change block. + $this->data['contents'][] = array('type' => 'change', 'old' => $this->cols[0], 'new' => $this->cols[1]); + break; + } + + $this->cols = array(array(), array()); + $this->data['contents'][] = array('type' => 'empty', 'line' => $line); + $this->state = 'dump'; + } + + function _changed($orig, $final) + { + return $this->_deleted($orig) . $this->_added($final); + } + +} + +?>
\ No newline at end of file diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 48fec2d795..91a818d454 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -15,7 +15,7 @@ * * Set variable, used by {@link request_var the request_var function} * -* @access: private +* @access private */ function set_var(&$result, $var, $type, $multibyte = false) { @@ -24,14 +24,26 @@ function set_var(&$result, $var, $type, $multibyte = false) if ($type == 'string') { - $result = trim(htmlspecialchars(str_replace(array("\r\n", "\r"), array("\n", "\n"), $result))); - $result = (STRIP) ? stripslashes($result) : $result; + $result = trim(htmlspecialchars(str_replace(array("\r\n", "\r"), array("\n", "\n"), $result), ENT_COMPAT, 'UTF-8')); - // Check for possible multibyte characters to save a preg_replace call if nothing is in there... - if ($multibyte && strpos($result, '&#') !== false) + if (!empty($result)) { - $result = preg_replace('#&(\#[0-9]+;)#', '&\1', $result); + // Make sure multibyte characters are wellformed + if ($multibyte) + { + if (!preg_match('/^./u', $result)) + { + $result = ''; + } + } + else + { + // no multibyte, allow only ASCII (0-127) + $result = preg_replace('/[\x80-\xFF]/', '?', $result); + } } + + $result = (STRIP) ? stripslashes($result) : $result; } } @@ -40,8 +52,17 @@ function set_var(&$result, $var, $type, $multibyte = false) * * Used to get passed variable */ -function request_var($var_name, $default, $multibyte = false) +function request_var($var_name, $default, $multibyte = false, $cookie = false) { + if (!$cookie && isset($_COOKIE[$var_name])) + { + if (!isset($_GET[$var_name]) && !isset($_POST[$var_name])) + { + return (is_array($default)) ? array() : $default; + } + $_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]))) { return (is_array($default)) ? array() : $default; @@ -136,16 +157,17 @@ function gen_rand_string($num_chars = 8) */ function unique_id($extra = 'c') { + static $dss_seeded = false; global $config; - static $dss_seeded; $val = $config['rand_seed'] . microtime(); $val = md5($val); $config['rand_seed'] = md5($config['rand_seed'] . $val . $extra); - if ($dss_seeded !== true) + if ($dss_seeded !== true && ($config['rand_seed_last_update'] < time() - rand(1,10))) { set_config('rand_seed', $config['rand_seed'], true); + set_config('rand_seed_last_update', time(), true); $dss_seeded = true; } @@ -161,6 +183,26 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); + // Check if the key is selectable. If not, we reset to the first key found. + // This ensures the values are always valid. + if (!isset($limit_days[$sort_days])) + { + @reset($limit_days); + $sort_days = key($limit_days); + } + + if (!isset($sort_by_text[$sort_key])) + { + @reset($sort_by_text); + $sort_key = key($sort_by_text); + } + + if (!isset($sort_dir_text[$sort_dir])) + { + @reset($sort_dir_text); + $sort_dir = key($sort_dir_text); + } + $s_limit_days = '<select name="st">'; foreach ($limit_days as $day => $text) { @@ -378,62 +420,191 @@ if (!function_exists('stripos')) if (!function_exists('realpath')) { - /** - * Replacement for realpath if it is disabled - * This function is from the php manual by nospam at savvior dot com - */ - function phpbb_realpath($path) + if (substr(PHP_OS, 0, 3) != 'WIN' && !(bool) ini_get('safe_mode') && function_exists('shell_exec') && trim(`realpath .`)) + { + /** + * @author Chris Smith <chris@project-minerva.org> + * @copyright 2006 Project Minerva Team + * @param string $path The path which we should attempt to resolve. + * @return mixed + * @ignore + */ + function phpbb_realpath($path) + { + $arg = escapeshellarg($path); + return trim(`realpath '$arg'`); + } + } + else { - $translated_path = getenv('PATH_TRANSLATED'); + /** + * Checks if a path ($path) is absolute or relative + * + * @param string $path Path to check absoluteness of + * @return boolean + */ + function is_absolute($path) + { + return ($path[0] == '/' || (substr(PHP_OS, 0, 3) == 'WIN' && preg_match('#^[a-z]:/#i', $path))) ? true : false; + } - $translated_path = str_replace('\\', '/', $translated_path); - $translated_path = str_replace(basename(getenv('PATH_INFO')), '', $translated_path); + /** + * @author Chris Smith <chris@project-minerva.org> + * @copyright 2006 Project Minerva Team + * @param string $path The path which we should attempt to resolve. + * @return mixed + */ + function phpbb_realpath($path) + { + // Now to perform funky shizzle - $translated_path .= '/'; + // Switch to use UNIX slashes + $path = str_replace(DIRECTORY_SEPARATOR, '/', $path); + $path_prefix = ''; - if ($path == '.' || $path == './') - { - return $translated_path; - } + // Determine what sort of path we have + if (is_absolute($path)) + { + $absolute = true; + + if ($path[0] == '/') + { + // Absolute path, *NIX style + $path_prefix = ''; + } + else + { + // Absolute path, Windows style + // Remove the drive letter and colon + $path_prefix = $path[0] . ':'; + $path = substr($path, 2); + } + } + else + { + // Relative Path + // Prepend the current working directory + if (function_exists('getcwd')) + { + // This is the best method, hopefully it is enabled! + $path = str_replace(DIRECTORY_SEPARATOR, '/', getcwd()) . '/' . $path; + $absolute = true; + if (preg_match('#^[a-z]:#i', $path)) + { + $path_prefix = $path[0] . ':'; + $path = substr($path, 2); + } + else + { + $path_prefix = ''; + } + } + else if (isset($_SERVER['SCRIPT_FILENAME']) && !empty($_SERVER['SCRIPT_FILENAME'])) + { + // Warning: If chdir() has been used this will lie! + // @todo This has some problems sometime (CLI can create them easily) + $path = str_replace(DIRECTORY_SEPARATOR, '/', dirname($_SERVER['SCRIPT_FILENAME'])) . '/' . $path; + $absolute = true; + $path_prefix = ''; + } + else + { + // We have no way of getting the absolute path, just run on using relative ones. + $absolute = false; + $path_prefix = '.'; + } + } - // now check for back directory - $translated_path .= $path; + // Remove any repeated slashes + $path = preg_replace('#/{2,}#', '/', $path); - $dirs = explode('/', $translated_path); + // Remove the slashes from the start and end of the path + $path = trim($path, '/'); - foreach ($dirs as $key => $value) - { - if ($value == '..') + // Break the string into little bits for us to nibble on + $bits = explode('/', $path); + + // Remove any . in the path + $bits = array_diff($bits, array('.')); + + // Lets get looping, run over and resolve any .. (up directory) + for ($i = 0, $max = sizeof($bits); $i < $max; $i++) { - $dirs[$key] = ''; - $dirs[$key - 2] = ''; + // @todo Optimise + if ($bits[$i] == '..' ) + { + if (isset($bits[$i - 1])) + { + if ($bits[$i - 1] != '..') + { + // We found a .. and we are able to traverse upwards, lets do it! + unset($bits[$i]); + unset($bits[$i - 1]); + $i -= 2; + $max -= 2; + $bits = array_values($bits); + } + } + else if ($absolute) // ie. !isset($bits[$i - 1]) && $absolute + { + // We have an absolute path trying to descend above the root of the filesystem + // ... Error! + return false; + } + } } - } - $translated_path = ''; + // Prepend the path prefix + array_unshift($bits, $path_prefix); - foreach ($dirs as $key => $value) - { - if (strlen($value) > 0) + $resolved = ''; + + $max = sizeof($bits) - 1; + + // Check if we are able to resolve symlinks, Windows cannot. + $symlink_resolve = (function_exists('readlink')) ? true : false; + + foreach ($bits as $i => $bit) + { + if (@is_dir("$resolved/$bit") || ($i == $max && @is_file("$resolved/$bit"))) + { + // Path Exists + if ($symlink_resolve && is_link("$resolved/$bit") && ($link = readlink("$resolved/$bit"))) + { + // Resolved a symlink. + $resolved = $link . (($i == $max) ? '' : '/'); + continue; + } + } + else + { + // Something doesn't exist here! + // This is correct realpath() behaviour but sadly open_basedir and safe_mode make this problematic + // return false; + } + $resolved .= $bit . (($i == $max) ? '' : '/'); + } + + // @todo If the file exists fine and open_basedir only has one path we should be able to prepend it + // because we must be inside that basedir, the question is where... + // @internal The slash in is_dir() gets around an open_basedir restriction + if (!@file_exists($resolved) || (!is_dir($resolved . '/') && !is_file($resolved))) { - $translated_path .= $value . '/'; + return false; } - } - $translated_path = substr($translated_path, 0, strlen($translated_path) - 1); + // Put the slashes back to the native operating systems slashes + $resolved = str_replace('/', DIRECTORY_SEPARATOR, $resolved); - if (is_dir($translated_path) || is_file($translated_path)) - { - return $translated_path; + return $resolved; // We got here, in the end! } - - return false; } } else { /** * A wrapper for realpath + * @ignore */ function phpbb_realpath($path) { @@ -441,6 +612,14 @@ else } } +if (!function_exists('htmlspecialchars_decode')) +{ + function htmlspecialchars_decode($string, $quote_style = ENT_COMPAT) + { + return strtr($string, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style))); + } +} + // functions used for building option fields /** @@ -503,7 +682,7 @@ function tz_select($default = '', $truncate = false) { if ($truncate) { - $zone = (strlen($zone) > 70) ? substr($zone, 0, 70) . '...' : $zone; + $zone = (utf8_strlen($zone) > 70) ? utf8_substr($zone, 0, 70) . '...' : $zone; } if (is_numeric($offset)) @@ -613,24 +792,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ ); } - if (sizeof($sql_ary)) - { - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query('INSERT INTO ' . FORUMS_TRACK_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); - break; - - default: - foreach ($sql_ary as $ary) - { - $db->sql_query('INSERT INTO ' . FORUMS_TRACK_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; - } - } + $db->sql_multi_insert(FORUMS_TRACK_TABLE, $sql_ary); } } else if ($config['load_anon_lastread'] || $user->data['is_registered']) @@ -1004,6 +1166,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis * @param int $f_mark_time the forums last mark time if user is registered and load_db_lastread enabled * @param int $mark_time_forum false if the mark time needs to be obtained, else the last users forum mark time * +* @return true if complete forum got marked read, else false. */ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_time = false, $mark_time_forum = false) { @@ -1098,7 +1261,10 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti if (!$row) { markread('topics', $forum_id); + return true; } + + return false; } // Pagination functions @@ -1304,16 +1470,19 @@ function generate_board_url($without_script_path = false) /** * Redirects the user to another page then exits the script nicely */ -function redirect($url) +function redirect($url, $return = false) { - global $db, $cache, $config, $user; + global $db, $cache, $config, $user, $phpbb_root_path; if (empty($user->lang)) { $user->add_lang('common'); } - garbage_collection(); + if (!$return) + { + garbage_collection(); + } // Make sure no &'s are in, this will break the redirect $url = str_replace('&', '&', $url); @@ -1336,7 +1505,7 @@ function redirect($url) { // Full URL } - else if ($url{0} == '/') + else if ($url[0] == '/') { // Absolute uri, prepend direct url... $url = generate_board_url(true) . $url; @@ -1360,8 +1529,8 @@ function redirect($url) } else { - // Get the realpath of dirname - $root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath('./'))); + // Used ./ before, but $phpbb_root_path is working better with urls within another root path + $root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($phpbb_root_path))); $page_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($pathinfo['dirname']))); $intersection = array_intersect_assoc($root_dirs, $page_dirs); @@ -1380,6 +1549,17 @@ function redirect($url) } } + // Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2 + if (strpos(urldecode($url), "\n") !== false || strpos(urldecode($url), "\r") !== false || strpos($url, ';') !== false) + { + trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR); + } + + if ($return) + { + return $url; + } + // Redirect via an HTML form for PITA webservers if (@preg_match('#Microsoft|WebSTAR|Xitami#', getenv('SERVER_SOFTWARE'))) { @@ -1453,9 +1633,20 @@ function build_url($strip_vars = false) } $query = $_query = array(); - parse_str(substr($redirect, strpos($redirect, '?') + 1), $query); + + $args = substr($redirect, strpos($redirect, '?') + 1); + $args = ($args) ? explode('&', $args) : array(); $redirect = substr($redirect, 0, strpos($redirect, '?')); + foreach ($args as $argument) + { + $arguments = explode('=', $argument); + $key = $arguments[0]; + unset($arguments[0]); + + $query[$key] = implode('=', $arguments); + } + // Strip the vars off foreach ($strip_vars as $strip) { @@ -1465,7 +1656,7 @@ function build_url($strip_vars = false) } } - // + // Glue the remaining parts together... already urlencoded foreach ($query as $key => $value) { $_query[] = $key . '=' . $value; @@ -1485,6 +1676,8 @@ function meta_refresh($time, $url) { global $template; + $url = redirect($url, true); + $template->assign_vars(array( 'META' => '<meta http-equiv="refresh" content="' . $time . ';url=' . $url . '" />') ); @@ -1632,14 +1825,14 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa if (isset($_POST['login'])) { - $username = request_var('username', ''); - $password = request_var('password', ''); + $username = request_var('username', '', true); + $password = request_var('password', '', true); $autologin = (!empty($_POST['autologin'])) ? true : false; $viewonline = (!empty($_POST['viewonline'])) ? 0 : 1; $admin = ($admin) ? 1 : 0; // Check if the supplied username is equal to the one stored within the database if re-authenticating - if ($admin && strtolower($username) != strtolower($user->data['username'])) + if ($admin && utf8_clean_string($username) != utf8_clean_string($user->data['username'])) { // We log the attempt to use a different username... add_log('admin', 'LOG_ADMIN_AUTH_FAIL'); @@ -1715,7 +1908,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa 'S_CONFIRM_CODE' => true, 'CONFIRM_ID' => $confirm_id, 'CONFIRM_IMAGE' => '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&id=' . $confirm_id . '&type=' . CONFIRM_LOGIN) . '" alt="" title="" />', - 'L_LOGIN_CONFIRM_EXPLAIN' => sprintf($user->lang['LOGIN_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlentities($config['board_contact']) . '">', '</a>'), + 'L_LOGIN_CONFIRM_EXPLAIN' => sprintf($user->lang['LOGIN_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'), )); $err = $user->lang[$result['error_msg']]; @@ -1729,7 +1922,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa // Assign admin contact to some error messages if ($result['error_msg'] == 'LOGIN_ERROR_USERNAME' || $result['error_msg'] == 'LOGIN_ERROR_PASSWORD') { - $err = (!$config['board_contact']) ? sprintf($user->lang[$result['error_msg']], '', '') : sprintf($user->lang[$result['error_msg']], '<a href="mailto:' . htmlentities($config['board_contact']) . '">', '</a>'); + $err = (!$config['board_contact']) ? sprintf($user->lang[$result['error_msg']], '', '') : sprintf($user->lang[$result['error_msg']], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'); } break; } @@ -1738,7 +1931,15 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa if (!$redirect) { // We just use what the session code determined... - $redirect = $user->page['page_name'] . (($user->page['query_string']) ? '?' . $user->page['query_string'] : ''); + // 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']) ? '?' . $user->page['query_string'] : ''); } $s_hidden_fields = build_hidden_fields(array('redirect' => $redirect, 'sid' => $user->session_id)); @@ -1753,7 +1954,8 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa '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"), // Needs to stay index.$phpEx because we are within the admin directory + 'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? 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, @@ -1777,7 +1979,7 @@ function login_forum_box($forum_data) { global $db, $config, $user, $template, $phpEx; - $password = request_var('password', ''); + $password = request_var('password', '', true); $sql = 'SELECT forum_id FROM ' . FORUMS_ACCESS_TABLE . ' @@ -1832,7 +2034,11 @@ function login_forum_box($forum_data) $template->assign_var('LOGIN_ERROR', $user->lang['WRONG_PASSWORD']); } - page_header(); + page_header($user->lang['LOGIN']); + + $template->assign_vars(array( + 'S_HIDDEN_FIELDS' => build_hidden_fields(array('f' => $forum_data['forum_id']))) + ); $template->set_filenames(array( 'body' => 'login_forum.html') @@ -1876,6 +2082,117 @@ function bump_topic_allowed($forum_id, $topic_bumped, $last_post_time, $topic_po } /** +* Generates a text with approx. the specified length which contains the specified words and their context +* +* @param string $text The full text from which context shall be extracted +* @param string $words An array of words which should be contained in the result, has to be a valid part of a PCRE pattern (escape with preg_quote!) +* @param int $length The desired length of the resulting text, however the result might be shorter or longer than this value +* +* @return string Context of the specified words seperated by "..." +*/ +function get_context($text, $words, $length = 400) +{ + // first replace all whitespaces with single spaces + $text = preg_replace('/\s+/', ' ', $text); + + $word_indizes = array(); + if (sizeof($words)) + { + $match = ''; + // find the starting indizes of all words + foreach ($words as $word) + { + if (preg_match('#(?:[^\w]|^)(' . $word . ')(?:[^\w]|$)#i', $text, $match)) + { + $pos = strpos($text, $match[1]); + if ($pos !== false) + { + $word_indizes[] = $pos; + } + } + } + unset($match); + + if (sizeof($word_indizes)) + { + $word_indizes = array_unique($word_indizes); + sort($word_indizes); + + $wordnum = sizeof($word_indizes); + // number of characters on the right and left side of each word + $sequence_length = (int) ($length / (2 * $wordnum)) - 2; + $final_text = ''; + $word = $j = 0; + $final_text_index = -1; + + // cycle through every character in the original text + for ($i = $word_indizes[$word], $n = strlen($text); $i < $n; $i++) + { + // if the current position is the start of one of the words then append $sequence_length characters to the final text + if (isset($word_indizes[$word]) && ($i == $word_indizes[$word])) + { + if ($final_text_index < $i - $sequence_length - 1) + { + $final_text .= '... ' . preg_replace('#^([^ ]*)#', '', substr($text, $i - $sequence_length, $sequence_length)); + } + else + { + // if the final text is already nearer to the current word than $sequence_length we only append the text + // from its current index on and distribute the unused length to all other sequenes + $sequence_length += (int) (($final_text_index - $i + $sequence_length + 1) / (2 * $wordnum)); + $final_text .= substr($text, $final_text_index + 1, $i - $final_text_index - 1); + } + $final_text_index = $i - 1; + + // add the following characters to the final text (see below) + $word++; + $j = 1; + } + + if ($j > 0) + { + // add the character to the final text and increment the sequence counter + $final_text .= $text[$i]; + $final_text_index++; + $j++; + + // if this is a whitespace then check whether we are done with this sequence + if ($text[$i] == ' ') + { + // only check whether we have to exit the context generation completely if we haven't already reached the end anyway + if ($i + 4 < $n) + { + if (($j > $sequence_length && $word >= $wordnum) || strlen($final_text) > $length) + { + $final_text .= ' ...'; + break; + } + } + else + { + // make sure the text really reaches the end + $j -= 4; + } + + // stop context generation and wait for the next word + if ($j > $sequence_length) + { + $j = 0; + } + } + } + } + return $final_text; + } + } + + if (!sizeof($words) || !sizeof($word_indizes)) + { + return (strlen($text) >= $length + 3) ? substr($text, 0, $length) . '...' : $text; + } +} + +/** * Decode text whereby text is coming from the db and expected to be pre-parsed content * We are placing this outside of the message parser because we are often in need of it... */ @@ -1896,21 +2213,28 @@ function decode_message(&$message, $bbcode_uid = '') $message = str_replace($match, $replace, $message); - $match = array( - '#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#', - '#<!\-\- m \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- m \-\->#', - '#<!\-\- w \-\-><a href="http:\/\/(.*?)" target="_blank">.*?</a><!\-\- w \-\->#', - '#<!\-\- l \-\-><a href="(.*?)">.*?</a><!\-\- l \-\->#', - '#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#', - '#<!\-\- .*? \-\->#s', - '#<.*?>#s' - ); - - $replace = array('\1', '\1', '\1', '\1', '\1', '', ''); - + $match = get_preg_expression('bbcode_htm'); + $replace = array('\1', '\2', '\1', '', ''); + $message = preg_replace($match, $replace, $message); +} - return; +/** +* Strips all bbcode from a text and returns the plain content +*/ +function strip_bbcode(&$text, $uid = '') +{ + if (!$uid) + { + $uid = '[0-9a-z]{5,}'; + } + + $text = preg_replace("#\[\/?[a-z0-9\*\+\-]+(?:=.*?)?(?::[a-z])?(\:?$uid)\]#", ' ', $text); + + $match = get_preg_expression('bbcode_htm'); + $replace = array('\1', '\2', '\1', '', ''); + + $text = preg_replace($match, $replace, $text); } /** @@ -1919,36 +2243,37 @@ function decode_message(&$message, $bbcode_uid = '') */ function generate_text_for_display($text, $uid, $bitfield, $flags) { - global $__bbcode; + static $bbcode; if (!$text) { return ''; } + $text = str_replace("\n", '<br />', censor_text($text)); + // Parse bbcode if bbcode uid stored and bbcode enabled - if ($uid && ($flags & 1)) + if ($uid && ($flags & OPTION_FLAG_BBCODE)) { if (!class_exists('bbcode')) { global $phpbb_root_path, $phpEx; - include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); + include($phpbb_root_path . 'includes/bbcode.' . $phpEx); } - if (empty($__bbcode)) + if (empty($bbcode)) { - $__bbcode = new bbcode($bitfield); + $bbcode = new bbcode($bitfield); } else { - $__bbcode->bbcode($bitfield); + $bbcode->bbcode($bitfield); } - $__bbcode->bbcode_second_pass($text, $uid); + $bbcode->bbcode_second_pass($text, $uid); } - $text = smiley_text($text, !($flags & 2)); - $text = str_replace("\n", '<br />', censor_text($text)); + $text = smiley_text($text, !($flags & OPTION_FLAG_SMILIES)); return $text; } @@ -1962,8 +2287,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb { global $phpbb_root_path, $phpEx; - $uid = ''; - $bitfield = ''; + $uid = $bitfield = ''; if (!$text) { @@ -1972,7 +2296,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb if (!class_exists('parse_message')) { - include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx); + include($phpbb_root_path . 'includes/message_parser.' . $phpEx); } $message_parser = new parse_message($text); @@ -2004,9 +2328,9 @@ function generate_text_for_edit($text, $uid, $flags) decode_message($text, $uid); return array( - 'allow_bbcode' => ($flags & 1) ? 1 : 0, - 'allow_smilies' => ($flags & 2) ? 1 : 0, - 'allow_urls' => ($flags & 4) ? 1 : 0, + 'allow_bbcode' => ($flags & OPTION_FLAG_BBCODE) ? 1 : 0, + 'allow_smilies' => ($flags & OPTION_FLAG_SMILIES) ? 1 : 0, + 'allow_urls' => ($flags & OPTION_FLAG_LINKS) ? 1 : 0, 'text' => $text ); } @@ -2039,11 +2363,11 @@ function make_clickable($text, $server_url = false) // matches a xxxx://aaaaa.bbb.cccc. ... $magic_url_match[] = '#(^|[\n ]|\()([\w]+:/{2}.*?([^[ \t\n\r<"\'\)&]+|&(?!lt;|quot;))*)#ie'; - $magic_url_replace[] = "'\$1<!-- m --><a href=\"\$2\" target=\"_blank\">' . ((strlen('\$2') > 55) ? substr(str_replace('&', '&', '\$2'), 0, 39) . ' ... ' . substr(str_replace('&', '&', '\$2'), -10) : '\$2') . '</a><!-- m -->'"; + $magic_url_replace[] = "'\$1<!-- m --><a href=\"\$2\">' . ((strlen('\$2') > 55) ? substr(str_replace('&', '&', '\$2'), 0, 39) . ' ... ' . substr(str_replace('&', '&', '\$2'), -10) : '\$2') . '</a><!-- m -->'"; // matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing $magic_url_match[] = '#(^|[\n ]|\()(w{3}\.[\w\-]+\.[\w\-.\~]+(?:[^[ \t\n\r<"\'\)&]+|&(?!lt;|quot;))*)#ie'; - $magic_url_replace[] = "'\$1<!-- w --><a href=\"http://\$2\" target=\"_blank\">' . ((strlen('\$2') > 55) ? substr(str_replace('&', '&', '\$2'), 0, 39) . ' ... ' . substr(str_replace('&', '&', '\$2'), -10) : '\$2') . '</a><!-- w -->'"; + $magic_url_replace[] = "'\$1<!-- w --><a href=\"http://\$2\">' . ((strlen('\$2') > 55) ? substr(str_replace('&', '&', '\$2'), 0, 39) . ' ... ' . substr(str_replace('&', '&', '\$2'), -10) : '\$2') . '</a><!-- w -->'"; // matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode. $magic_url_match[] = '/(^|[\n ]|\()(' . get_preg_expression('email') . ')/ie'; @@ -2058,19 +2382,16 @@ function make_clickable($text, $server_url = false) */ function censor_text($text) { - global $censors, $user, $cache; + static $censors; + global $cache; - if (!isset($censors)) + if (!isset($censors) || !is_array($censors)) { - $censors = array(); - - if ($user->optionget('viewcensors')) - { - $cache->obtain_word_list($censors); - } + // obtain_word_list is taking care of the users censor option and the board-wide option + $censors = $cache->obtain_word_list(); } - if (sizeof($censors) && $user->optionget('viewcensors')) + if (sizeof($censors)) { return preg_replace($censors['match'], $censors['replace'], $text); } @@ -2102,6 +2423,12 @@ function parse_inline_attachments(&$text, &$attachments, &$update_count, $forum_ { global $config, $user; + if (!function_exists('display_attachments')) + { + global $phpbb_root_path, $phpEx; + include("{$phpbb_root_path}includes/functions_display.$phpEx"); + } + $attachments = display_attachments($forum_id, NULL, $attachments, $update_count, false, true); $tpl_size = sizeof($attachments); @@ -2137,9 +2464,7 @@ function extension_allowed($forum_id, $extension, &$extensions) if (!sizeof($extensions)) { global $cache; - - $extensions = array(); - $cache->obtain_attach_extensions($extensions); + $extensions = $cache->obtain_attach_extensions(); } if (!isset($extensions['_allowed_'][$extension])) @@ -2221,7 +2546,7 @@ function parse_cfg_file($filename, $lines = false) { $line = trim($line); - if (!$line || $line{0} == '#' || ($delim_pos = strpos($line, '=')) === false) + if (!$line || $line[0] == '#' || ($delim_pos = strpos($line, '=')) === false) { continue; } @@ -2242,7 +2567,7 @@ function parse_cfg_file($filename, $lines = false) { $value = ''; } - else if (($value{0} == "'" && $value{sizeof($value)-1} == "'") || ($value{0} == '"' && $value{sizeof($value)-1} == '"')) + else if (($value[0] == "'" && $value[sizeof($value) - 1] == "'") || ($value[0] == '"' && $value[sizeof($value) - 1] == '"')) { $value = substr($value, 1, sizeof($value)-2); } @@ -2367,15 +2692,25 @@ function get_backtrace() /** * This function returns a regular expression pattern for commonly used expressions -* Use with / as delimiter -* mode can be: email| +* Use with / as delimiter for email mode +* mode can be: email|bbcode_htm */ function get_preg_expression($mode) { switch ($mode) { case 'email': - return '[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*?[a-z]+'; + return '[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*[a-z]+'; + break; + + case 'bbcode_htm': + return array( + '#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#', + '#<!\-\- (l|m|w) \-\-><a href="(.*?)">.*?</a><!\-\- \1 \-\->#', + '#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#', + '#<!\-\- .*? \-\->#s', + '#<.*?>#s', + ); break; } @@ -2386,35 +2721,80 @@ function get_preg_expression($mode) * Truncates string while retaining special characters if going over the max length * The default max length is 60 at the moment */ -function truncate_string($string, $max_length = 60) +function truncate_string($string, $max_length = 60, $allow_reply = true) { $chars = array(); - // split the multibyte characters first - $string_ary = preg_split('#(&\#[0-9]+;)#', $string, -1, PREG_SPLIT_DELIM_CAPTURE); + $strip_reply = false; + if ($allow_reply && strpos($string, 'Re: ') === 0) + { + $strip_reply = true; + $string = substr($string, 4); + } + + $_chars = utf8_str_split(htmlspecialchars_decode($string)); + $chars = array_map('htmlspecialchars', $_chars); - // Now go through the array and split the other characters - foreach ($string_ary as $key => $value) + // Now check the length ;) + if (sizeof($chars) > $max_length) + { + // Cut off the last elements from the array + $string = implode('', array_slice($chars, 0, $max_length)); + } + + if ($strip_reply) + { + $string = 'Re: ' . $string; + } + + return $string; +} + + +/** +* Wrapper for php's checkdnsrr function. +* +* The windows failover is from the php manual +* Please make sure to check the return value for === true and === false, since NULL could +* be returned too. +* +* @return true if entry found, false if not, NULL if this function is not supported by this environment +*/ +function phpbb_checkdnsrr($host, $type = '') +{ + $type = (!$type) ? 'MX' : $type; + + if (strpos(PHP_OS, 'WIN') !== false) { - if (strpos($value, '&#') === 0) + if (!function_exists('exec')) { - $chars[] = $value; - continue; + return NULL; } - // decode html entities and put them back later - $_chars = str_split(html_entity_decode($value)); - $chars = array_merge($chars, array_map('htmlspecialchars', $_chars)); - } + @exec('nslookup -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host), $output); - // Now check the length ;) - if (sizeof($chars) <= $max_length) + foreach ($output as $line) + { + if (!trim($line)) + { + continue; + } + + // Valid records begin with host name: + if (strpos($line, $host) === 0) + { + return true; + } + } + + return false; + } + else if (function_exists('checkdnsrr')) { - return $string; + return (checkdnsrr($host, $type)) ? true : false; } - // Cut off the last elements from the array - return implode('', array_slice($chars, 0, $max_length)); + return NULL; } // Handler, header and footer @@ -2489,7 +2869,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) if (!empty($config['board_contact'])) { - echo ' <p>Please notify the board administrator or webmaster : <a href="mailto:' . $config['board_contact'] . '">' . $config['board_contact'] . '</a></p>'; + echo ' <p>Please notify the board administrator or webmaster: <a href="mailto:' . $config['board_contact'] . '">' . $config['board_contact'] . '</a></p>'; } echo ' </div>'; @@ -2510,7 +2890,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) case E_USER_NOTICE: define('IN_ERROR_HANDLER', true); - + if (empty($user->data)) { $user->session_begin(); @@ -2544,8 +2924,10 @@ function msg_handler($errno, $msg_text, $errfile, $errline) ); $template->assign_vars(array( - 'MESSAGE_TITLE' => $msg_title, - 'MESSAGE_TEXT' => $msg_text) + 'MESSAGE_TITLE' => $msg_title, + 'MESSAGE_TEXT' => $msg_text, + 'S_USER_WARNING' => ($errno == E_USER_WARNING) ? true : false, + 'S_USER_NOTICE' => ($errno == E_USER_NOTICE) ? true : false) ); // We do not want the cron script to be called on error messages @@ -2620,7 +3002,7 @@ function page_header($page_title = '', $display_online_list = true) $reading_sql = " AND s.session_page LIKE '%\_f\_={$f}x%'"; // Specify escape character for MSSQL - if (SQL_LAYER == 'mssql' || SQL_LAYER == 'mssql_odbc') + if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') { $reading_sql .= " ESCAPE '\\'"; } @@ -2629,11 +3011,25 @@ function page_header($page_title = '', $display_online_list = true) // Get number of online guests if (!$config['load_online_guests']) { - $sql = 'SELECT COUNT(DISTINCT s.session_ip) as num_guests - FROM ' . SESSIONS_TABLE . ' s - WHERE s.session_user_id = ' . ANONYMOUS . ' - AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) . - $reading_sql; + if ($db->sql_layer === 'sqlite') + { + $sql = 'SELECT COUNT(session_ip) as num_guests + FROM ( + SELECT DISTINCT s.session_ip + FROM ' . SESSIONS_TABLE . ' s + WHERE s.session_user_id = ' . ANONYMOUS . ' + AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) . + $reading_sql . + ')'; + } + else + { + $sql = 'SELECT COUNT(DISTINCT s.session_ip) as num_guests + FROM ' . SESSIONS_TABLE . ' s + WHERE s.session_user_id = ' . ANONYMOUS . ' + AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) . + $reading_sql; + } $result = $db->sql_query($sql); $guests_online = (int) $db->sql_fetchfield('num_guests'); $db->sql_freeresult($result); @@ -2658,7 +3054,12 @@ function page_header($page_title = '', $display_online_list = true) { if ($row['user_colour']) { - $row['username'] = '<b style="color:#' . $row['user_colour'] . '">' . $row['username'] . '</b>'; + $user_colour = ' style="color:#' . $row['user_colour'] . '"'; + $row['username'] = '<strong>' . $row['username'] . '</strong>'; + } + else + { + $user_colour = ''; } if ($row['user_allow_viewonline'] && $row['session_viewonline']) @@ -2668,13 +3069,21 @@ function page_header($page_title = '', $display_online_list = true) } else { - $user_online_link = '<i>' . $row['username'] . '</i>'; + $user_online_link = '<em>' . $row['username'] . '</em>'; $logged_hidden_online++; } if (($row['user_allow_viewonline'] && $row['session_viewonline']) || $auth->acl_get('u_viewonline')) { - $user_online_link = ($row['user_type'] <> USER_IGNORE) ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']) . '">' . $user_online_link . '</a>' : $user_online_link; + if ($row['user_type'] <> USER_IGNORE) + { + $user_online_link = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']) . '"' . $user_colour . '>' . $user_online_link . '</a>'; + } + else + { + $user_online_link = ($user_colour) ? '<span' . $user_colour . '>' . $user_online_link . '</span>' : $user_online_link; + } + $online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link; } } @@ -2849,18 +3258,19 @@ function page_header($page_title = '', $display_online_list = true) 'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm') : '', 'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false, - 'S_BOARD_DISABLED' => ($config['board_disable'] && !defined('IN_LOGIN') && $auth->acl_gets('a_', 'm_')) ? true : false, + 'S_BOARD_DISABLED' => ($config['board_disable'] && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_')) ? true : false, 'S_REGISTERED_USER' => $user->data['is_registered'], 'S_IS_BOT' => $user->data['is_bot'], 'S_USER_PM_POPUP' => $user->optionget('popuppm'), - 'S_USER_LANG' => $user->data['user_lang'], + 'S_USER_LANG' => $user->lang['USER_LANG'], 'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'], + 'S_USERNAME' => $user->data['username'], 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], - 'S_CONTENT_ENCODING' => $user->lang['ENCODING'], + 'S_CONTENT_ENCODING' => 'UTF-8', 'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'], 'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT'], 'S_TIMEZONE' => ($user->data['user_dst'] || ($user->data['user_id'] == ANONYMOUS && $config['board_dst'])) ? sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], $user->lang['tz']['dst']) : sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], ''), - 'S_DISPLAY_ONLINE_LIST' => ($config['load_online']) ? 1 : 0, + 'S_DISPLAY_ONLINE_LIST' => ($l_online_time) ? 1 : 0, 'S_DISPLAY_SEARCH' => (!$config['load_search']) ? 0 : (isset($auth) ? ($auth->acl_get('u_search') && $auth->acl_getf_global('f_search')) : 1), 'S_DISPLAY_PM' => ($config['allow_privmsg'] && $user->data['is_registered']) ? 1 : 0, 'S_DISPLAY_MEMBERLIST' => (isset($auth)) ? $auth->acl_get('u_viewprofile') : 0, @@ -2877,7 +3287,7 @@ function page_header($page_title = '', $display_online_list = true) '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&id=" . $user->theme['style_id'], + '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&id=" . $user->theme['style_id'] . '&lang=' . $user->data['user_lang'], 'T_STYLESHEET_NAME' => $user->theme['theme_name'], 'T_THEME_DATA' => (!$user->theme['theme_storedb']) ? '' : $user->theme['theme_data'], @@ -2886,7 +3296,7 @@ function page_header($page_title = '', $display_online_list = true) if ($config['send_encoding']) { - header('Content-type: text/html; charset=' . $user->lang['ENCODING']); + header('Content-type: text/html; charset=UTF-8'); } header('Cache-Control: private, no-cache="set-cookie"'); header('Expires: 0'); @@ -2898,7 +3308,7 @@ function page_header($page_title = '', $display_online_list = true) /** * Generate page footer */ -function page_footer() +function page_footer($run_cron = true) { global $db, $config, $template, $user, $auth, $cache, $messenger, $starttime, $phpbb_root_path, $phpEx; @@ -2936,11 +3346,11 @@ function page_footer() $template->assign_vars(array( 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '', - 'U_ACP' => ($auth->acl_get('a_') && $user->data['is_registered']) ? "{$phpbb_root_path}adm/index.$phpEx?sid=" . $user->session_id : '') + 'U_ACP' => ($auth->acl_get('a_') && $user->data['is_registered']) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", '', true, $user->session_id) : '') ); // Call cron-type script - if (!defined('IN_CRON')) + if (!defined('IN_CRON') && $run_cron) { $cron_type = ''; @@ -2975,7 +3385,7 @@ function page_footer() if ($cron_type) { - $template->assign_var('RUN_CRON_TASK', '<img src="' . $phpbb_root_path . 'cron.' . $phpEx . '?cron_type=' . $cron_type . '" width="1" height="1" />'); + $template->assign_var('RUN_CRON_TASK', '<img src="' . $phpbb_root_path . 'cron.' . $phpEx . '?cron_type=' . $cron_type . '" width="1" height="1" alt="cron" />'); } } @@ -3001,10 +3411,14 @@ function garbage_collection() } // Close our DB connection. - $db->sql_close(); + if (!empty($db)) + { + $db->sql_close(); + } } /** +* @package phpBB3 */ class bitfield { diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 307044b9a0..c85802dafb 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -207,7 +207,7 @@ function group_select_options($group_id, $exclude_ids = false) global $db, $user, $config; $exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE ' . $db->sql_in_set('group_id', array_map('intval', $exclude_ids), true) : ''; - $sql_and = (!$config['coppa_enable']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : ''; + $sql_and = (!$config['coppa_enable']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name <> 'REGISTERED_COPPA'" : ''; $sql = 'SELECT group_id, group_name, group_type FROM ' . GROUPS_TABLE . " @@ -245,6 +245,7 @@ function get_forum_list($acl_list = 'f_list', $id_only = true, $postable_only = ORDER BY left_id ASC'; $result = $db->sql_query($sql, $expire_time); + $forum_rows = array(); while ($row = $db->sql_fetchrow($result)) { $forum_rows[] = $row; @@ -346,7 +347,7 @@ function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png') $matches[$dir][] = $fname; } } - else if ($fname{0} != '.' && is_dir("$rootdir$dir$fname")) + else if ($fname[0] != '.' && is_dir("$rootdir$dir$fname")) { $matches += filelist($rootdir, "$dir$fname", $type); } @@ -511,7 +512,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true) $forum_ids[] = $row['forum_id']; $topic_ids[] = $row['topic_id']; } - $db->sql_freeresult(); + $db->sql_freeresult($result); $return['topics'] = sizeof($topic_ids); @@ -628,7 +629,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = trigger_error('NO_SUCH_SEARCH_MODULE'); } - require("{$phpbb_root_path}includes/search/$search_type.$phpEx"); + include_once("{$phpbb_root_path}includes/search/$search_type.$phpEx"); $error = false; $search = new $search_type($error); @@ -879,7 +880,7 @@ function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = true) { $where = (is_array($forum_id)) ? 'AND ' . $db->sql_in_set('t.forum_id', array_map('intval', $forum_id)) : (($forum_id) ? 'AND t.forum_id = ' . (int) $forum_id : ''); - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysql4': case 'mysqli': @@ -970,24 +971,7 @@ function update_posted_info(&$topic_ids) } unset($posted); - if (sizeof($sql_ary)) - { - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); - break; - - default: - foreach ($sql_ary as $ary) - { - $db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; - } - } + $db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary); } /** @@ -1036,7 +1020,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $where_ids = ($where_ids) ? array((int) $where_ids) : array(); } - if ($mode == 'forum' || $mode == 'topic') + if ($mode == 'forum' || $mode == 'topic' || $mode == 'topic_approved') { if (!$where_type) { @@ -1046,7 +1030,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, else if ($where_type == 'range') { // Only check a range of topics/forums. For instance: 'topic_id BETWEEN 1 AND 60' - $where_sql = 'WHERE (' . $mode{0} . ".$where_ids)"; + $where_sql = 'WHERE (' . $mode[0] . ".$where_ids)"; $where_sql_and = $where_sql . "\n\tAND"; } else @@ -1062,7 +1046,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, // Limit the topics/forums we are syncing, use specific topic/forum IDs. // $where_type contains the field for the where clause (forum_id, topic_id) - $where_sql = 'WHERE ' . $db->sql_in_set($mode{0} . '.' . $where_type, $where_ids); + $where_sql = 'WHERE ' . $db->sql_in_set($mode[0] . '.' . $where_type, $where_ids); $where_sql_and = $where_sql . "\n\tAND"; } } @@ -1074,14 +1058,14 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, } // $where_type contains the field for the where clause (forum_id, topic_id) - $where_sql = 'WHERE ' . $db->sql_in_set($mode{0} . '.' . $where_type, $where_ids); + $where_sql = 'WHERE ' . $db->sql_in_set($mode[0] . '.' . $where_type, $where_ids); $where_sql_and = $where_sql . "\n\tAND"; } switch ($mode) { case 'topic_moved': - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysql4': case 'mysqli': @@ -1120,7 +1104,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, break; case 'topic_approved': - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysql4': case 'mysqli': @@ -1129,7 +1113,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $where_sql_and t.topic_first_post_id = p.post_id"; $db->sql_query($sql); break; - + default: $sql = 'SELECT t.topic_id, p.post_approved FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p @@ -1142,7 +1126,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, { $topic_ids[] = $row['topic_id']; } - $db->sql_freeresult(); + $db->sql_freeresult($result); if (!sizeof($topic_ids)) { @@ -1375,9 +1359,11 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $forum_data[$forum_id]['topics'] = 0; $forum_data[$forum_id]['topics_real'] = 0; $forum_data[$forum_id]['last_post_id'] = 0; + $forum_data[$forum_id]['last_post_subject'] = ''; $forum_data[$forum_id]['last_post_time'] = 0; $forum_data[$forum_id]['last_poster_id'] = 0; $forum_data[$forum_id]['last_poster_name'] = ''; + $forum_data[$forum_id]['last_poster_colour'] = ''; } $db->sql_freeresult($result); @@ -1386,6 +1372,8 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, break; } + $forum_ids = array_values($forum_ids); + // 2: Get topic counts for each forum $sql = 'SELECT forum_id, topic_approved, COUNT(topic_id) AS forum_topics FROM ' . TOPICS_TABLE . ' @@ -1406,16 +1394,27 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $db->sql_freeresult($result); // 3: Get post count and last_post_id for each forum - $sql = 'SELECT forum_id, COUNT(post_id) AS forum_posts, MAX(post_id) AS last_post_id - FROM ' . POSTS_TABLE . ' - WHERE ' . $db->sql_in_set('forum_id', $forum_ids) . ' - AND post_approved = 1 - GROUP BY forum_id'; + if (sizeof($forum_ids) == 1) + { + $sql = 'SELECT COUNT(post_id) AS forum_posts, MAX(post_id) AS last_post_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids) . ' + AND post_approved = 1'; + } + else + { + $sql = 'SELECT forum_id, COUNT(post_id) AS forum_posts, MAX(post_id) AS last_post_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids) . ' + AND post_approved = 1 + GROUP BY forum_id'; + } + $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - $forum_id = (int) $row['forum_id']; + $forum_id = (sizeof($forum_ids) == 1) ? (int) $forum_ids[0] : (int) $row['forum_id']; $forum_data[$forum_id]['posts'] = (int) $row['forum_posts']; $forum_data[$forum_id]['last_post_id'] = (int) $row['last_post_id']; @@ -1427,7 +1426,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, // 4: Retrieve last_post infos if (sizeof($post_ids)) { - $sql = 'SELECT p.post_id, p.poster_id, p.post_time, p.post_username, u.username + $sql = 'SELECT p.post_id, p.poster_id, p.post_subject, p.post_time, p.post_username, u.username, u.user_colour FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . ' AND p.poster_id = u.user_id'; @@ -1445,17 +1444,21 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, { if (isset($post_info[$data['last_post_id']])) { + $forum_data[$forum_id]['last_post_subject'] = $post_info[$data['last_post_id']]['post_subject']; $forum_data[$forum_id]['last_post_time'] = $post_info[$data['last_post_id']]['post_time']; $forum_data[$forum_id]['last_poster_id'] = $post_info[$data['last_post_id']]['poster_id']; $forum_data[$forum_id]['last_poster_name'] = ($post_info[$data['last_post_id']]['poster_id'] != ANONYMOUS) ? $post_info[$data['last_post_id']]['username'] : $post_info[$data['last_post_id']]['post_username']; + $forum_data[$forum_id]['last_poster_colour'] = $post_info[$data['last_post_id']]['user_colour']; } else { // For some reason we did not find the post in the db $forum_data[$forum_id]['last_post_id'] = 0; + $forum_data[$forum_id]['last_post_subject'] = ''; $forum_data[$forum_id]['last_post_time'] = 0; $forum_data[$forum_id]['last_poster_id'] = 0; $forum_data[$forum_id]['last_poster_name'] = ''; + $forum_data[$forum_id]['last_poster_colour'] = ''; } } } @@ -1463,7 +1466,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, } // 5: Now do that thing - $fieldnames = array('posts', 'topics', 'topics_real', 'last_post_id', 'last_post_time', 'last_poster_id', 'last_poster_name'); + $fieldnames = array('posts', 'topics', 'topics_real', 'last_post_id', 'last_post_subject', 'last_post_time', 'last_poster_id', 'last_poster_name', 'last_poster_colour'); foreach ($forum_data as $forum_id => $row) { @@ -1473,7 +1476,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, { if ($row['forum_' . $fieldname] != $row[$fieldname]) { - if (preg_match('#name$#', $fieldname)) + if (preg_match('#(name|colour|subject)$#', $fieldname)) { $sql_ary['forum_' . $fieldname] = (string) $row[$fieldname]; } @@ -1497,7 +1500,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, case 'topic': $topic_data = $post_ids = $approved_unapproved_ids = $resync_forums = $delete_topics = $delete_posts = $moved_topics = array(); - $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_last_post_id, t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_post_time + $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"; $result = $db->sql_query($sql); @@ -1513,6 +1516,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $topic_id = (int) $row['topic_id']; $topic_data[$topic_id] = $row; $topic_data[$topic_id]['replies_real'] = -1; + $topic_data[$topic_id]['replies'] = 0; $topic_data[$topic_id]['first_post_id'] = 0; $topic_data[$topic_id]['last_post_id'] = 0; unset($topic_data[$topic_id]['topic_id']); @@ -1532,19 +1536,8 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, // NOTE: 't.post_approved' in the GROUP BY is causing a major slowdown. $sql = 'SELECT t.topic_id, t.post_approved, COUNT(t.post_id) AS total_posts, MIN(t.post_id) AS first_post_id, MAX(t.post_id) AS last_post_id FROM ' . POSTS_TABLE . " t - $where_sql"; - - switch (SQL_LAYER) - { - case 'mssql': - case 'mssql_odbc': - $sql .= ' GROUP BY t.topic_id, t.post_approved'; - break; - - default: - $sql .= ' GROUP BY t.topic_id'; - break; - } + $where_sql + GROUP BY t.topic_id, t.post_approved"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) @@ -1638,7 +1631,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, unset($delete_topics); } - $sql = 'SELECT p.post_id, p.topic_id, p.post_approved, p.poster_id, p.post_username, p.post_time, u.username + $sql = 'SELECT p.post_id, p.topic_id, p.post_approved, p.poster_id, p.post_subject, p.post_username, p.post_time, u.username, u.user_colour FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . ' AND u.user_id = p.poster_id'; @@ -1658,13 +1651,16 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $topic_data[$topic_id]['time'] = $row['post_time']; $topic_data[$topic_id]['poster'] = $row['poster_id']; $topic_data[$topic_id]['first_poster_name'] = ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']; + $topic_data[$topic_id]['first_poster_colour'] = $row['user_colour']; } if ($row['post_id'] == $topic_data[$topic_id]['last_post_id']) { $topic_data[$topic_id]['last_poster_id'] = $row['poster_id']; + $topic_data[$topic_id]['last_post_subject'] = $row['post_subject']; $topic_data[$topic_id]['last_post_time'] = $row['post_time']; $topic_data[$topic_id]['last_poster_name'] = ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']; + $topic_data[$topic_id]['last_poster_colour'] = $row['user_colour']; } } $db->sql_freeresult($result); @@ -1680,7 +1676,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, unset($approved_unapproved_ids); // These are fields that will be synchronised - $fieldnames = array('time', 'replies', 'replies_real', 'poster', 'first_post_id', 'first_poster_name', 'last_post_id', 'last_post_time', 'last_poster_id', 'last_poster_name'); + $fieldnames = array('time', 'replies', 'replies_real', 'poster', 'first_post_id', 'first_poster_name', 'first_poster_colour', 'last_post_id', 'last_post_subject', 'last_post_time', 'last_poster_id', 'last_poster_name', 'last_poster_colour'); if ($sync_extra) { @@ -1723,7 +1719,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, foreach ($fieldnames as $fieldname) { - if ($row['topic_' . $fieldname] != $row[$fieldname]) + if (isset($row[$fieldname]) && isset($row['topic_' . $fieldname]) && $row['topic_' . $fieldname] != $row[$fieldname]) { $sql_ary['topic_' . $fieldname] = $row[$fieldname]; } @@ -1746,7 +1742,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, // batch processing. if ($resync_parents && sizeof($resync_forums) && $where_type != 'range') { - sync('forum', 'forum_id', $resync_forums, true); + sync('forum', 'forum_id', array_values($resync_forums), true); } break; } @@ -1773,12 +1769,12 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync $sql_and = ''; - if (!($prune_flags & 4)) + if (!($prune_flags & FORUM_FLAG_PRUNE_ANNOUNCE)) { $sql_and .= ' AND topic_type <> ' . POST_ANNOUNCE; } - if (!($prune_flags & 8)) + if (!($prune_flags & FORUM_FLAG_PRUNE_STICKY)) { $sql_and .= ' AND topic_type <> ' . POST_STICKY; } @@ -1807,7 +1803,7 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync } $db->sql_freeresult($result); - if ($prune_flags & 2) + if ($prune_flags & FORUM_FLAG_PRUNE_POLL) { $sql = 'SELECT topic_id FROM ' . TOPICS_TABLE . ' @@ -1943,7 +1939,7 @@ function cache_moderators() $cache->destroy('sql', MODERATOR_CACHE_TABLE); // Clear table - $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . MODERATOR_CACHE_TABLE); + $db->sql_query((($db->sql_layer != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . MODERATOR_CACHE_TABLE); // We add moderators who have forum moderator permissions without an explicit ACL_NEVER setting $hold_ary = $ug_id_ary = $sql_ary = array(); @@ -1981,7 +1977,7 @@ function cache_moderators() AND ' . $db->sql_in_set('ug.user_id', $ug_id_ary) . " AND ug.user_pending = 0 AND o.auth_option LIKE 'm\_%'" . - ((SQL_LAYER == 'mssql' || SQL_LAYER == 'mssql_odbc') ? " ESCAPE '\\'" : ''), + (($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : ''), )); $result = $db->sql_query($sql); @@ -2010,6 +2006,12 @@ function cache_moderators() foreach ($hold_ary as $user_id => $forum_id_ary) { + // Do not continue if user does not exist + if (!isset($usernames_ary[$user_id])) + { + continue; + } + foreach ($forum_id_ary as $forum_id => $auth_ary) { $sql_ary[] = array( @@ -2051,6 +2053,12 @@ function cache_moderators() foreach ($hold_ary as $group_id => $forum_id_ary) { + // If there is no group, we do not assign it... + if (!isset($groupnames_ary[$group_id])) + { + continue; + } + foreach ($forum_id_ary as $forum_id => $auth_ary) { $flag = false; @@ -2080,24 +2088,7 @@ function cache_moderators() } } - if (sizeof($sql_ary)) - { - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query('INSERT INTO ' . MODERATOR_CACHE_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); - break; - - default: - foreach ($sql_ary as $ary) - { - $db->sql_query('INSERT INTO ' . MODERATOR_CACHE_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; - } - } + $db->sql_multi_insert(MODERATOR_CACHE_TABLE, $sql_ary); } /** @@ -2296,6 +2287,82 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id } /** +* Update foes - remove moderators and administrators from foe lists... +*/ +function update_foes() +{ + global $db, $auth; + + $perms = array(); + foreach ($auth->acl_get_list(false, array('a_', 'm_'), false) as $forum_id => $forum_ary) + { + foreach ($forum_ary as $auth_option => $user_ary) + { + $perms = array_merge($perms, $user_ary); + } + } + + if (sizeof($perms)) + { + $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' + WHERE ' . $db->sql_in_set('zebra_id', array_unique($perms)) . ' + AND foe = 1'; + $db->sql_query($sql); + } + unset($perms); +} + +/** +* Lists inactive users +*/ +function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $limit_days = 0, $sort_by = 'user_inactive_time DESC') +{ + global $db, $user; + + $sql = 'SELECT user_id, username, user_regdate, user_lastvisit, user_inactive_time, user_inactive_reason + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_INACTIVE . + (($limit_days) ? " AND user_inactive_time >= $limit_days" : '') . " + ORDER BY $sort_by"; + $result = $db->sql_query_limit($sql, $limit, $offset); + + while ($row = $db->sql_fetchrow($result)) + { + $row['inactive_reason'] = $user->lang['INACTIVE_REASON_UNKNOWN']; + switch ($row['user_inactive_reason']) + { + case INACTIVE_REGISTER: + $row['inactive_reason'] = $user->lang['INACTIVE_REASON_REGISTER']; + break; + + case INACTIVE_PROFILE: + $row['inactive_reason'] = $user->lang['INACTIVE_REASON_PROFILE']; + break; + + case INACTIVE_MANUAL: + $row['inactive_reason'] = $user->lang['INACTIVE_REASON_MANUAL']; + break; + + case INACTIVE_REMIND: + $row['inactive_reason'] = $user->lang['INACTIVE_REASON_REMIND']; + break; + } + + $users[] = $row; + } + + $sql = 'SELECT COUNT(user_id) AS user_count + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_INACTIVE . + (($limit_days) ? " AND user_inactive_time >= $limit_days" : ''); + $result = $db->sql_query($sql); + $user_count = (int) $db->sql_fetchfield('user_count'); + $db->sql_freeresult($result); + + return; +} + +/** * Lists warned users */ function view_warned_users(&$users, &$user_count, $limit = 0, $offset = 0, $limit_days = 0, $sort_by = 'user_warnings DESC') @@ -2333,7 +2400,7 @@ function get_database_size() $database_size = false; // This code is heavily influenced by a similar routine in phpMyAdmin 2.2.0 - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysql': case 'mysql4': @@ -2363,7 +2430,7 @@ function get_database_size() { if ($table_prefix != '') { - if (strstr($row['Name'], $table_prefix)) + if (strpos($row['Name'], $table_prefix) !== false) { $database_size += $row['Data_length'] + $row['Index_length']; } @@ -2465,7 +2532,7 @@ function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port } else if (strpos($line, '404 Not Found') !== false) { - $errstr = $user->lang['FILE_NOT_FOUND']; + $errstr = $user->lang['FILE_NOT_FOUND'] . ': ' . $filename; return false; } } @@ -2509,7 +2576,7 @@ function tidy_warnings() while ($row = $db->sql_fetchrow($result)) { $warning_list[] = $row['warning_id']; - $user_list[$row['user_id']] = isset($user_list[$row['user_id']]) ? $user_list[$row['user_id']]++ : 0; + $user_list[$row['user_id']] = isset($user_list[$row['user_id']]) ? $user_list[$row['user_id']]++ : 1; } $db->sql_freeresult($result); @@ -2541,9 +2608,46 @@ function tidy_database() { global $db; + set_config('database_last_gc', time(), true); +} + +/** +* Add permission language - this will make sure custom files will be included +*/ +function add_permission_language() +{ + global $user, $phpEx; + // First of all, our own file. + $user->add_lang('acp/permissions_phpbb'); - set_config('database_last_gc', time(), true); + $files_to_add = array(); + + // Now search in acp and mods folder for permissions_ files. + foreach (array('acp/', 'mods/') as $path) + { + $dh = opendir($user->lang_path . $path); + + if ($dh !== false) + { + while (($file = readdir($dh)) !== false) + { + if (strpos($file, 'permissions_') === 0 && strpos($file, 'permissions_phpbb') === false && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx) + { + $files_to_add[] = $path . substr($file, 0, -(strlen($phpEx) + 1)); + } + } + closedir($dh); + } + } + + if (!sizeof($files_to_add)) + { + return false; + } + + $user->add_lang($files_to_add); + return true; } ?>
\ No newline at end of file diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index 09ad1f4e8f..93a3547e21 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -322,8 +322,7 @@ class compress_zip extends compress { $name = str_replace('\\', '/', $name); - $dtime = dechex($this->unix_to_dos_time($stat[9])); - $hexdtime = pack('H8', $dtime[6] . $dtime[7] . $dtime[4] . $dtime[5] . $dtime[2] . $dtime[3] . $dtime[0] . $dtime[1]); + $hexdtime = pack('V', $this->unix_to_dos_time($stat[9])); if ($is_dir) { @@ -479,17 +478,17 @@ class compress_tar extends compress // Run through the file and grab directory entries while ($buffer = $fzread($this->fp, 512)) { - $tmp = unpack("A6magic", substr($buffer, 257, 6)); + $tmp = unpack('A6magic', substr($buffer, 257, 6)); if (trim($tmp['magic']) == 'ustar') { - $tmp = unpack("A100name", $buffer); + $tmp = unpack('A100name', $buffer); $filename = trim($tmp['name']); - $tmp = unpack("Atype", substr($buffer, 156, 1)); + $tmp = unpack('Atype', substr($buffer, 156, 1)); $filetype = (int) trim($tmp['type']); - $tmp = unpack("A12size", substr($buffer, 124, 12)); + $tmp = unpack('A12size', substr($buffer, 124, 12)); $filesize = octdec((int) trim($tmp['size'])); if ($filetype == 5) @@ -509,12 +508,12 @@ class compress_tar extends compress { trigger_error("Could not create directory $folder"); } - @chmod("$str", 0777); + @chmod($str, 0777); } } } } - else if($filesize != 0 && ($filetype == 0 || $filetype == "\0")) + else if ($filesize != 0 && ($filetype == 0 || $filetype == "\0")) { // Write out the files if (!($fp = fopen("$dst$filename", 'wb'))) @@ -524,7 +523,7 @@ class compress_tar extends compress @chmod("$dst$filename", 0777); // Grab the file contents - fwrite($fp, $fzread($this->fp, $filesize + 512 - $filesize % 512), $filesize); + fwrite($fp, $fzread($this->fp, ($filesize + 511) &~ 511), $filesize); fclose($fp); } } @@ -543,7 +542,7 @@ class compress_tar extends compress $fzwrite = ($this->isbz && function_exists('bzwrite')) ? 'bzwrite' : (($this->isgz && @extension_loaded('zlib')) ? 'gzwrite' : 'fwrite'); // Symbolizes that there are no more files - $fzwrite($this->fp, pack("a512", "")); + $fzwrite($this->fp, str_repeat("\0", 512)); } $fzclose($this->fp); @@ -561,37 +560,37 @@ class compress_tar extends compress // This is the header data, it contains all the info we know about the file or folder that we are about to archive $header = ''; - $header .= pack("a100", $name); // file name - $header .= pack("a8", sprintf("%07o", $stat[2])); // file mode - $header .= pack("a8", sprintf("%07o", $stat[4])); // owner id - $header .= pack("a8", sprintf("%07o", $stat[5])); // group id - $header .= pack("a12", sprintf("%011o", $stat[7])); // file size - $header .= pack("a12", sprintf("%011o", $stat[9])); // last mod time + $header .= pack('a100', $name); // file name + $header .= pack('a8', sprintf("%07o", $stat[2])); // file mode + $header .= pack('a8', sprintf("%07o", $stat[4])); // owner id + $header .= pack('a8', sprintf("%07o", $stat[5])); // group id + $header .= pack('a12', sprintf("%011o", $stat[7])); // file size + $header .= pack('a12', sprintf("%011o", $stat[9])); // last mod time // Checksum $checksum = 0; for ($i = 0; $i < 148; $i++) { - $checksum += ord(substr($header, $i, 1)); + $checksum += ord($header[$i]); } // We precompute the rest of the hash, this saves us time in the loop and allows us to insert our hash without resorting to string functions $checksum += 2415 + (($is_dir) ? 53 : 0); - $header .= pack("a8", sprintf("%07o", $checksum)); // checksum - $header .= pack("a1", $typeflag); // link indicator - $header .= pack("a100", ''); // name of linked file - $header .= pack("a6", 'ustar'); // ustar indicator - $header .= pack("a2", '00'); // ustar version - $header .= pack("a32", 'Unknown'); // owner name - $header .= pack("a32", 'Unknown'); // group name - $header .= pack("a8", ''); // device major number - $header .= pack("a8", ''); // device minor number - $header .= pack("a155", ''); // filename prefix - $header .= pack("a12", ''); // end + $header .= pack('a8', sprintf("%07o", $checksum)); // checksum + $header .= pack('a1', $typeflag); // link indicator + $header .= pack('a100', ''); // name of linked file + $header .= pack('a6', 'ustar'); // ustar indicator + $header .= pack('a2', '00'); // ustar version + $header .= pack('a32', 'Unknown'); // owner name + $header .= pack('a32', 'Unknown'); // group name + $header .= pack('a8', ''); // device major number + $header .= pack('a8', ''); // device minor number + $header .= pack('a155', ''); // filename prefix + $header .= pack('a12', ''); // end // This writes the entire file in one shot. Header, followed by data and then null padded to a multiple of 512 - $fzwrite($this->fp, $header . (($stat[7] !== 0 && !$is_dir) ? $data . (($stat[7] % 512 > 0) ? str_repeat("\0", 512 - $stat[7] % 512) : '') : '')); + $fzwrite($this->fp, $header . (($stat[7] !== 0 && !$is_dir) ? $data . str_repeat("\0", (($stat[7] + 511) &~ 511) - $stat[7]) : '')); unset($data); } diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index f6b73afa0e..cb8f963528 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -44,7 +44,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod } // Display list of active topics for this category? - $show_active = (isset($root_data['forum_flags']) && $root_data['forum_flags'] & 16) ? true : false; + $show_active = (isset($root_data['forum_flags']) && ($root_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false; $sql_from = FORUMS_TABLE . ' f '; $lastread_select = $sql_lastread = ''; @@ -126,7 +126,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod } // Display active topics from this forum? - if ($show_active && $row['forum_type'] == FORUM_POST && $auth->acl_get('f_read', $forum_id) && ($row['forum_flags'] & 16)) + if ($show_active && $row['forum_type'] == FORUM_POST && $auth->acl_get('f_read', $forum_id) && ($row['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) { if (!isset($active_forum_ary['forum_topics'])) { @@ -180,9 +180,11 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod if ($row['forum_last_post_time'] > $forum_rows[$parent_id]['forum_last_post_time']) { $forum_rows[$parent_id]['forum_last_post_id'] = $row['forum_last_post_id']; + $forum_rows[$parent_id]['forum_last_post_subject'] = $row['forum_last_post_subject']; $forum_rows[$parent_id]['forum_last_post_time'] = $row['forum_last_post_time']; $forum_rows[$parent_id]['forum_last_poster_id'] = $row['forum_last_poster_id']; $forum_rows[$parent_id]['forum_last_poster_name'] = $row['forum_last_poster_name']; + $forum_rows[$parent_id]['forum_last_poster_colour'] = $row['forum_last_poster_colour']; $forum_rows[$parent_id]['forum_id_last_post'] = $forum_id; } else @@ -235,8 +237,10 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'FORUM_ID' => $row['forum_id'], 'FORUM_NAME' => $row['forum_name'], 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), - 'FORUM_FOLDER_IMG' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang['FORUM_CAT'] . '" />' : '', - 'FORUM_FOLDER_IMG_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', + 'FORUM_FOLDER_IMG' => '', + 'FORUM_FOLDER_IMG_SRC' => '', + 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang['FORUM_CAT'] . '" />' : '', + 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id'])) ); @@ -303,16 +307,18 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod // Create last post link information, if appropriate if ($row['forum_last_post_id']) { + $last_post_subject = $row['forum_last_post_subject']; $last_post_time = $user->format_date($row['forum_last_post_time']); $last_poster = ($row['forum_last_poster_name'] != '') ? $row['forum_last_poster_name'] : $user->lang['GUEST']; + $last_poster_colour = ($row['forum_last_poster_colour']) ? '#' . $row['forum_last_poster_colour'] : ''; $last_poster_url = ($row['forum_last_poster_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['forum_last_poster_id']); $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id']; } else { - $last_post_time = $last_poster = $last_poster_url = $last_post_url = ''; + $last_post_subject = $last_post_time = $last_poster = $last_poster_colour = $last_poster_url = $last_post_url = ''; } // Output moderator listing ... if applicable @@ -324,7 +330,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod } $l_post_click_count = ($row['forum_type'] == FORUM_LINK) ? 'CLICKS' : 'POSTS'; - $post_click_count = ($row['forum_type'] != FORUM_LINK || $row['forum_flags'] & 1) ? $row['forum_posts'] : ''; + $post_click_count = ($row['forum_type'] != FORUM_LINK || $row['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? $row['forum_posts'] : ''; $template->assign_block_vars('forumrow', array( 'S_IS_CAT' => false, @@ -337,18 +343,22 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), 'TOPICS' => $row['forum_topics'], $l_post_click_count => $post_click_count, - 'FORUM_FOLDER_IMG' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : $user->img($folder_image, $folder_alt), - 'FORUM_FOLDER_IMG_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : $user->img($folder_image, $folder_alt, false, '', 'src'), + 'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt), + 'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'), + 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '', + 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'SUBFORUMS' => $subforums_list, + 'LAST_POST_SUBJECT' => censor_text($last_post_subject), 'LAST_POST_TIME' => $last_post_time, 'LAST_POSTER' => $last_poster, + 'LAST_POSTER_COLOUR' => $last_poster_colour, 'MODERATORS' => $moderators_list, 'L_SUBFORUM_STR' => $l_subforums, 'L_FORUM_FOLDER_ALT' => $folder_alt, 'L_MODERATOR_STR' => $l_moderator, - 'U_VIEWFORUM' => ($row['forum_type'] != FORUM_LINK || $row['forum_flags'] & 1) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : $row['forum_link'], + 'U_VIEWFORUM' => ($row['forum_type'] != FORUM_LINK || ($row['forum_flags'] & FORUM_FLAG_LINK_TRACK)) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : $row['forum_link'], 'U_LAST_POSTER' => $last_poster_url, 'U_LAST_POST' => $last_post_url) ); @@ -492,20 +502,6 @@ function get_forum_parents(&$forum_data) } /** -* Get topic author -*/ -function topic_topic_author(&$topic_row) -{ - global $phpEx, $phpbb_root_path, $user; - - $topic_author = ($topic_row['topic_poster'] != ANONYMOUS) ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $topic_row['topic_poster']) . '">' : ''; - $topic_author .= ($topic_row['topic_poster'] != ANONYMOUS) ? $topic_row['topic_first_poster_name'] : (($topic_row['topic_first_poster_name'] != '') ? $topic_row['topic_first_poster_name'] : $user->lang['GUEST']); - $topic_author .= ($topic_row['topic_poster'] != ANONYMOUS) ? '</a>' : ''; - - return $topic_author; -} - -/** * Generate topic pagination */ function topic_generate_pagination($replies, $url) @@ -660,7 +656,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold $folder = 'topic_read'; $folder_new = 'topic_unread'; - if ($config['hot_threshold'] && $replies >= $config['hot_threshold']) + if ($config['hot_threshold'] && $replies >= $config['hot_threshold'] && $topic_row['topic_status'] != ITEM_LOCKED) { $folder .= '_hot'; $folder_new .= '_hot'; @@ -706,14 +702,59 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ 'attachment_tpl' => 'attachment.html') ); + if (!sizeof($attachment_data)) + { + return array(); + } + if (empty($extensions) || !is_array($extensions)) { - $extensions = array(); - $cache->obtain_attach_extensions($extensions); + $extensions = $cache->obtain_attach_extensions(); + } + + // Look for missing attachment informations... + $attach_ids = array(); + foreach ($attachment_data as $pos => $attachment) + { + // If is_orphan is set, we need to retrieve the attachments again... + if (!isset($attachment['extension']) && !isset($attachment['physical_filename'])) + { + $attach_ids[(int) $attachment['attach_id']] = $pos; + } + } + + if (sizeof($attach_ids)) + { + global $db; + + $attachment_data = array(); + + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', array_keys($attach_ids)); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (!isset($attach_ids[$row['attach_id']])) + { + continue; + } + + $attachment_data[$attach_ids[$row['attach_id']]] = $row; + } + $db->sql_freeresult($result); + + ksort($attachment_data); } foreach ($attachment_data as $attachment) { + if (!sizeof($attachment)) + { + continue; + } + // We need to reset/empty the _file block var, because this function might be called more than once $template->destroy_block_vars('_file'); @@ -795,6 +836,8 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ $download_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . $forum_id) : $filename; + $download_link_full = (!$force_physical && $attachment['attach_id']) ? generate_board_url() . append_sid("/download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . $forum_id) : generate_board_url() . $filename; + switch ($display_cat) { // Images @@ -823,53 +866,51 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ case ATTACHMENT_CATEGORY_WM: $l_downloaded_viewed = $user->lang['VIEWED']; - // The download link is slightly different, because somehow phpBB is not able to get the correct results if called - // within the wmp object (cookies are not present). - // $download_link = (!$force_physical && $attachment['attach_id']) ? generate_board_url() . append_sid("/download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . $forum_id, false, $user->session_id) : $filename; - // Giving the filename directly because within the wm object all variables are in local context making it impossible // to validate against a valid session (all params can differ) $download_link = $filename; $block_array += array( + 'U_FORUM' => generate_board_url(), 'S_WM_FILE' => true, ); - // Viewed/Heared File ... update the download count (download.php is not called here) + // Viewed/Heared File ... update the download count $update_count[] = $attachment['attach_id']; break; // Real Media Streams case ATTACHMENT_CATEGORY_RM: + case ATTACHMENT_CATEGORY_QUICKTIME: $l_downloaded_viewed = $user->lang['VIEWED']; $block_array += array( - 'S_RM_FILE' => true, - 'U_FORUM' => generate_board_url(), - 'ATTACH_ID' => $attachment['attach_id'], + 'S_RM_FILE' => ($display_cat == ATTACHMENT_CATEGORY_RM) ? true : false, + 'S_QUICKTIME_FILE' => ($display_cat == ATTACHMENT_CATEGORY_QUICKTIME) ? true : false, + 'U_FORUM' => generate_board_url(), + 'ATTACH_ID' => $attachment['attach_id'], ); - // Viewed/Heared File ... update the download count (download.php is not called here) + // Viewed/Heared File ... update the download count $update_count[] = $attachment['attach_id']; break; -/* // Macromedia Flash Files - case SWF_CAT: - list($width, $height) = swf_getdimension($filename); + // Macromedia Flash Files + case ATTACHMENT_CATEGORY_FLASH: + list($width, $height) = @getimagesize($filename); $l_downloaded_viewed = $user->lang['VIEWED']; - $download_link = $filename; $block_array += array( - 'S_SWF_FILE' => true, + 'S_FLASH_FILE' => true, 'WIDTH' => $width, 'HEIGHT' => $height, ); - // Viewed/Heared File ... update the download count (download.php is not called here) + // Viewed/Heared File ... update the download count $update_count[] = $attachment['attach_id']; break; -*/ + default: $l_downloaded_viewed = $user->lang['DOWNLOADED']; @@ -933,7 +974,7 @@ function display_custom_bbcodes() 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'", 'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2), 'BBCODE_TAG' => $row['bbcode_tag'], - 'BBCODE_HELPLINE' => $row['bbcode_helpline']) + 'BBCODE_HELPLINE' => str_replace(array('&', '"', ''', '<', '>'), array('\&', '\"', '\\\'', '<', '>'), $row['bbcode_helpline'])) ); $i++; @@ -980,24 +1021,17 @@ function display_user_activity(&$userdata) global $auth, $template, $db, $user; global $phpbb_root_path, $phpEx; - // Init new auth class if user is different - if ($user->data['user_id'] != $userdata['user_id']) - { - $auth2 = new auth(); - $auth2->acl($userdata); - - $post_count_ary = $auth2->acl_getf('!f_postcount'); - } - else + // Do not display user activity for users having more than 5000 posts... + if ($userdata['user_posts'] > 5000) { - $post_count_ary = $auth->acl_getf('!f_postcount'); + return; } - $forum_read_ary = $auth->acl_getf('!f_read'); - $forum_ary = array(); // Do not include those forums the user is not having read access to... + $forum_read_ary = $auth->acl_getf('!f_read'); + foreach ($forum_read_ary as $forum_id => $not_allowed) { if ($not_allowed['f_read']) @@ -1006,44 +1040,18 @@ function display_user_activity(&$userdata) } } - // Now do not include those forums where the posts do not count... - foreach ($post_count_ary as $forum_id => $not_counted) - { - if ($not_counted['f_postcount']) - { - $forum_ary[] = (int) $forum_id; - } - } - $forum_ary = array_unique($forum_ary); - $post_count_sql = (sizeof($forum_ary)) ? 'AND ' . $db->sql_in_set('f.forum_id', $forum_ary, true) : ''; - - // Firebird does not support ORDER BY on aliased columns - // MySQL does not support ORDER BY on functions - switch (SQL_LAYER) - { - case 'firebird': - $sql = 'SELECT f.forum_id, COUNT(p.post_id) AS num_posts - FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f - WHERE p.poster_id = ' . $userdata['user_id'] . " - AND f.forum_id = p.forum_id - $post_count_sql - GROUP BY f.forum_id - ORDER BY COUNT(p.post_id) DESC"; - break; - - default: - $sql = 'SELECT f.forum_id, COUNT(p.post_id) AS num_posts - FROM ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f - WHERE p.poster_id = ' . $userdata['user_id'] . " - AND f.forum_id = p.forum_id - $post_count_sql - GROUP BY f.forum_id - ORDER BY num_posts DESC"; - break; - } - - $result = $db->sql_query_limit($sql, 1); + $forum_sql = (sizeof($forum_ary)) ? 'AND ' . $db->sql_in_set('forum_id', $forum_ary, true) : ''; + + // Obtain active forum + $sql = 'SELECT forum_id, COUNT(post_id) AS num_posts + FROM ' . POSTS_TABLE . ' + WHERE poster_id = ' . $userdata['user_id'] . " + AND post_postcount = 1 + $forum_sql + GROUP BY forum_id + ORDER BY num_posts DESC"; + $result = $db->sql_query_limit($sql, 1, 0, 3600); $active_f_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -1057,34 +1065,15 @@ function display_user_activity(&$userdata) $db->sql_freeresult($result); } - // Firebird does not support ORDER BY on aliased columns - // MySQL does not support ORDER BY on functions - switch (SQL_LAYER) - { - case 'firebird': - $sql = 'SELECT t.topic_id, COUNT(p.post_id) AS num_posts - FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f - WHERE p.poster_id = ' . $userdata['user_id'] . " - AND t.topic_id = p.topic_id - AND f.forum_id = t.forum_id - $post_count_sql - GROUP BY t.topic_id - ORDER BY COUNT(p.post_id) DESC"; - break; - - default: - $sql = 'SELECT t.topic_id, COUNT(p.post_id) AS num_posts - FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f - WHERE p.poster_id = ' . $userdata['user_id'] . " - AND t.topic_id = p.topic_id - AND f.forum_id = t.forum_id - $post_count_sql - GROUP BY t.topic_id - ORDER BY num_posts DESC"; - break; - } - - $result = $db->sql_query_limit($sql, 1); + // Obtain active topic + $sql = 'SELECT topic_id, COUNT(post_id) AS num_posts + FROM ' . POSTS_TABLE . ' + WHERE poster_id = ' . $userdata['user_id'] . " + AND post_postcount = 1 + $forum_sql + GROUP BY topic_id + ORDER BY num_posts DESC"; + $result = $db->sql_query_limit($sql, 1, 0, 3600); $active_t_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -1127,7 +1116,8 @@ function display_user_activity(&$userdata) 'ACTIVE_TOPIC_POSTS' => ($active_t_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_t_count), 'ACTIVE_TOPIC_PCT' => sprintf($user->lang['POST_PCT_ACTIVE'], $active_t_pct), 'U_ACTIVE_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $active_f_id), - 'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id)) + 'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id), + 'S_SHOW_ACTIVITY' => true) ); } diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php index d98293dd0f..726985e631 100644 --- a/phpBB/includes/functions_jabber.php +++ b/phpBB/includes/functions_jabber.php @@ -3,29 +3,29 @@ * * @package phpBB3 * @version $Id$ -* @copyright (c) 2005 phpBB Group +* @copyright (c) 2006 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** * -* Class.Jabber.PHP v0.4 -* (c) 2002 Carlo "Gossip" Zottmann -* http://phpjabber.g-blog.net *** gossip@jabber.g-blog.net +* Class.Jabber.PHP v0.4.2 +* (c) 2004 Nathan "Fritzy" Fritz +* http://cjphp.netflint.net *** fritzy@netflint.net * -* The FULL documentation and examples for this software can be found at -* http://phpjabber.g-blog.net (not many doc comments in here, sorry) +* This is a bugfix version, specifically for those who can't get +* 0.4 to work on Jabberd2 servers. * -* last modified: 27.04.2003 13:01:53 CET -* -* Modified by members of the phpBB Group +* last modified: 24.03.2004 13:01:53 +* +* Modified by phpBB Development Team +* version: v0.4.3a * * @package phpBB3 */ class jabber { - var $encoding; var $server; var $port; var $username; @@ -37,13 +37,14 @@ class jabber var $delay_disconnect; var $stream_id; - var $roster; + + var $enable_logging; + var $log_array; var $iq_sleep_timer; var $last_ping_time; var $packet_queue; - var $subscription_queue; var $iq_version_name; var $iq_version_os; @@ -61,19 +62,24 @@ class jabber /** * Constructor */ - function jabber() + function jabber($server, $port, $username, $password, $resource) { - $this->port = '5222'; - $this->resource = NULL; - $this->packet_queue = $this->subscription_queue = array(); - $this->iq_sleep_timer = $this->delay_disconnect = 1; + $this->server = ($server) ? $server : 'localhost'; + $this->port = ($port) ? $port : '5222'; + $this->username = $username; + $this->password = $password; + $this->resource = ($resource) ? $resource : NULL; - $this->encoding = 'UTF-8'; + $this->enable_logging = true; + $this->log_array = array(); + + $this->packet_queue = array(); + $this->iq_sleep_timer = $this->delay_disconnect = 1; $this->returned_keep_alive = true; $this->txnid = 0; - $this->iq_version_name = "Class.Jabber.PHP -- http://phpjabber.g-blog.net -- by Carlo 'Gossip' Zottmann, gossip@jabber.g-blog.net"; + $this->iq_version_name = "Class.Jabber.PHP -- http://cjphp.netflint.net -- by Nathan 'Fritzy' Fritz, fritz@netflint.net"; $this->iq_version_version = '0.4'; $this->iq_version_os = $_SERVER['SERVER_SOFTWARE']; @@ -107,7 +113,7 @@ class jabber if ($this->connector->open_socket($this->server, $this->port)) { $this->send_packet("<?xml version='1.0' encoding='UTF-8' ?" . ">\n"); - $this->send_packet("<stream:stream to='{$this->server}' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>\n"); + $this->send_packet("<stream:stream to='{$this->server}' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>\n"); sleep(2); @@ -118,11 +124,13 @@ class jabber } else { + $this->add_to_log('ERROR: connect() #1'); return false; } } else { + $this->add_to_log('ERROR: connect() #2'); return false; } } @@ -142,55 +150,12 @@ class jabber } /** - * Cruise Control - */ - function cruise_control($seconds = -1) - { - $count = 0; - - while ($count != $seconds) - { - $this->listen(); - - do - { - $packet = $this->get_first_from_queue(); - - if ($packet) - { - $this->call_handler($packet); - } - } - while (sizeof($this->packet_queue) > 1); - - $count += 0.25; - usleep(250000); - - if ($this->last_ping_time != date('H:i')) - { - // Modified by Nathan Fritz - if ($this->returned_keep_alive == false) - { - $this->connected = false; - //EVENT: Disconnected - } - - $this->returned_keep_alive = false; - $this->keep_alive_id = 'keep_alive_' . time(); - $this->send_packet("<iq id='{$this->keep_alive_id}'/>", 'cruise_control'); - $this->last_ping_time = date('H:i'); - } - } - - return true; - } - - /** * Send authentication request */ function send_auth() { $this->auth_id = 'auth_' . md5(time() . $_SERVER['REMOTE_ADDR']); + $this->resource = ($this->resource != NULL) ? $this->resource : ('Class.Jabber.PHP ' . md5($this->auth_id)); $this->jid = "{$this->username}@{$this->server}/{$this->resource}"; // request available authentication methods @@ -200,6 +165,7 @@ class jabber // was a result returned? if ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id) { + // yes, now check for auth method availability in descending order (best to worst) if (isset($packet['iq']['#']['query'][0]['#']['sequence'][0]['#']) && isset($packet['iq']['#']['query'][0]['#']['token'][0]['#'])) { // auth_0k @@ -215,10 +181,16 @@ class jabber // plain text return $this->_sendauth_plaintext(); } + else + { + $this->add_to_log('ERROR: send_auth() #2 - No auth method available!'); + return false; + } } else { // no result returned + $this->add_to_log('ERROR: send_auth() #1'); return false; } } @@ -322,86 +294,15 @@ class jabber { $xml = trim($xml); - return ($this->connector->write_to_socket($xml)) ? true : false; - } - - /** - * get the transport registration fields - * method written by Steve Blinch, http://www.blitzaffe.com - */ - function transport_registration_details($transport) - { - $this->txnid++; - $packet = $this->send_iq($transport, 'get', "reg_{$this->txnid}", "jabber:iq:register", NULL, $this->jid); - - if ($packet) + if ($this->connector->write_to_socket($xml)) { - $res = array(); - - foreach ($packet['iq']['#']['query'][0]['#'] as $element => $data) - { - if ($element != 'instructions' && $element != 'key') - { - $res[] = $element; - } - } - - return $res; - } - else - { - return 3; - } - } - - /** - * register with the transport - * method written by Steve Blinch, http://www.blitzaffe.com - */ - function transport_registration($transport, $details) - { - $this->txnid++; - $packet = $this->send_iq($transport, 'get', "reg_{$this->txnid}", "jabber:iq:register", NULL, $this->jid); - - if ($packet) - { - // just in case a key was passed back from the server - $key = $this->get_info_from_iq_key($packet); - unset($packet); - - $payload = ($key) ? "<key>$key</key>\n" : ''; - foreach ($details as $element => $value) - { - $payload .= "<$element>$value</$element>\n"; - } - - $packet = $this->send_iq($transport, 'set', "reg_{$this->txnid}", "jabber:iq:register", $payload); - - if ($this->get_info_from_iq_type($packet) == 'result') - { - if (isset($packet['iq']['#']['query'][0]['#']['registered'][0]['#'])) - { - $return_code = 1; - } - else - { - $return_code = 2; - } - } - else if ($this->get_info_from_iq_type($packet) == 'error') - { - if (isset($packet['iq']['#']['error'][0]['#'])) - { - $return_code = "Error " . $packet['iq']['#']['error'][0]['@']['code'] . ": " . $packet['iq']['#']['error'][0]['#']; - // ERROR: TransportRegistration() - } - } - - return $return_code; + $this->add_to_log('SEND: ' . $xml); + return true; } else { - return 3; + $this->add_to_log('ERROR: send_packet() #1'); + return false; } } @@ -421,11 +322,12 @@ class jabber if ($incoming != '') { + $this->add_to_log('RECV: ' . $incoming); $temp = $this->_split_incoming($incoming); - for ($a = 0, $size = sizeof($temp); $a < $size; $a++) + for ($i = 0, $size = sizeof($temp); $i < $size; $i++) { - $this->packet_queue[] = $this->xmlize($temp[$a]); + $this->packet_queue[] = $this->xmlize($temp[$i]); } } @@ -454,16 +356,15 @@ class jabber } $this->_array_xmlspecialchars($content); - $this->_array_conv_utf8($content); $xml = "<message to='$to' type='$type' id='$id'>\n"; - if (isset($content['subject']) && $content['subject']) + if (!empty($content['subject'])) { $xml .= '<subject>' . $content['subject'] . "</subject>\n"; } - if (isset($content['thread']) && $content['thread']) + if (!empty($content['thread'])) { $xml .= '<thread>' . $content['thread'] . "</thread>\n"; } @@ -472,10 +373,18 @@ class jabber $xml .= $payload; $xml .= "</message>\n"; - return ($this->send_packet($xml)) ? true : false; + if ($this->send_packet($xml)) + { + return true; + } + else + { + $this->add_to_log('ERROR: send_message() #1'); + } } else { + $this->add_to_log('ERROR: send_message() #2'); return false; } } @@ -496,7 +405,15 @@ class jabber $xml .= ($status || $show || $priority) ? "</presence>\n" : ''; - return ($this->send_packet($xml)) ? true : false; + if ($this->send_packet($xml)) + { + return true; + } + else + { + $this->add_to_log('ERROR: send_presence() #1'); + return false; + } } /** @@ -583,11 +500,63 @@ class jabber else { $this->handler_not_implemented($packet); + $this->add_to_log("ERROR: call_handler() #1 - neither method nor function $funcmeth() available"); } } } /** + * Cruise Control + */ + function cruise_control($seconds = -1) + { + $count = 0; + + while ($count != $seconds) + { + $this->listen(); + + do + { + $packet = $this->get_first_from_queue(); + + if ($packet) + { + $this->call_handler($packet); + } + } + while (sizeof($this->packet_queue) > 1); + + $count += 0.25; + usleep(250000); + + if (($this->last_ping_time + 180) < time()) + { + // Modified by Nathan Fritz + if ($this->returned_keep_alive == false) + { + $this->connected = false; + $this->add_to_log('EVENT: Disconnected'); + } + + if ($this->returned_keep_alive == true) + { + $this->connected = true; + } + + $this->returned_keep_alive = false; + + $this->keep_alive_id = 'keep_alive_' . time(); + // $this->send_packet("<iq id='{$this->keep_alive_id}'/>", 'cruise_control'); + $this->send_packet("<iq type='get' from='{$this->username}@{$this->server}/{$this->resource}' to='{$this->server}' id='{$this->keep_alive_id}'><query xmlns='jabber:iq:time' /></iq>"); + $this->last_ping_time = time(); + } + } + + return true; + } + + /** * Send iq */ function send_iq($to = NULL, $type = 'get', $id = NULL, $xmlns = NULL, $payload = NULL, $from = NULL) @@ -596,12 +565,13 @@ class jabber { unset($type); + $this->add_to_log("ERROR: send_iq() #2 - type must be 'get', 'set', 'result' or 'error'"); return false; } else if ($id && $xmlns) { $xml = "<iq type='$type' id='$id'"; - $xml .= ($to) ? " to='$to'" : ''; + $xml .= ($to) ? " to='" . htmlspecialchars($to) . "'" : ''; $xml .= ($from) ? " from='$from'" : ''; $xml .= "> <query xmlns='$xmlns'> @@ -617,17 +587,116 @@ class jabber } else { + $this->add_to_log('ERROR: send_iq() #1 - to, id and xmlns are mandatory'); return false; } } + /** + * get the transport registration fields + * method written by Steve Blinch, http://www.blitzaffe.com + */ + function transport_registration_details($transport) + { + $this->txnid++; + $packet = $this->send_iq($transport, 'get', "reg_{$this->txnid}", 'jabber:iq:register', NULL, $this->jid); + + if ($packet) + { + $res = array(); + + foreach ($packet['iq']['#']['query'][0]['#'] as $element => $data) + { + if ($element != 'instructions' && $element != 'key') + { + $res[] = $element; + } + } + + return $res; + } + else + { + return 3; + } + } + + /** + * register with the transport + * method written by Steve Blinch, http://www.blitzaffe.com + */ + function transport_registration($transport, $details) + { + $this->txnid++; + $packet = $this->send_iq($transport, 'get', "reg_{$this->txnid}", 'jabber:iq:register', NULL, $this->jid); + + if ($packet) + { + // just in case a key was passed back from the server + $key = $this->get_info_from_iq_key($packet); + unset($packet); + + $payload = ($key) ? "<key>$key</key>\n" : ''; + foreach ($details as $element => $value) + { + $payload .= "<$element>$value</$element>\n"; + } + + $packet = $this->send_iq($transport, 'set', "reg_{$this->txnid}", 'jabber:iq:register', $payload); + + if ($this->get_info_from_iq_type($packet) == 'result') + { + $return_code = (isset($packet['iq']['#']['query'][0]['#']['registered'][0]['#'])) ? 1 : 2; + } + else if ($this->get_info_from_iq_type($packet) == 'error') + { + if (isset($packet['iq']['#']['error'][0]['#'])) + { + $return_code = 'Error ' . $packet['iq']['#']['error'][0]['@']['code'] . ': ' . $packet['iq']['#']['error'][0]['#']; + $this->add_to_log('ERROR: transport_registration()'); + } + } + + return $return_code; + } + else + { + return 3; + } + } + + /** + * Return log + */ + function get_log() + { + if ($this->enable_logging && sizeof($this->log_array)) + { + return implode("\n\n", $this->log_array); + } + + return ''; + } + + /** + * Add information to log + */ + function add_to_log($string) + { + if ($this->enable_logging) + { + $this->log_array[] = htmlspecialchars($string); + } + } + + // ====================================================================== // private methods // ====================================================================== /** * Send auth - * @access: private + * @access private */ function _sendauth_ok($zerok_token, $zerok_sequence) { @@ -638,7 +707,7 @@ class jabber $zerok_hash = sha1($zerok_hash . $zerok_token); // repeat as often as needed - for ($a = 0; $a < $zerok_sequence; $a++) + for ($i = 0; $i < $zerok_sequence; $i++) { $zerok_hash = sha1($zerok_hash); } @@ -650,12 +719,20 @@ class jabber $packet = $this->send_iq(NULL, 'set', $this->auth_id, 'jabber:iq:auth', $payload); // was a result returned? - return ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id) ? true : false; + if ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id) + { + return true; + } + else + { + $this->add_to_log('ERROR: _sendauth_ok() #1'); + return false; + } } /** * Send auth digest - * @access: private + * @access private */ function _sendauth_digest() { @@ -666,12 +743,20 @@ class jabber $packet = $this->send_iq(NULL, 'set', $this->auth_id, 'jabber:iq:auth', $payload); // was a result returned? - return ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id) ? true : false; + if ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id) + { + return true; + } + else + { + $this->add_to_log('ERROR: _sendauth_digest() #1'); + return false; + } } /** * Send auth plain - * @access: private + * @access private */ function _sendauth_plaintext() { @@ -682,12 +767,20 @@ class jabber $packet = $this->send_iq(NULL, 'set', $this->auth_id, 'jabber:iq:auth', $payload); // was a result returned? - return ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id) ? true : false; + if ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id) + { + return true; + } + else + { + $this->add_to_log('ERROR: _sendauth_plaintext() #1'); + return false; + } } /** * Listen on socket - * @access: private + * @access private */ function _listen_incoming() { @@ -699,12 +792,18 @@ class jabber } $incoming = trim($incoming); + + if ($incoming != '') + { + $this->add_to_log('RECV: ' . $incoming); + } + return $this->xmlize($incoming); } /** * Check if connected - * @access: private + * @access private */ function _check_connected() { @@ -712,45 +811,87 @@ class jabber if (is_array($incoming_array)) { - if ($incoming_array['stream:stream']['@']['from'] == $this->server - && $incoming_array['stream:stream']['@']['xmlns'] == 'jabber:client' - && $incoming_array['stream:stream']['@']['xmlns:stream'] == 'http://etherx.jabber.org/streams') + if ($incoming_array['stream:stream']['@']['from'] == $this->server && $incoming_array['stream:stream']['@']['xmlns'] == 'jabber:client' && $incoming_array['stream:stream']['@']['xmlns:stream'] == 'http://etherx.jabber.org/streams') { $this->stream_id = $incoming_array['stream:stream']['@']['id']; - return true; + if (!empty($incoming_array['stream:stream']['#']['stream:features'][0]['#']['starttls'][0]['@']['xmlns']) && $incoming_array['stream:stream']['#']['stream:features'][0]['#']['starttls'][0]['@']['xmlns'] == 'urn:ietf:params:xml:ns:xmpp-tls') + { + return $this->_starttls(); + } + else + { + return true; + } } else { + $this->add_to_log('ERROR: _check_connected() #1'); return false; } } else { + $this->add_to_log('ERROR: _check_connected() #2'); return false; } } /** - * Split incoming packet - * @access: private + * Start TLS/SSL session if supported (PHP5.1) + * @access private */ - function _split_incoming($incoming) + function _starttls() { - $temp = preg_split('#<(message|iq|presence|stream)#', $incoming, -1, PREG_SPLIT_DELIM_CAPTURE); - $array = array(); + if (!function_exists('stream_socket_enable_crypto') || !function_exists('stream_get_meta_data') || !function_exists('socket_set_blocking')) + { + $this->add_to_log('WARNING: TLS is not available'); + return true; + } - for ($a = 1; $a < sizeof($temp); $a = $a + 2) + $this->send_packet("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>\n"); + sleep(2); + $incoming_array = $this->_listen_incoming(); + + if (!is_array($incoming_array)) { - $array[] = '<' . $temp[$a] . $temp[($a + 1)]; + $this->add_to_log('ERROR: _starttls() #1'); + return false; } - return $array; + if ($incoming_array['proceed']['@']['xmlns'] != 'urn:ietf:params:xml:ns:xmpp-tls') + { + $this->add_to_log('ERROR: _starttls() #2'); + return false; + } + + $meta = stream_get_meta_data($this->connector->active_socket); + socket_set_blocking($this->connector->active_socket, 1); + + if (!stream_socket_enable_crypto($this->connector->active_socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) + { + socket_set_blocking($this->connector->active_socket, $meta['blocked']); + $this->add_to_log('ERROR: _starttls() #3'); + return false; + } + socket_set_blocking($this->connector->active_socket, $meta['blocked']); + + $this->send_packet("<?xml version='1.0' encoding='UTF-8' ?" . ">\n"); + $this->send_packet("<stream:stream to='{$this->server}' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>\n"); + sleep(2); + + if (!$this->_check_connected()) + { + $this->add_to_log('ERROR: _starttls() #4'); + return false; + } + + return true; } /** * Get packet type - * @access: private + * @access private */ function _get_packet_type($packet = NULL) { @@ -764,98 +905,52 @@ class jabber } /** - * Recursively prepares the strings in an array to be used in XML data. - * @access: private + * Split incoming packet + * @access private */ - function _array_xmlspecialchars(&$array) + function _split_incoming($incoming) { - if (is_array($array)) + $temp = preg_split('#<(message|iq|presence|stream)#', $incoming, -1, PREG_SPLIT_DELIM_CAPTURE); + $array = array(); + + for ($i = 1, $size = sizeof($temp); $i < $size; $i += 2) { - foreach ($array as $k => $v) - { - if (is_array($v)) - { - $this->_array_xmlspecialchars($array[$k]); - } - else - { - $this->_xmlspecialchars($array[$k]); - } - } + $array[] = '<' . $temp[$i] . $temp[($i + 1)]; } - } - /** - * Prepares a string for usage in XML data. - * @access: private - */ - function _xmlspecialchars(&$string) - { - // we only have a few entities in xml - $string = str_replace(array('&', '>', '<', '"', '\''), array('&', '>', '<', '"', '''), $string); + return $array; } /** - * Recursively converts all elements in an array to UTF-8 from the encoding stored in {@link encoding the encoding attribute}. - * @access: private + * Recursively prepares the strings in an array to be used in XML data. + * @access private */ - function _array_conv_utf8(&$array) + function _array_xmlspecialchars(&$array) { - // no need to do anything if the encoding already is UTF-8 - if (strtoupper($this->encoding) == 'UTF-8') - { - return true; - } - if (is_array($array)) { foreach ($array as $k => $v) { if (is_array($v)) { - $this->_array_conv_utf8($array[$k]); + $this->_array_xmlspecialchars($array[$k]); } else { - $this->_conv_utf8($array[$k]); + $this->_xmlspecialchars($array[$k]); } } } } /** - * Converts a string to utf8 encoding. - * - * @param string $string has to have the same encoding as {@link encoding the encoding attribute} is set to. - * - * @return boolean True on success, false on failure. - * - * @access: private + * Prepares a string for usage in XML data. + * @access private */ - function _conv_utf8(&$string) + function _xmlspecialchars(&$string) { - // no need to do anything if the encoding already is UTF-8 - if (strtoupper($this->encoding) == 'UTF-8') - { - return true; - } - - // first try iconv then mb_convert_encoding and as a last fall back try recode_string - if (function_exists('iconv') && (($string = iconv($this->encoding, 'UTF-8', $string)) !== false)) - { - return true; - } - elseif (function_exists('mb_convert_encoding') && (($string = mb_convert_encoding($string, 'UTF-8', $this->encoding)) !== false)) - { - return true; - } - elseif (function_exists('recode_string') && (($string = recode_string($this->encoding . '..UTF-8', $string)) !== false)) - { - return true; - } - - // if everything fails we will just have to live with what we have, good luck! - return false; + // we only have a few entities in xml + $string = str_replace(array('&', '>', '<', '"', '\''), array('&', '>', '<', '"', '''), $string); } // ====================================================================== @@ -911,6 +1006,14 @@ class jabber } /** + * Get info from message (xmlns) + */ + function get_info_from_message_xmlns($packet = NULL) + { + return (is_array($packet)) ? $packet['message']['#']['x'] : false; + } + + /** * Get info from message (error) */ function get_info_from_message_error($packet = NULL) @@ -969,19 +1072,48 @@ class jabber // ====================================================================== /** - * return message (from) + * Message type normal */ function handler_message_normal($packet) { $from = $packet['message']['@']['from']; + $this->add_to_log("EVENT: Message (type normal) from $from"); + } + + /** + * Message type chat + */ + function handler_message_chat($packet) + { + $from = $packet['message']['@']['from']; + $this->add_to_log("EVENT: Message (type chat) from $from"); + } + + /** + * Message type groupchat + */ + function handler_message_groupchat($packet) + { + $from = $packet['message']['@']['from']; + $this->add_to_log("EVENT: Message (type groupchat) from $from"); + } + + /** + * Message type headline + */ + function handler_message_headline($packet) + { + $from = $packet['message']['@']['from']; + $this->add_to_log("EVENT: Message (type headline) from $from"); } /** - * return error (from) + * Message type error */ function handler_message_error($packet) { $from = $packet['message']['@']['from']; + $this->add_to_log("EVENT: Message (type error) from $from"); } // ====================================================================== @@ -989,6 +1121,42 @@ class jabber // ====================================================================== /** + * application version updates + */ + function handler_iq_jabber_iq_autoupdate($packet) + { + $from = $this->get_info_from_iq_from($packet); + $id = $this->get_info_from_iq_id($packet); + + $this->send_error($from, $id, 501); + $this->add_to_log("EVENT: jabber:iq:autoupdate from $from"); + } + + /** + * interactive server component properties + */ + function handler_iq_jabber_iq_agent($packet) + { + $from = $this->get_info_from_iq_from($packet); + $id = $this->get_info_from_iq_id($packet); + + $this->send_error($from, $id, 501); + $this->add_to_log("EVENT: jabber:iq:agent from $from"); + } + + /** + * method to query interactive server components + */ + function handler_iq_jabber_iq_agents($packet) + { + $from = $this->get_info_from_iq_from($packet); + $id = $this->get_info_from_iq_id($packet); + + $this->send_error($from, $id, 501); + $this->add_to_log("EVENT: jabber:iq:agents from $from"); + } + + /** * simple client authentication */ function handler_iq_jabber_iq_auth($packet) @@ -997,6 +1165,31 @@ class jabber $id = $this->get_info_from_iq_id($packet); $this->send_error($from, $id, 501); + $this->add_to_log("EVENT: jabber:iq:auth from $from"); + } + + /** + * out of band data + */ + function handler_iq_jabber_iq_oob($packet) + { + $from = $this->get_info_from_iq_from($packet); + $id = $this->get_info_from_iq_id($packet); + + $this->send_error($from, $id, 501); + $this->add_to_log("EVENT: jabber:iq:oob from $from"); + } + + /** + * method to store private data on the server + */ + function handler_iq_jabber_iq_private($packet) + { + $from = $this->get_info_from_iq_from($packet); + $id = $this->get_info_from_iq_id($packet); + + $this->send_error($from, $id, 501); + $this->add_to_log("EVENT: jabber:iq:private from $from"); } /** @@ -1008,19 +1201,89 @@ class jabber $id = $this->get_info_from_iq_id($packet); $this->send_error($from, $id, 501); + $this->add_to_log("EVENT: jabber:iq:register from $from"); + } + + /** + * client roster management + */ + function handler_iq_jabber_iq_roster($packet) + { + $from = $this->get_info_from_iq_from($packet); + $id = $this->get_info_from_iq_id($packet); + + $this->send_error($from, $id, 501); + $this->add_to_log("EVENT: jabber:iq:roster from $from"); + } + + /** + * method for searching a user database + */ + function handler_iq_jabber_iq_search($packet) + { + $from = $this->get_info_from_iq_from($packet); + $id = $this->get_info_from_iq_id($packet); + + $this->send_error($from, $id, 501); + $this->add_to_log("EVENT: jabber:iq:search from $from"); } /** - * keepalive method, added by Nathan Fritz + * method for requesting the current time */ - function handler_iq_($packet) + function handler_iq_jabber_iq_time($packet) { if ($this->keep_alive_id == $this->get_info_from_iq_id($packet)) { $this->returned_keep_alive = true; + $this->connected = true; + + $this->add_to_log('EVENT: Keep-Alive returned, connection alive.'); + } + + $type = $this->get_info_from_iq_type($packet); + $from = $this->get_info_from_iq_from($packet); + $id = $this->get_info_from_iq_id($packet); + $id = ($id != '') ? $id : 'time_' . time(); + + if ($type == 'get') + { + $payload = '<utc>' . gmdate("Ydm\TH:i:s") . '</utc><tz>' . date('T') . '</tz><display>' . date("Y/d/m h:i:s A") . '</display>'; + $this->send_iq($from, 'result', $id, 'jabber:iq:time', $payload); } + + $this->add_to_log("EVENT: jabber:iq:time (type $type) from $from"); + } + + /** + */ + function handler_iq_error($packet) + { + // We'll do something with these later. This is a placeholder so that errors don't bounce back and forth. + } + + /** + * method for requesting version + */ + function handler_iq_jabber_iq_version($packet) + { + $type = $this->get_info_from_iq_type($packet); + $from = $this->get_info_from_iq_from($packet); + $id = $this->get_info_from_iq_id($packet); + $id = ($id != '') ? $id : 'version_' . time(); + + if ($type == 'get') + { + $payload = "<name>{$this->iq_version_name}</name> + <os>{$this->iq_version_os}</os> + <version>{$this->iq_version_version}</version>"; + + //$this->SendIq($from, 'result', $id, "jabber:iq:version", $payload); + } + + $this->add_to_log("EVENT: jabber:iq:version (type $type) from $from -- DISABLED"); } - + // ====================================================================== // Generic handlers // ====================================================================== @@ -1035,28 +1298,34 @@ class jabber $id = call_user_func(array(&$this, 'get_info_from_' . strtolower($packet_type) . '_id'), $packet); $this->send_error($from, $id, 501); + $this->add_to_log("EVENT: Unrecognized <$packet_type/> from $from"); } + // ====================================================================== // Third party code // m@d pr0ps to the coders ;) + // ====================================================================== /** * xmlize() - * (c) Hans Anderson / http://www.hansanderson.com/php/xml/ + * @author Hans Anderson + * @copyright Hans Anderson / http://www.hansanderson.com/php/xml/ */ - function xmlize($data) + function xmlize($data, $skip_white = 1, $encoding = 'UTF-8') { + $data = trim($data); + $vals = $index = $array = array(); - $parser = @xml_parser_create(); - @xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); - @xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); - @xml_parse_into_struct($parser, $data, $vals, $index); - @xml_parser_free($parser); + $parser = xml_parser_create($encoding); + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, $skip_white); + xml_parse_into_struct($parser, $data, $vals, $index); + xml_parser_free($parser); $i = 0; - $tagname = $vals[$i]['tag']; - $array[$tagname]['@'] = $vals[$i]['attributes']; + + $array[$tagname]['@'] = (isset($vals[$i]['attributes'])) ? $vals[$i]['attributes'] : array(); $array[$tagname]['#'] = $this->_xml_depth($vals, $i); return $array; @@ -1064,47 +1333,51 @@ class jabber /** * _xml_depth() - * (c) Hans Anderson / http://www.hansanderson.com/php/xml/ + * @author Hans Anderson + * @copyright Hans Anderson / http://www.hansanderson.com/php/xml/ */ function _xml_depth($vals, &$i) { $children = array(); - if (isset($vals[$i]['value']) && $vals[$i]['value']) + if (isset($vals[$i]['value'])) { - array_push($children, trim($vals[$i]['value'])); + array_push($children, $vals[$i]['value']); } while (++$i < sizeof($vals)) { switch ($vals[$i]['type']) { - case 'cdata': - array_push($children, trim($vals[$i]['value'])); - break; + case 'open': - case 'complete': - $tagname = $vals[$i]['tag']; + $tagname = (isset($vals[$i]['tag'])) ? $vals[$i]['tag'] : ''; $size = (isset($children[$tagname])) ? sizeof($children[$tagname]) : 0; - $children[$tagname][$size]['#'] = (isset($vals[$i]['value'])) ? trim($vals[$i]['value']) : ''; - if (isset($vals[$i]['attributes']) && $vals[$i]['attributes']) + + if (isset($vals[$i]['attributes'])) { $children[$tagname][$size]['@'] = $vals[$i]['attributes']; } + + $children[$tagname][$size]['#'] = $this->_xml_depth($vals, $i); + break; - case 'open': + case 'cdata': + array_push($children, $vals[$i]['value']); + break; + + case 'complete': + $tagname = $vals[$i]['tag']; $size = (isset($children[$tagname])) ? sizeof($children[$tagname]) : 0; - if ($vals[$i]['attributes']) + $children[$tagname][$size]['#'] = (isset($vals[$i]['value'])) ? $vals[$i]['value'] : array(); + + if (isset($vals[$i]['attributes'])) { $children[$tagname][$size]['@'] = $vals[$i]['attributes']; - $children[$tagname][$size]['#'] = $this->_xml_depth($vals, $i); - } - else - { - $children[$tagname][$size]['#'] = $this->_xml_depth($vals, $i); } + break; case 'close': @@ -1117,8 +1390,9 @@ class jabber } /** - * traverse_xmlize() - * (c) acebone@f2s.com, a HUGE help! + * TraverseXMLize() + * @author acebone@f2s.com + * @copyright acebone@f2s.com, a HUGE help! */ function traverse_xmlize($array, $arr_name = 'array', $level = 0) { @@ -1127,7 +1401,7 @@ class jabber echo '<pre>'; } - while (list($key, $val) = @each($array)) + foreach ($array as $key => $val) { if (is_array($val)) { @@ -1135,7 +1409,7 @@ class jabber } else { - echo '$' . $arr_name . '[' . $key . '] = "' . $val . "\"\n"; + $GLOBALS['traverse_array'][] = '$' . $arr_name . '[' . $key . '] = "' . $val . "\"\n"; } } @@ -1143,117 +1417,13 @@ class jabber { echo '</pre>'; } - } -} - -/** -* make_xml -* Currently not in use -* @package phpBB3 -class make_xml extends jabber -{ - var $nodes; - - function make_xml() - { - $nodes = array(); - } - - function add_packet_details($string, $value = NULL) - { - if (preg_match('#\(([0-9]*)\)$#i', $string)) - { - $string .= '/["#"]'; - } - - $temp = @explode('/', $string); - - for ($a = 0, $size = sizeof($temp); $a < $size; $a++) - { - $temp[$a] = preg_replace('#^[@]{1}([a-z0-9_]*)$#i', '["@"]["\1"]', $temp[$a]); - $temp[$a] = preg_replace('#^([a-z0-9_]*)\(([0-9]*)\)$/i', '["\1"][\2]', $temp[$a]); - $temp[$a] = preg_replace('#^([a-z0-9_]*)$#i', '["\1"]', $temp[$a]); - } - - $node = implode('', $temp); - - // Yeahyeahyeah, I know it's ugly... get over it. ;) - echo '$this->nodes' . $node . ' = "' . htmlspecialchars($value) . '";<br/>'; - eval('$this->nodes' . $node . ' = "' . htmlspecialchars($value) . '";'); - } - - function build_packet($array = NULL) - { - if (!$array) - { - $array = $this->nodes; - } - - if (is_array($array)) - { - array_multisort($array, SORT_ASC, SORT_STRING); - - foreach ($array as $key => $value) - { - if (is_array($value) && $key == '@') - { - foreach ($value as $subkey => $subvalue) - { - $subvalue = htmlspecialchars($subvalue); - $text .= " $subkey='$subvalue'"; - } - - $text .= ">\n"; - - } - else if ($key == '#') - { - $text .= htmlspecialchars($value); - } - else if (is_array($value)) - { - for ($a = 0, $size = sizeof($value); $a < $size; $a++) - { - $text .= "<$key"; - - if (!$this->_preg_grep_keys('#^@#', $value[$a])) - { - $text .= '>'; - } - - $text .= $this->build_packet($value[$a]); - $text .= "</$key>\n"; - } - } - else - { - $value = htmlspecialchars($value); - $text .= "<$key>$value</$key>\n"; - } - } - - return $text; - } - - return false; - } - function _preg_grep_keys($pattern, $array) - { - foreach ($array as $key => $val) - { - if (preg_match($pattern, $key)) - { - $newarray[$key] = $val; - } - } - return (is_array($newarray)) ? $newarray : false; + return 1; } } -*/ /** -* connector +* Jabber Connector * @package phpBB3 */ class cjp_standard_connector @@ -1265,7 +1435,21 @@ class cjp_standard_connector */ function open_socket($server, $port) { - if ($this->active_socket = @fsockopen($server, $port, $err, $err2, 5)) + if (function_exists('dns_get_record')) + { + $record = dns_get_record("_xmpp-client._tcp.$server", DNS_SRV); + + if (!empty($record)) + { + $server = $record[0]['target']; + $port = $record[0]['port']; + } + } + + $errno = 0; + $errstr = ''; + + if ($this->active_socket = @fsockopen($server, $port, $errno, $errstr, 5)) { @socket_set_blocking($this->active_socket, 0); @socket_set_timeout($this->active_socket, 31536000); @@ -1300,9 +1484,7 @@ class cjp_standard_connector function read_from_socket($chunksize) { $buffer = @fread($this->active_socket, $chunksize); - - //$buffer = (STRIP) ? stripslashes($buffer) : $buffer; - //@set_magic_quotes_runtime(get_magic_quotes_gpc()); + $buffer = (STRIP) ? stripslashes($buffer) : $buffer; return $buffer; } diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 052f372443..75eda9b10c 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -14,7 +14,7 @@ */ class messenger { - var $vars, $msg, $extra_headers, $replyto, $from, $subject, $encoding; + var $vars, $msg, $extra_headers, $replyto, $from, $subject; var $addresses = array(); var $mail_priority = MAIL_NORMAL_PRIORITY; @@ -44,8 +44,8 @@ class messenger */ function reset() { - $this->addresses = array(); - $this->vars = $this->msg = $this->extra_headers = $this->replyto = $this->from = $this->encoding = ''; + $this->addresses = $this->extra_headers = array(); + $this->vars = $this->msg = $this->replyto = $this->from = ''; $this->mail_priority = MAIL_NORMAL_PRIORITY; } @@ -118,7 +118,7 @@ class messenger */ function headers($headers) { - $this->extra_headers .= trim($headers) . "\n"; + $this->extra_headers[] = trim($headers); } /** @@ -189,24 +189,17 @@ class messenger { 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', "' . $\\1 . '", $this->msg); - - // Set vars - foreach ($this->vars as $key => $val) - { - $$key = $val; - } + $this->msg = preg_replace('#\{([a-z0-9\-_]*?)\}#is', "' . ((isset(\$this->vars['\\1'])) ? \$this->vars['\\1'] : '') . '", $this->msg); eval("\$this->msg = '$this->msg';"); - // Clear vars - foreach ($this->vars as $key => $val) - { - unset($$key); - } - // We now try and pull a subject from the email body ... if it exists, // do this here because the subject may contain a variable $drop_header = ''; @@ -221,16 +214,6 @@ class messenger $this->subject = (($this->subject != '') ? $this->subject : $user->lang['NO_SUBJECT']); } - if (preg_match('#^(Charset:(.*?))$#m', $this->msg, $match)) - { - $this->encoding = (trim($match[2]) != '') ? trim($match[2]) : trim($user->lang['ENCODING']); - $drop_header .= '[\r\n]*?' . preg_quote($match[1], '#'); - } - else - { - $this->encoding = trim($user->lang['ENCODING']); - } - if ($drop_header) { $this->msg = trim(preg_replace('#' . $drop_header . '#s', '', $this->msg)); @@ -291,6 +274,53 @@ class messenger } /** + * Return email header + */ + function build_header($to, $cc, $bcc) + { + global $config; + + $headers = array(); + + $headers[] = 'From: ' . $this->from; + + if ($cc) + { + $headers[] = 'Cc: ' . $cc; + } + + if ($bcc) + { + $headers[] = 'Bcc: ' . $bcc; + } + + $headers[] = 'Reply-To: ' . $this->replyto; + $headers[] = 'Return-Path: <' . $config['board_email'] . '>'; + $headers[] = 'Sender: <' . $config['board_email'] . '>'; + $headers[] = 'MIME-Version: 1.0'; + $headers[] = 'Message-ID: <' . md5(unique_id(time())) . '@' . $config['server_name'] . '>'; + $headers[] = 'Date: ' . gmdate('D, d M Y H:i:s T', time()); + $headers[] = 'Content-Type: text/plain; charset=UTF-8'; // format=flowed + $headers[] = 'Content-Transfer-Encoding: 8bit'; // 7bit + + $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-MimeOLE: phpBB3'; + $headers[] = 'X-phpBB-Origin: phpbb://' . str_replace(array('http://', 'https://'), array('', ''), generate_board_url()); + + // We use \n here instead of \r\n because our smtp mailer is adjusting it to \r\n automatically, whereby the php mail function only works + // if using \n. + + if (sizeof($this->extra_headers)) + { + $headers[] = implode("\n", $this->extra_headers); + } + + return implode("\n", $headers); + } + + /** * Send out emails */ function msg_email() @@ -313,8 +343,18 @@ class messenger $use_queue = true; } - $to = $cc = $bcc = ''; + if (empty($this->replyto)) + { + $this->replyto = '<' . $config['board_email'] . '>'; + } + + if (empty($this->from)) + { + $this->from = '<' . $config['board_email'] . '>'; + } + // Build to, cc and bcc strings + $to = $cc = $bcc = ''; foreach ($this->addresses as $type => $address_ary) { if ($type == 'im') @@ -324,40 +364,14 @@ class messenger foreach ($address_ary as $which_ary) { - $$type .= (($$type != '') ? ', ' : '') . (($which_ary['name'] != '') ? '"' . mail_encode($which_ary['name'], $this->encoding) . '" <' . $which_ary['email'] . '>' : $which_ary['email']); + $$type .= (($$type != '') ? ', ' : '') . (($which_ary['name'] != '') ? '"' . mail_encode($which_ary['name']) . '" <' . $which_ary['email'] . '>' : $which_ary['email']); } } - if (empty($this->replyto)) - { - $this->replyto = '<' . $config['board_email'] . '>'; - } - - if (empty($this->from)) - { - $this->from = '<' . $config['board_email'] . '>'; - } - // Build header - $headers = 'From: ' . $this->from . "\n"; - $headers .= ($cc != '') ? "Cc: $cc\n" : ''; - $headers .= ($bcc != '') ? "Bcc: $bcc\n" : ''; - $headers .= 'Reply-to: ' . $this->replyto . "\n"; - $headers .= 'Return-Path: <' . $config['board_email'] . ">\n"; - $headers .= 'Sender: <' . $config['board_email'] . ">\n"; - $headers .= "MIME-Version: 1.0\n"; - $headers .= 'Message-ID: <' . md5(unique_id(time())) . "@" . $config['server_name'] . ">\n"; - $headers .= 'Date: ' . gmdate('D, d M Y H:i:s T', time()) . "\n"; - $headers .= "Content-type: text/plain; charset={$this->encoding}\n"; - $headers .= "Content-transfer-encoding: 8bit\n"; - $headers .= "X-Priority: {$this->mail_priority}\n"; - $headers .= 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High')) . "\n"; - $headers .= "X-Mailer: PhpBB3\n"; - $headers .= "X-MimeOLE: phpBB3\n"; - $headers .= "X-phpBB-Origin: phpbb://" . str_replace(array('http://', 'https://'), array('', ''), generate_board_url()) . "\n"; - $headers .= ($this->extra_headers != '') ? $this->extra_headers : ''; - - // Send message ... removed $this->encode() from subject for time being + $headers = $this->build_header($to, $cc, $bcc); + + // Send message ... if (!$use_queue) { $mail_to = ($to == '') ? 'Undisclosed-Recipient:;' : $to; @@ -365,11 +379,11 @@ class messenger if ($config['smtp_delivery']) { - $result = smtpmail($this->addresses, $this->subject, wordwrap($this->msg), $err_msg, $this->encoding, $headers); + $result = smtpmail($this->addresses, mail_encode($this->subject), wordwrap($this->msg), $err_msg, $headers); } else { - $result = @$config['email_function_name']($mail_to, $this->subject, implode("\n", preg_split("/\r?\n/", wordwrap($this->msg))), $headers); + $result = @$config['email_function_name']($mail_to, mail_encode($this->subject), implode("\n", preg_split("/\r?\n/", wordwrap($this->msg))), $headers); } if (!$result) @@ -387,7 +401,6 @@ class messenger 'addresses' => $this->addresses, 'subject' => $this->subject, 'msg' => $this->msg, - 'encoding' => $this->encoding, 'headers' => $headers) ); } @@ -428,14 +441,7 @@ class messenger if (!$use_queue) { include_once($phpbb_root_path . 'includes/functions_jabber.'.$phpEx); - $this->jabber = new jabber; - - $this->jabber->server = $config['jab_host']; - $this->jabber->port = ($config['jab_port']) ? $config['jab_port'] : 5222; - $this->jabber->username = $config['jab_username']; - $this->jabber->password = $config['jab_password']; - $this->jabber->resource = ($config['jab_resource']) ? $config['jab_resource'] : ''; - $this->jabber->encoding = $this->encoding; + $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_resource']); if (!$this->jabber->connect()) { @@ -548,7 +554,7 @@ class queue } $package_size = $data_ary['package_size']; - $num_items = (sizeof($data_ary['data']) < $package_size) ? sizeof($data_ary['data']) : $package_size; + $num_items = (!$package_size || sizeof($data_ary['data']) < $package_size) ? sizeof($data_ary['data']) : $package_size; switch ($object) { @@ -569,13 +575,7 @@ class queue } include_once($phpbb_root_path . 'includes/functions_jabber.'.$phpEx); - $this->jabber = new jabber; - - $this->jabber->server = $config['jab_host']; - $this->jabber->port = ($config['jab_port']) ? $config['jab_port'] : 5222; - $this->jabber->username = $config['jab_username']; - $this->jabber->password = $config['jab_password']; - $this->jabber->resource = ($config['jab_resource']) ? $config['jab_resource'] : ''; + $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_resource']); if (!$this->jabber->connect()) { @@ -607,7 +607,7 @@ class queue $err_msg = ''; $to = (!$to) ? 'Undisclosed-Recipient:;' : $to; - $result = ($config['smtp_delivery']) ? smtpmail($addresses, $subject, wordwrap($msg), $err_msg, $encoding, $headers) : @$config['email_function_name']($to, $subject, implode("\n", preg_split("/\r?\n/", wordwrap($msg))), $headers); + $result = ($config['smtp_delivery']) ? smtpmail($addresses, mail_encode($subject), wordwrap($msg), $err_msg, $headers) : @$config['email_function_name']($to, mail_encode($subject), implode("\n", preg_split("/\r?\n/", wordwrap($msg))), $headers); if (!$result) { @@ -615,14 +615,19 @@ class queue $message = 'Method: [ ' . (($config['smtp_delivery']) ? 'SMTP' : 'PHP') . ' ]<br /><br />' . $err_msg . '<br /><br /><u>CALLING PAGE</u><br /><br />' . ((!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF']); messenger::error('EMAIL', $message); - continue 3; + continue 2; } break; case 'jabber': foreach ($addresses as $address) { - $this->jabber->send_message($address, 'normal', NULL, array('body' => $msg)); + if ($this->jabber->send_message($address, 'normal', NULL, array('body' => $msg)) === false) + { + $message = 'Method: [ JABBER ]<br /><br />' . $this->jabber->get_log() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . ((!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF']); + messenger::error('JABBER', $message); + continue 3; + } } break; } @@ -706,7 +711,7 @@ class queue /** * Format array - * @access: private + * @access private */ function format_array($array) { @@ -739,7 +744,7 @@ class queue /** * Replacement or substitute for PHP's mail command */ -function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers = '') +function smtpmail($addresses, $subject, $message, &$err_msg, $headers = '') { global $config, $user; @@ -790,10 +795,13 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers $mail_rcpt = $mail_to = $mail_cc = array(); // Build correct addresses for RCPT TO command and the client side display (TO, CC) - foreach ($addresses['to'] as $which_ary) + if (isset($addresses['to']) && sizeof($addresses['to'])) { - $mail_to[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name']), $encoding) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>'; - $mail_rcpt['to'][] = '<' . trim($which_ary['email']) . '>'; + foreach ($addresses['to'] as $which_ary) + { + $mail_to[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name'])) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>'; + $mail_rcpt['to'][] = '<' . trim($which_ary['email']) . '>'; + } } if (isset($addresses['bcc']) && sizeof($addresses['bcc'])) @@ -808,16 +816,18 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers { foreach ($addresses['cc'] as $which_ary) { - $mail_cc[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name']), $encoding) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>'; + $mail_cc[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name'])) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>'; $mail_rcpt['cc'][] = '<' . trim($which_ary['email']) . '>'; } } - $smtp = new smtp_class; + $smtp = new smtp_class(); $errno = 0; $errstr = ''; + $smtp->add_backtrace('Connecting to ' . $config['smtp_host'] . ':' . $config['smtp_port']); + // Ok we have error checked as much as we can to this point let's get on it already. if (!$smtp->socket = @fsockopen($config['smtp_host'], $config['smtp_port'], $errno, $errstr, 20)) { @@ -828,14 +838,14 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers // Wait for reply if ($err_msg = $smtp->server_parse('220', __LINE__)) { - $smtp->close_session(); + $smtp->close_session($err_msg); return false; } // Let me in. This function handles the complete authentication process if ($err_msg = $smtp->log_into_server($config['smtp_host'], $config['smtp_username'], $config['smtp_password'], $config['smtp_auth_method'])) { - $smtp->close_session(); + $smtp->close_session($err_msg); return false; } @@ -844,7 +854,7 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers $smtp->server_send('MAIL FROM:<' . $config['board_email'] . '>'); if ($err_msg = $smtp->server_parse('250', __LINE__)) { - $smtp->close_session(); + $smtp->close_session($err_msg); return false; } @@ -867,7 +877,7 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers // We continue... if users are not resolved we do not care if ($smtp->numeric_response_code != 550) { - $smtp->close_session(); + $smtp->close_session($err_msg); return false; } } @@ -885,7 +895,7 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers $user->session_begin(); $err_msg .= '<br /><br />'; $err_msg .= (isset($user->lang['INVALID_EMAIL_LOG'])) ? sprintf($user->lang['INVALID_EMAIL_LOG'], htmlspecialchars($mail_to_address)) : '<strong>' . htmlspecialchars($mail_to_address) . '</strong> possibly an invalid email address?'; - $smtp->close_session(); + $smtp->close_session($err_msg); return false; } @@ -895,7 +905,7 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers // This is the last response code we look for until the end of the message. if ($err_msg = $smtp->server_parse('354', __LINE__)) { - $smtp->close_session(); + $smtp->close_session($err_msg); return false; } @@ -922,13 +932,13 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers $smtp->server_send('.'); if ($err_msg = $smtp->server_parse('250', __LINE__)) { - $smtp->close_session(); + $smtp->close_session($err_msg); return false; } // Now tell the server we are done and close the socket... $smtp->server_send('QUIT'); - $smtp->close_session(); + $smtp->close_session($err_msg); return true; } @@ -947,16 +957,41 @@ class smtp_class var $commands = array(); var $numeric_response_code = 0; + var $backtrace = false; + var $backtrace_log = array(); + + function smtp_class() + { + if (defined('DEBUG_EXTRA')) + { + $this->backtrace = true; + $this->backtrace_log = array(); + } + } + + /** + * Add backtrace message for debugging + */ + function add_backtrace($message) + { + if ($this->backtrace) + { + $this->backtrace_log[] = $message; + } + } + /** * Send command to smtp server */ - function server_send($command) + function server_send($command, $private_info = false) { fputs($this->socket, $command . "\r\n"); + (!$private_info) ? $this->add_backtrace("# $command") : $this->add_backtrace('# Ommitting sensitive Informations'); + // We could put additional code here } - + /** * We use the line to give the support people an indication at which command the error occurred */ @@ -976,6 +1011,8 @@ class smtp_class } $this->responses[] = substr(rtrim($this->server_response), 4); $this->numeric_response_code = (int) substr($this->server_response, 0, 3); + + $this->add_backtrace("LINE: $line <- {$this->server_response}"); } if (!(substr($this->server_response, 0, 3) == $response)) @@ -990,9 +1027,15 @@ class smtp_class /** * Close session */ - function close_session() + function close_session(&$err_msg) { fclose($this->socket); + + if ($this->backtrace) + { + $message = '<h1>Backtrace</h1><p>' . implode('<br />', array_map('htmlspecialchars', $this->backtrace_log)) . '</p>'; + $err_msg .= $message; + } } /** @@ -1008,10 +1051,37 @@ class smtp_class // If we are authenticating through pop-before-smtp, we // have to login ones before we get authenticated + // NOTE: on some configurations the time between an update of the auth database takes so + // long that the first email send does not work. This is not a biggie on a live board (only + // the install mail will most likely fail) - but on a dynamic ip connection this might produce + // severe problems and is not fixable! if ($default_auth_method == 'POP-BEFORE-SMTP' && $username && $password) { + global $config; + + $errno = 0; + $errstr = ''; + + $this->server_send("QUIT"); + fclose($this->socket); + $result = $this->pop_before_smtp($hostname, $username, $password); $username = $password = $default_auth_method = ''; + + // We need to close the previous session, else the server is not + // able to get our ip for matching... + if (!$this->socket = @fsockopen($config['smtp_host'], $config['smtp_port'], $errno, $errstr, 10)) + { + $err_msg = (isset($user->lang['NO_CONNECT_TO_SMTP_HOST'])) ? sprintf($user->lang['NO_CONNECT_TO_SMTP_HOST'], $errno, $errstr) : "Could not connect to smtp host : $errno : $errstr"; + return $err_msg; + } + + // Wait for reply + if ($err_msg = $this->server_parse('220', __LINE__)) + { + $this->close_session($err_msg); + return $err_msg; + } } // Try EHLO first @@ -1090,32 +1160,26 @@ class smtp_class { global $user; - $old_socket = $this->socket; - - if (!$this->socket = fsockopen($hostname, 110, $errno, $errstr, 20)) + if (!$this->socket = @fsockopen($hostname, 110, $errno, $errstr, 10)) { - $this->socket = $old_socket; return (isset($user->lang['NO_CONNECT_TO_SMTP_HOST'])) ? sprintf($user->lang['NO_CONNECT_TO_SMTP_HOST'], $errno, $errstr) : "Could not connect to smtp host : $errno : $errstr"; } - $this->server_parse('0', __LINE__); - if (substr($this->server_response, 0, 3) == '+OK') + $this->server_send("USER $username", true); + if ($err_msg = $this->server_parse('+OK', __LINE__)) { - fputs($this->socket, "USER $username\r\n"); - fputs($this->socket, "PASS $password\r\n"); + return $err_msg; } - else + + $this->server_send("PASS $password", true); + if ($err_msg = $this->server_parse('+OK', __LINE__)) { - $this->socket = $old_socket; - return $this->responses[0]; + return $err_msg; } $this->server_send('QUIT'); - $this->server_parse('0', __LINE__); fclose($this->socket); - $this->socket = $old_socket; - return false; } @@ -1131,7 +1195,7 @@ class smtp_class } $base64_method_plain = base64_encode("\0" . $username . "\0" . $password); - $this->server_send($base64_method_plain); + $this->server_send($base64_method_plain, true); if ($err_msg = $this->server_parse('235', __LINE__)) { return $err_msg; @@ -1151,13 +1215,13 @@ class smtp_class return ($this->numeric_response_code == 503) ? false : $err_msg; } - $this->server_send(base64_encode($username)); + $this->server_send(base64_encode($username), true); if ($err_msg = $this->server_parse('334', __LINE__)) { return $err_msg; } - $this->server_send(base64_encode($password)); + $this->server_send(base64_encode($password), true); if ($err_msg = $this->server_parse('235', __LINE__)) { return $err_msg; @@ -1183,7 +1247,7 @@ class smtp_class $base64_method_cram_md5 = base64_encode($username . ' ' . $md5_digest); - $this->server_send($base64_method_cram_md5); + $this->server_send($base64_method_cram_md5, true); if ($err_msg = $this->server_parse('235', __LINE__)) { return $err_msg; @@ -1287,7 +1351,7 @@ class smtp_class } $base64_method_digest_md5 = base64_encode($input_string); - $this->server_send($base64_method_digest_md5); + $this->server_send($base64_method_digest_md5, true); if ($err_msg = $this->server_parse('334', __LINE__)) { return $err_msg; @@ -1304,25 +1368,24 @@ class smtp_class } /** -* Encodes the given string for proper display for this encoding ... nabbed +* Encodes the given string for proper display in UTF-8 ... nabbed * from php.net and modified. There is an alternative encoding method which * may produce less output but it's questionable as to its worth in this -* scenario IMO +* scenario. +* +* This version is using base64 encoded data. The downside of this +* is if the mail client does not understand this encoding the user +* is basically doomed with an unreadable subject. */ -function mail_encode($str, $encoding) +function mail_encode($str) { - if ($encoding == '') - { - return $str; - } - // define start delimimter, end delimiter and spacer - $end = "?="; - $start = "=?$encoding?B?"; - $spacer = "$end\r\n $start"; + $end = '?='; + $start = '=?UTF-8?B?'; + $spacer = "$end $start"; // determine length of encoded text within chunks and ensure length is even - $length = 75 - strlen($start) - strlen($end); + $length = 76 - strlen($start) - strlen($end); $length = floor($length / 2) * 2; // encode the string and split it into chunks with spacers after each chunk diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 9541c9f4cf..89dda74700 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -256,9 +256,9 @@ class p_master // If no category or module selected, go active for first module in first category if ( (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && (($item_ary['mode'] == $mode && !$item_ary['cat']) || ($icat && $item_ary['cat']))) || - ($item_ary['parent'] === $category && !$item_ary['cat'] && !$icat) || + ($item_ary['parent'] === $category && !$item_ary['cat'] && !$icat && $item_ary['display']) || (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && !$mode && !$item_ary['cat']) || - (!$id && !$mode && !$item_ary['cat']) + (!$id && !$mode && !$item_ary['cat'] && $item_ary['display']) ) { if ($item_ary['cat']) @@ -309,14 +309,14 @@ class p_master { if (!file_exists("$module_path/{$this->p_class}_$this->p_name.$phpEx")) { - trigger_error('Cannot find module', E_USER_ERROR); + trigger_error("Cannot find module $module_path/{$this->p_class}_$this->p_name.$phpEx", E_USER_ERROR); } include("$module_path/{$this->p_class}_$this->p_name.$phpEx"); if (!class_exists("{$this->p_class}_$this->p_name")) { - trigger_error('Module does not contain correct class', E_USER_ERROR); + trigger_error("Module file $module_path/{$this->p_class}_$this->p_name.$phpEx does not contain correct class [{$this->p_class}_$this->p_name]", E_USER_ERROR); } if (!empty($mode)) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index b40fdb369c..b15466b487 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -111,21 +111,41 @@ function update_post_information($type, $ids, $return_update_sql = false) $ids = array($ids); } - $update_sql = $empty_forums = array(); + $update_sql = $empty_forums = $not_empty_forums = array(); - $sql = 'SELECT ' . $type . '_id, MAX(post_id) as last_post_id - FROM ' . POSTS_TABLE . ' - WHERE post_approved = 1 - AND ' . $db->sql_in_set($type . '_id', $ids) . " - GROUP BY {$type}_id"; + if (sizeof($ids) == 1) + { + $sql = 'SELECT MAX(post_id) as last_post_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set($type . '_id', $ids) . ' + AND post_approved = 1'; + } + else + { + $sql = 'SELECT ' . $type . '_id, MAX(post_id) as last_post_id + FROM ' . POSTS_TABLE . ' + WHERE ' . $db->sql_in_set($type . '_id', $ids) . " + AND post_approved = 1 + GROUP BY {$type}_id"; + } $result = $db->sql_query($sql); $last_post_ids = array(); while ($row = $db->sql_fetchrow($result)) { + if (sizeof($ids) == 1) + { + $row[$type . '_id'] = $ids[0]; + } + if ($type == 'forum') { - $empty_forums[] = $row['forum_id']; + $not_empty_forums[] = $row['forum_id']; + + if (empty($row['last_post_id'])) + { + $empty_forums[] = $row['forum_id']; + } } $last_post_ids[] = $row['last_post_id']; @@ -134,20 +154,22 @@ function update_post_information($type, $ids, $return_update_sql = false) if ($type == 'forum') { - $empty_forums = array_diff($ids, $empty_forums); + $empty_forums = array_merge($empty_forums, array_diff($ids, $not_empty_forums)); foreach ($empty_forums as $void => $forum_id) { $update_sql[$forum_id][] = 'forum_last_post_id = 0'; - $update_sql[$forum_id][] = 'forum_last_post_time = 0'; + $update_sql[$forum_id][] = "forum_last_post_subject = ''"; + $update_sql[$forum_id][] = 'forum_last_post_time = 0'; $update_sql[$forum_id][] = 'forum_last_poster_id = 0'; $update_sql[$forum_id][] = "forum_last_poster_name = ''"; + $update_sql[$forum_id][] = "forum_last_poster_colour = ''"; } } if (sizeof($last_post_ids)) { - $sql = 'SELECT p.' . $type . '_id, p.post_id, p.post_time, p.poster_id, p.post_username, u.user_id, u.username + $sql = 'SELECT p.' . $type . '_id, p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.user_id, u.username, u.user_colour FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE p.poster_id = u.user_id AND ' . $db->sql_in_set('p.post_id', $last_post_ids); @@ -156,8 +178,10 @@ function update_post_information($type, $ids, $return_update_sql = false) while ($row = $db->sql_fetchrow($result)) { $update_sql[$row["{$type}_id"]][] = $type . '_last_post_id = ' . (int) $row['post_id']; + $update_sql[$row["{$type}_id"]][] = "{$type}_last_post_subject = '" . $db->sql_escape($row['post_subject']) . "'"; $update_sql[$row["{$type}_id"]][] = $type . '_last_post_time = ' . (int) $row['post_time']; $update_sql[$row["{$type}_id"]][] = $type . '_last_poster_id = ' . (int) $row['poster_id']; + $update_sql[$row["{$type}_id"]][] = "{$type}_last_poster_colour = '" . $db->sql_escape($row['user_colour']) . "'"; $update_sql[$row["{$type}_id"]][] = "{$type}_last_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "'"; } $db->sql_freeresult($result); @@ -190,8 +214,7 @@ function posting_gen_topic_icons($mode, $icon_id) global $phpbb_root_path, $config, $template, $cache; // Grab icons - $icons = array(); - $cache->obtain_icons($icons); + $icons = $cache->obtain_icons(); if (!$icon_id) { @@ -311,13 +334,11 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage if (!$filedata['post_attach']) { - $filedata['error'][] = 'No filedata found'; + $filedata['error'][] = $user->lang['NO_UPLOAD_FORM_FOUND']; return $filedata; } - $extensions = array(); - $cache->obtain_attach_extensions($extensions, $forum_id); - + $extensions = $cache->obtain_attach_extensions($forum_id); $upload->set_allowed_extensions(array_keys($extensions['_allowed_'])); $file = ($local) ? $upload->local_upload($local_storage) : $upload->form_upload($form_name); @@ -330,6 +351,16 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage $cat_id = (isset($extensions[$file->get('extension')]['display_cat'])) ? $extensions[$file->get('extension')]['display_cat'] : ATTACHMENT_CATEGORY_NONE; + // Make sure the image category only holds valid images... + if ($cat_id == ATTACHMENT_CATEGORY_IMAGE && !$file->is_image()) + { + $file->remove(); + + // If this error occurs a user tried to exploit an IE Bug by renaming extensions + // Since the image category is displaying content inline we need to catch this. + trigger_error($user->lang['UNABLE_GET_IMAGE_SIZE']); + } + // Do we have to create a thumbnail? $filedata['thumbnail'] = ($cat_id == ATTACHMENT_CATEGORY_IMAGE && $config['img_create_thumbnail']) ? 1 : 0; @@ -421,8 +452,10 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage */ function get_img_size_format($width, $height) { + global $config; + // Maximum Width the Image can take - $max_width = 400; + $max_width = ($config['img_max_thumb_width']) ? $config['img_max_thumb_width'] : 400; if ($width > $height) { @@ -533,7 +566,8 @@ function create_thumbnail($source, $destination, $mimetype) // Only use imagemagick if defined and the passthru function not disabled if ($config['img_imagick'] && function_exists('passthru')) { - passthru(escapeshellcmd($config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -quality 85 -antialias -sample ' . $new_width . 'x' . $new_height . ' "' . str_replace('\\', '/', $source) . '" +profile "*" "' . str_replace('\\', '/', $destination) . '"'); + @passthru(escapeshellcmd($config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -quality 85 -antialias -sample ' . $new_width . 'x' . $new_height . ' "' . str_replace('\\', '/', $source) . '" +profile "*" "' . str_replace('\\', '/', $destination) . '"'); + if (file_exists($destination)) { $used_imagick = true; @@ -638,7 +672,7 @@ function posting_gen_inline_attachments(&$attachment_data) foreach ($attachment_data as $i => $attachment) { - $s_inline_attachment_options .= '<option value="' . $i . '">' . $attachment['real_filename'] . '</option>'; + $s_inline_attachment_options .= '<option value="' . $i . '">' . basename($attachment['real_filename']) . '</option>'; } $template->assign_var('S_INLINE_ATTACHMENT_OPTIONS', $s_inline_attachment_options); @@ -654,7 +688,7 @@ function posting_gen_inline_attachments(&$attachment_data) */ function posting_gen_attachment_entry(&$attachment_data, &$filename_data) { - global $template, $config, $phpbb_root_path, $phpEx; + global $template, $config, $phpbb_root_path, $phpEx, $user; $template->assign_vars(array( 'S_SHOW_ATTACH_BOX' => true) @@ -677,13 +711,13 @@ function posting_gen_attachment_entry(&$attachment_data, &$filename_data) $hidden .= '<input type="hidden" name="attachment_data[' . $count . '][' . $key . ']" value="' . $value . '" />'; } - $download_link = (!$attach_row['attach_id']) ? $phpbb_root_path . $config['upload_path'] . '/' . basename($attach_row['physical_filename']) : append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . (int) $attach_row['attach_id']); + $download_link = append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . (int) $attach_row['attach_id'], false, ($attach_row['is_orphan']) ? $user->session_id : false); $template->assign_block_vars('attach_row', array( 'FILENAME' => basename($attach_row['real_filename']), - 'ATTACH_FILENAME' => basename($attach_row['physical_filename']), 'FILE_COMMENT' => $attach_row['attach_comment'], 'ATTACH_ID' => $attach_row['attach_id'], + 'S_IS_ORPHAN' => $attach_row['is_orphan'], 'ASSOC_INDEX' => $count, 'U_VIEW_ATTACHMENT' => $download_link, @@ -848,10 +882,10 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id $db->sql_freeresult($result); // Instantiate BBCode class - if (!isset($bbcode) && $bbcode_bitfield) + if (!isset($bbcode) && $bbcode_bitfield !== '') { include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); - $bbcode = new bbcode($bbcode_bitfield); + $bbcode = new bbcode(base64_encode($bbcode_bitfield)); } foreach ($rowset as $i => $row) @@ -868,6 +902,8 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id $post_subject = $row['post_subject']; $message = $row['post_text']; + $message = censor_text($message); + $message = str_replace("\n", '<br />', $message); $decoded_message = false; if ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) @@ -887,20 +923,18 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id $message = smiley_text($message, !$row['enable_smilies']); $post_subject = censor_text($post_subject); - $message = censor_text($message); $template->assign_block_vars($mode . '_row', array( 'POSTER_NAME' => $poster, 'POST_SUBJECT' => $post_subject, 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']), 'POST_DATE' => $user->format_date($row['post_time']), - 'MESSAGE' => str_replace("\n", '<br />', $message), + 'MESSAGE' => $message, 'DECODED_MESSAGE' => $decoded_message, - 'U_POST_ID' => $row['post_id'], 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'], 'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=post_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '', - 'U_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? 'javascript:addquote(' . $row['post_id'] . ", '" . addslashes($poster) . "')" : '') + 'POSTER_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? addslashes($poster) : '') ); unset($rowset[$i]); } @@ -920,8 +954,8 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id { global $db, $user, $config, $phpbb_root_path, $phpEx, $auth; - $topic_notification = ($mode == 'reply' || $mode == 'quote'); - $forum_notification = ($mode == 'post'); + $topic_notification = ($mode == 'reply' || $mode == 'quote') ? true : false; + $forum_notification = ($mode == 'post') ? true : false; if (!$topic_notification && !$forum_notification) { @@ -1053,8 +1087,6 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); $messenger = new messenger(); - $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); - $msg_list_ary = array(); foreach ($msg_users as $row) { @@ -1079,11 +1111,9 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id $messenger->im($addr['jabber'], $addr['name']); $messenger->assign_vars(array( - 'EMAIL_SIG' => $email_sig, - 'SITENAME' => html_entity_decode($config['sitename']), - 'USERNAME' => html_entity_decode($addr['name']), - 'TOPIC_TITLE' => html_entity_decode($topic_title), - 'FORUM_NAME' => html_entity_decode($forum_name), + 'USERNAME' => htmlspecialchars_decode($addr['name']), + 'TOPIC_TITLE' => htmlspecialchars_decode($topic_title), + 'FORUM_NAME' => htmlspecialchars_decode($forum_name), 'U_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id&e=0", 'U_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&e=0", @@ -1197,7 +1227,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) break; case 'delete_first_post': - $sql = 'SELECT p.post_id, p.poster_id, p.post_username, u.username + $sql = 'SELECT p.post_id, p.poster_id, p.post_username, u.username, u.user_colour FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u WHERE p.topic_id = $topic_id AND p.poster_id = u.user_id @@ -1211,7 +1241,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) $sql_data[FORUMS_TABLE] = 'forum_posts = forum_posts - 1'; } - $sql_data[TOPICS_TABLE] = 'topic_first_post_id = ' . intval($row['post_id']) . ", topic_first_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "'"; + $sql_data[TOPICS_TABLE] = 'topic_first_post_id = ' . intval($row['post_id']) . ", topic_first_poster_colour = '" . $db->sql_escape($row['user_colour']) . ", topic_first_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "'"; $sql_data[TOPICS_TABLE] .= ', topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : ''); $next_post_id = (int) $row['post_id']; @@ -1381,8 +1411,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'post_subject' => $subject, 'post_text' => $data['message'], 'post_checksum' => $data['message_md5'], - 'post_encoding' => $user->lang['ENCODING'], - 'post_attachment' => (isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data'])) ? 1 : 0, + 'post_attachment' => (!empty($data['attachment_data'])) ? 1 : 0, 'bbcode_bitfield' => $data['bbcode_bitfield'], 'bbcode_uid' => $data['bbcode_uid'], 'post_postcount' => ($auth->acl_get('f_postcount', $data['forum_id'])) ? 1 : 0, @@ -1435,8 +1464,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'post_edit_reason' => $data['post_edit_reason'], 'post_edit_user' => (int) $data['post_edit_user'], 'post_checksum' => $data['message_md5'], - 'post_encoding' => $user->lang['ENCODING'], - 'post_attachment' => (isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data'])) ? 1 : 0, + 'post_attachment' => (!empty($data['attachment_data'])) ? 1 : 0, 'bbcode_bitfield' => $data['bbcode_bitfield'], 'bbcode_uid' => $data['bbcode_uid'], 'post_edit_locked' => $data['post_edit_locked']) @@ -1462,9 +1490,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'topic_approved' => (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1, 'topic_title' => $subject, 'topic_first_poster_name' => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''), + 'topic_first_poster_colour' => (($user->data['user_id'] != ANONYMOUS) ? $user->data['user_colour'] : ''), 'topic_type' => $topic_type, 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, - 'topic_attachment' => (isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data'])) ? 1 : 0 + 'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : 0, ); if (isset($poll['poll_options']) && !empty($poll['poll_options'])) @@ -1517,7 +1546,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'poll_length' => (isset($poll['poll_options'])) ? ($poll['poll_length'] * 86400) : 0, 'poll_vote_change' => (isset($poll['poll_vote_change'])) ? $poll['poll_vote_change'] : 0, - 'topic_attachment' => ($post_mode == 'edit_topic') ? ((isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data'])) ? 1 : 0) : (isset($data['topic_attachment']) ? $data['topic_attachment'] : 0) + 'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : (isset($data['topic_attachment']) ? $data['topic_attachment'] : 0), ); break; } @@ -1560,7 +1589,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'topic_last_post_id' => $data['post_id'], 'topic_last_post_time' => $current_time, 'topic_last_poster_id' => (int) $user->data['user_id'], - 'topic_last_poster_name'=> (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : '') + 'topic_last_poster_name'=> (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''), + 'topic_last_poster_colour' => (($user->data['user_id'] != ANONYMOUS) ? $user->data['user_colour'] : ''), ); } @@ -1675,24 +1705,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u } } - if (sizeof($sql_insert_ary)) - { - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query('INSERT INTO ' . POLL_OPTIONS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_insert_ary)); - break; - - default: - foreach ($sql_insert_ary as $ary) - { - $db->sql_query('INSERT INTO ' . POLL_OPTIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; - } - } + $db->sql_multi_insert(POLL_OPTIONS_TABLE, $sql_insert_ary); if (sizeof($poll['poll_options']) < sizeof($cur_poll_options)) { @@ -1704,67 +1717,81 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u } // Submit Attachments - if (sizeof($data['attachment_data']) && $data['post_id'] && in_array($mode, array('post', 'reply', 'quote', 'edit'))) + if (!empty($data['attachment_data']) && $data['post_id'] && in_array($mode, array('post', 'reply', 'quote', 'edit'))) { $space_taken = $files_added = 0; + $orphan_rows = array(); foreach ($data['attachment_data'] as $pos => $attach_row) { - if ($attach_row['attach_id']) + $orphan_rows[(int) $attach_row['attach_id']] = array(); + } + + if (sizeof($orphan_rows)) + { + $sql = 'SELECT attach_id, filesize, physical_filename + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', array_keys($orphan_rows)) . ' + AND is_orphan = 1 + AND poster_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + + $orphan_rows = array(); + while ($row = $db->sql_fetchrow($result)) + { + $orphan_rows[$row['attach_id']] = $row; + } + $db->sql_freeresult($result); + } + + foreach ($data['attachment_data'] as $pos => $attach_row) + { + if ($attach_row['is_orphan'] && !in_array($attach_row['attach_id'], array_keys($orphan_rows))) + { + continue; + } + + if (!$attach_row['is_orphan']) { // update entry in db if attachment already stored in db and filespace $sql = 'UPDATE ' . ATTACHMENTS_TABLE . " SET attach_comment = '" . $db->sql_escape($attach_row['attach_comment']) . "' - WHERE attach_id = " . (int) $attach_row['attach_id']; + WHERE attach_id = " . (int) $attach_row['attach_id'] . ' + AND is_orphan = 0'; $db->sql_query($sql); } else { // insert attachment into db - if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . basename($attach_row['physical_filename']))) + if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . basename($orphan_rows[$attach_row['attach_id']]['physical_filename']))) { continue; } + $space_taken += $orphan_rows[$attach_row['attach_id']]['filesize']; + $files_added++; + $attach_sql = array( 'post_msg_id' => $data['post_id'], 'topic_id' => $data['topic_id'], - 'in_message' => 0, + 'is_orphan' => 0, 'poster_id' => $poster_id, - 'physical_filename' => basename($attach_row['physical_filename']), - 'real_filename' => basename($attach_row['real_filename']), 'attach_comment' => $attach_row['attach_comment'], - 'extension' => $attach_row['extension'], - 'mimetype' => $attach_row['mimetype'], - 'filesize' => $attach_row['filesize'], - 'filetime' => $attach_row['filetime'], - 'thumbnail' => $attach_row['thumbnail'] ); - $sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . - $db->sql_build_array('INSERT', $attach_sql); + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $attach_sql) . ' + WHERE attach_id = ' . $attach_row['attach_id'] . ' + AND is_orphan = 1 + AND poster_id = ' . $user->data['user_id']; $db->sql_query($sql); - - $space_taken += $attach_row['filesize']; - $files_added++; } } - if (sizeof($data['attachment_data'])) + if ($space_taken && $files_added) { - $sql = 'UPDATE ' . POSTS_TABLE . ' - SET post_attachment = 1 - WHERE post_id = ' . $data['post_id']; - $db->sql_query($sql); - - $sql = 'UPDATE ' . TOPICS_TABLE . ' - SET topic_attachment = 1 - WHERE topic_id = ' . $data['topic_id']; - $db->sql_query($sql); + set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true); + set_config('num_files', $config['num_files'] + $files_added, true); } - - set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true); - set_config('num_files', $config['num_files'] + $files_added, true); } $db->sql_transaction('commit'); @@ -1852,7 +1879,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u trigger_error('NO_SUCH_SEARCH_MODULE'); } - require("{$phpbb_root_path}includes/search/$search_type.$phpEx"); + require_once("{$phpbb_root_path}includes/search/$search_type.$phpEx"); $error = false; $search = new $search_type($error); @@ -1862,7 +1889,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u trigger_error($error); } - $search->index($mode, $data['post_id'], $data['message'], $subject, $user->lang['ENCODING'], $poster_id, ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']); + $search->index($mode, $data['post_id'], $data['message'], $subject, $poster_id, ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']); } $db->sql_transaction('commit'); @@ -1921,7 +1948,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $f_mark_time = false; } - if ($config['load_db_lastread'] || $config['load_anon_lastread'] || $user->data['is_registered']) + 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 diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index fe38b6276b..58d854b928 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -279,9 +279,31 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id) case ACTION_MARK_AS_READ: case ACTION_MARK_AS_IMPORTANT: - case ACTION_DELETE_MESSAGE: return array('action' => $rule_row['rule_action'], 'pm_unread' => $message_row['pm_unread'], 'pm_marked' => $message_row['pm_marked']); break; + + case ACTION_DELETE_MESSAGE: + global $db, $auth; + + // Check for admins/mods - users are not allowed to remove those messages... + // We do the check here to make sure the data we use is consistent + $sql = 'SELECT user_id, user_type, user_permissions + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . (int) $message_row['author_id']; + $result = $db->sql_query($sql); + $userdata = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $auth2 = new auth(); + $auth2->acl($userdata); + + if (!$auth2->acl_get('a_') && !$auth->acl_get('m_') && !$auth2->acl_getf_global('m_')) + { + return array('action' => $rule_row['rule_action'], 'pm_unread' => $message_row['pm_unread'], 'pm_marked' => $message_row['pm_marked']); + } + + return false; + break; default: return false; @@ -486,8 +508,8 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) } } - $num_new += sizeof(array_unique($delete_ids)); - $num_unread += sizeof(array_unique($delete_ids)); +// $num_new += sizeof(array_unique($delete_ids)); +// $num_unread += sizeof(array_unique($delete_ids)); $num_unread += sizeof(array_unique($unread_ids)); // Do not change the order of processing @@ -589,13 +611,12 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) } else if ($full_folder_action == FULL_FOLDER_DELETE) { - // Delete some messages ;) - $sql = 'SELECT t.msg_id - FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . " p - WHERE t.msg_id = p.msg_id - AND t.user_id = $user_id - AND t.folder_id = $dest_folder - ORDER BY p.message_time ASC"; + // Delete some messages. NOTE: Ordered by msg_id here instead of message_time! + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . " + WHERE user_id = $user_id + AND folder_id = $dest_folder + ORDER BY msg_id ASC"; $result = $db->sql_query_limit($sql, (($folder[$dest_folder] + sizeof($msg_ary)) - $user->data['message_limit'])); $delete_ids = array(); @@ -668,6 +689,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) } $db->sql_query('UPDATE ' . USERS_TABLE . " SET $set_sql WHERE user_id = $user_id"); + $user->data['user_new_privmsg'] -= $num_new; $user->data['user_unread_privmsg'] -= $num_unread; } @@ -778,7 +800,7 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id) return; } - global $db; + global $db, $user; $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . " SET pm_unread = 0 @@ -791,6 +813,11 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id) SET user_unread_privmsg = user_unread_privmsg - 1 WHERE user_id = $user_id"; $db->sql_query($sql); + + if ($user->data['user_id'] == $user_id) + { + $user->data['user_unread_privmsg']--; + } } /** @@ -860,7 +887,7 @@ function handle_mark_actions($user_id, $mark_action) */ function delete_pm($user_id, $msg_ids, $folder_id) { - global $db; + global $db, $user; $user_id = (int) $user_id; $folder_id = (int) $folder_id; @@ -957,6 +984,7 @@ function delete_pm($user_id, $msg_ids, $folder_id) if ($num_unread || $num_new) { $set_sql = ($num_unread) ? 'user_unread_privmsg = user_unread_privmsg - ' . $num_unread : ''; + if ($num_new) { $set_sql .= ($set_sql != '') ? ', ' : ''; @@ -964,6 +992,9 @@ function delete_pm($user_id, $msg_ids, $folder_id) } $db->sql_query('UPDATE ' . USERS_TABLE . " SET $set_sql WHERE user_id = $user_id"); + + $user->data['user_new_privmsg'] -= $num_new; + $user->data['user_unread_privmsg'] -= $num_unread; } // Now we have to check which messages we can delete completely @@ -1141,7 +1172,7 @@ function write_pm_addresses($check_ary, $author_id, $plaintext = false) 'IS_USER' => ($type == 'user'), 'COLOUR' => ($row['colour']) ? $row['colour'] : '', 'UG_ID' => $id, - 'U_VIEW' => ($type == 'user') ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $id) : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $id), + 'U_VIEW' => ($type == 'user') ? (($id != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $id) : '') : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $id), 'TYPE' => $type) ); } @@ -1223,7 +1254,7 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr $id = (int) $id; // Do not rely on the address list being "valid" - if (!$id) + if (!$id || ($ug_type == 'u' && $id == ANONYMOUS)) { continue; } @@ -1291,8 +1322,7 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr 'enable_sig' => $data['enable_sig'], 'message_subject' => $subject, 'message_text' => $data['message'], - 'message_encoding' => $user->lang['ENCODING'], - 'message_attachment'=> (isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data'])) ? 1 : 0, + 'message_attachment'=> (!empty($data['attachment_data'])) ? 1 : 0, 'bbcode_bitfield' => $data['bbcode_bitfield'], 'bbcode_uid' => $data['bbcode_uid'], 'to_address' => implode(':', $to), @@ -1310,8 +1340,7 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr 'enable_sig' => $data['enable_sig'], 'message_subject' => $subject, 'message_text' => $data['message'], - 'message_encoding' => $user->lang['ENCODING'], - 'message_attachment'=> (isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data'])) ? 1 : 0, + 'message_attachment'=> (!empty($data['attachment_data'])) ? 1 : 0, 'bbcode_bitfield' => $data['bbcode_bitfield'], 'bbcode_uid' => $data['bbcode_uid'] ); @@ -1360,24 +1389,7 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr ); } - if (sizeof($sql_ary)) - { - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query('INSERT INTO ' . PRIVMSGS_TO_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); - break; - - default: - foreach ($sql_ary as $ary) - { - $db->sql_query('INSERT INTO ' . PRIVMSGS_TO_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; - } - } + $db->sql_multi_insert(PRIVMSGS_TO_TABLE, $sql_ary); $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new_privmsg = user_new_privmsg + 1, user_unread_privmsg = user_unread_privmsg + 1, user_last_privmsg = ' . time() . ' @@ -1416,52 +1428,74 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr if (!empty($data['attachment_data']) && $data['msg_id'] && in_array($mode, array('post', 'reply', 'quote', 'quotepost', 'edit', 'forward'))) { $space_taken = $files_added = 0; + $orphan_rows = array(); + + foreach ($data['attachment_data'] as $pos => $attach_row) + { + $orphan_rows[(int) $attach_row['attach_id']] = array(); + } + + if (sizeof($orphan_rows)) + { + $sql = 'SELECT attach_id, filesize, physical_filename + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', array_keys($orphan_rows)) . ' + AND in_message = 1 + AND is_orphan = 1 + AND poster_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + + $orphan_rows = array(); + while ($row = $db->sql_fetchrow($result)) + { + $orphan_rows[$row['attach_id']] = $row; + } + $db->sql_freeresult($result); + } foreach ($data['attachment_data'] as $pos => $attach_row) { - if ($attach_row['attach_id']) + if ($attach_row['is_orphan'] && !in_array($attach_row['attach_id'], array_keys($orphan_rows))) + { + continue; + } + + if (!$attach_row['is_orphan']) { // update entry in db if attachment already stored in db and filespace - $sql = 'UPDATE ' . ATTACHMENTS_TABLE . " - SET attach_comment = '" . $db->sql_escape($attach_row['attach_comment']) . "' - WHERE attach_id = " . (int) $attach_row['attach_id']; + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . " + SET attach_comment = '" . $db->sql_escape($attach_row['attach_comment']) . "' + WHERE attach_id = " . (int) $attach_row['attach_id'] . ' + AND is_orphan = 0'; $db->sql_query($sql); } else { - // insert attachment into db + // insert attachment into db + if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . basename($orphan_rows[$attach_row['attach_id']]['physical_filename']))) + { + continue; + } + + $space_taken += $orphan_rows[$attach_row['attach_id']]['filesize']; + $files_added++; + $attach_sql = array( 'post_msg_id' => $data['msg_id'], 'topic_id' => 0, - 'in_message' => 1, + 'is_orphan' => 0, 'poster_id' => $data['from_user_id'], - 'physical_filename' => basename($attach_row['physical_filename']), - 'real_filename' => basename($attach_row['real_filename']), 'attach_comment' => $attach_row['attach_comment'], - 'extension' => $attach_row['extension'], - 'mimetype' => $attach_row['mimetype'], - 'filesize' => $attach_row['filesize'], - 'filetime' => $attach_row['filetime'], - 'thumbnail' => $attach_row['thumbnail'] ); - $sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . - $db->sql_build_array('INSERT', $attach_sql); + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $attach_sql) . ' + WHERE attach_id = ' . $attach_row['attach_id'] . ' + AND is_orphan = 1 + AND poster_id = ' . $user->data['user_id']; $db->sql_query($sql); - - $space_taken += $attach_row['filesize']; - $files_added++; } } - if (sizeof($data['attachment_data'])) - { - $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' - SET message_attachment = 1 - WHERE msg_id = ' . $data['msg_id']; - $db->sql_query($sql); - } - if ($space_taken && $files_added) { set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true); @@ -1553,8 +1587,6 @@ function pm_notification($mode, $author, $recipients, $subject, $message) include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $messenger = new messenger(); - $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); - foreach ($msg_list_ary as $pos => $addr) { $messenger->template('privmsg_notify', $addr['lang']); @@ -1564,11 +1596,9 @@ function pm_notification($mode, $author, $recipients, $subject, $message) $messenger->im($addr['jabber'], $addr['name']); $messenger->assign_vars(array( - 'EMAIL_SIG' => $email_sig, - 'SITENAME' => $config['sitename'], - 'SUBJECT' => html_entity_decode($subject), - 'AUTHOR_NAME' => html_entity_decode($author), - 'USERNAME' => html_entity_decode($addr['name']), + 'SUBJECT' => htmlspecialchars_decode($subject), + 'AUTHOR_NAME' => htmlspecialchars_decode($author), + 'USERNAME' => htmlspecialchars_decode($addr['name']), 'U_INBOX' => generate_board_url() . "/ucp.$phpEx?i=pm&folder=inbox") ); diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 6f71724754..b35781e198 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -21,7 +21,7 @@ class custom_profile /** * Assign editable fields to template, mode can be profile (for profile change) or register (for registration) * Called by ucp_profile and ucp_register - * @access: public + * @access public */ function generate_profile_fields($mode, $lang_id) { @@ -74,7 +74,7 @@ class custom_profile /** * Validate entered profile field data - * @access: public + * @access public */ function validate_profile_field($field_type, &$field_value, $field_data) { @@ -161,11 +161,11 @@ class custom_profile return 'FIELD_REQUIRED'; } - if ($field_data['field_minlen'] && strlen($field_value) < $field_data['field_minlen']) + if ($field_data['field_minlen'] && utf8_strlen($field_value) < $field_data['field_minlen']) { return 'FIELD_TOO_SHORT'; } - else if ($field_data['field_maxlen'] && strlen($field_value) > $field_data['field_maxlen']) + else if ($field_data['field_maxlen'] && utf8_strlen($field_value) > $field_data['field_maxlen']) { return 'FIELD_TOO_LONG'; } @@ -186,7 +186,7 @@ class custom_profile /** * Build profile cache, used for display - * @access: private + * @access private */ function build_cache() { @@ -248,7 +248,7 @@ class custom_profile /** * Submit profile field - * @access: public + * @access public */ function submit_cp_field($mode, $lang_id, &$cp_data, &$cp_error) { @@ -286,8 +286,8 @@ class custom_profile while ($row = $db->sql_fetchrow($result)) { - $cp_data['_' . $row['field_ident']] = $this->get_profile_field($row); - $check_value = $cp_data['_' . $row['field_ident']]; + $cp_data['pf_' . $row['field_ident']] = $this->get_profile_field($row); + $check_value = $cp_data['pf_' . $row['field_ident']]; if (($cp_result = $this->validate_profile_field($row['field_type'], $check_value, $row)) !== false) { @@ -340,7 +340,7 @@ class custom_profile /** * 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 + * @access public */ function generate_profile_fields_template($mode, $user_id = 0, $profile_row = false) { @@ -382,7 +382,7 @@ class custom_profile { foreach ($field_data as $user_id => $row) { - $user_fields[$user_id][$used_ident]['value'] = $row['_' . $used_ident]; + $user_fields[$user_id][$used_ident]['value'] = $row['pf_' . $used_ident]; $user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident]; } } @@ -535,14 +535,14 @@ class custom_profile /** * Get field value for registration/profile - * @access: private + * @access private */ function get_var($field_validation, &$profile_row, $default_value, $preview) { global $user; $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident']; - $user_ident = '_' . str_replace('pf_', '', $profile_row['field_ident']); + $user_ident = 'pf_' . str_replace('pf_', '', $profile_row['field_ident']); // checkbox - only testing for isset if ($profile_row['field_type'] == FIELD_BOOL && $profile_row['field_length'] == 2) @@ -576,6 +576,11 @@ class custom_profile else { $value = (isset($_REQUEST[$profile_row['field_ident']])) ? request_var($profile_row['field_ident'], $default_value, true) : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]); + + if (gettype($value) == 'string') + { + utf8_normalize_nfc(&$value); + } } switch ($field_validation) @@ -590,7 +595,7 @@ class custom_profile /** * Process int-type - * @access: private + * @access private */ function generate_int($profile_row, $preview = false) { @@ -602,14 +607,14 @@ class custom_profile /** * Process date-type - * @access: private + * @access private */ function generate_date($profile_row, $preview = false) { global $user, $template; $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident']; - $user_ident = '_' . str_replace('pf_', '', $profile_row['field_ident']); + $user_ident = 'pf_' . str_replace('pf_', '', $profile_row['field_ident']); $now = getdate(); @@ -661,7 +666,7 @@ class custom_profile /** * Process bool-type - * @access: private + * @access private */ function generate_bool($profile_row, $preview = false) { @@ -692,7 +697,7 @@ class custom_profile /** * Process string-type - * @access: private + * @access private */ function generate_string($profile_row, $preview = false) { @@ -704,7 +709,7 @@ class custom_profile /** * Process text-type - * @access: private + * @access private */ function generate_text($profile_row, $preview = false) { @@ -721,7 +726,7 @@ class custom_profile /** * Process dropdown-type - * @access: private + * @access private */ function generate_dropdown($profile_row, $preview = false) { @@ -750,7 +755,7 @@ class custom_profile /** * Return Templated value/field. Possible values for $mode are: * change == user is able to set/enter profile values; preview == just show the value - * @access: private + * @access private */ function process_field_row($mode, $profile_row) { @@ -787,7 +792,7 @@ class custom_profile $sql_not_in = array(); foreach ($cp_data as $key => $null) { - $sql_not_in[] = (strncmp($key, '_', 1) === 0) ? substr($key, 1) : $key; + $sql_not_in[] = (strncmp($key, 'pf_', 3) === 0) ? substr($key, 3) : $key; } $sql = 'SELECT f.field_type, f.field_ident, f.field_default_value, l.lang_default_value @@ -805,7 +810,7 @@ class custom_profile $row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']); } - $cp_data['_' . $row['field_ident']] = (in_array($row['field_type'], array(FIELD_TEXT, FIELD_STRING))) ? $row['lang_default_value'] : $row['field_default_value']; + $cp_data['pf_' . $row['field_ident']] = (in_array($row['field_type'], array(FIELD_TEXT, FIELD_STRING))) ? $row['lang_default_value'] : $row['field_default_value']; } $db->sql_freeresult($result); @@ -814,7 +819,7 @@ class custom_profile /** * Get profile field value on submit - * @access: private + * @access private */ function get_profile_field($profile_row) { @@ -861,6 +866,7 @@ class custom_profile case FIELD_STRING: case FIELD_TEXT: $var = request_var($var_name, $profile_row['field_default_value'], true); + utf8_normalize_nfc(&$var); break; case FIELD_INT: diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index 7f29c2a040..47ff906a28 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -52,7 +52,7 @@ class template_compile /** * Load template source from file - * @access: private + * @access private */ function _tpl_load_file($handle) { @@ -82,78 +82,19 @@ class template_compile */ function remove_php_tags(&$code) { - if (!function_exists('token_get_all')) - { - /** - * If the tokenizer extension is not available, try to load it and if - * it's still not available we fall back to some pattern replacement. - * - * Note that the pattern replacement may affect the well-formedness - * of the HTML if a PHP tag is found because even if we escape PHP - * opening tags we do NOT escape PHP closing tags and cannot do so - * reliably without the use of a full-blown tokenizer. - * - * The bottom line is, a template should NEVER contain PHP because it - * would comprise the security of the installation, that's why we - * prevent it from being executed. Our job is to secure the installation, - * not fix unsecure templates. if a template contains some PHP then it - * should not be used at all. - */ - @dl('tokenizer'); - - if (!function_exists('token_get_all')) - { - $match = array( - '\\?php[\n\r\s\t]+', - '[\\?%]=', - '[\\?%][^\w]', - 'script[\n\r\s\t]+language[\n\r\s\t]*=[\n\r\s\t]*[\'"]php[\'"]' - ); - - $code = preg_replace('#<(' . implode('|', $match) . ')#is', '<$1', $code); - return; - } - } - - do - { - $tokens = token_get_all('<?php ?>' . $code); - $code = ''; - $php_found = false; - - foreach ($tokens as $i => $token) - { - if (!is_array($token)) - { - $code .= $token; - } - else if ($token[0] == T_OPEN_TAG || $token[0] == T_OPEN_TAG_WITH_ECHO || $token[0] == T_CLOSE_TAG) - { - if ($i > 1) - { - $code .= htmlspecialchars($token[1]); - $php_found = true; - } - } - else - { - $code .= $token[1]; - } - } - unset($tokens); - - // Fix for a tokenizer oddity - if (!strncmp($code, '<?php ?>', 11)) - { - $code = substr($code, 11); - } - } - while ($php_found); + // This matches the information gathered from the internal PHP lexer + $match = array( + '#<([\?%])=?.*?\1>#s', + '#<script\s+language\s*=\s*(["\']?)php\1\s*>.*?</script\s*>#s', + '#<\?php(?:\r\n?|[ \n\t]).*?\?>#s' + ); + + $code = preg_replace($match, '', $code); } /** * The all seeing all doing compile method. Parts are inspired by or directly from Smarty - * @access: private + * @access private */ function compile($code, $no_echo = false, $echo_var = '') { @@ -169,12 +110,6 @@ class template_compile // php is a no-no. There is a potential issue here in that non-php // content may be removed ... however designers should use entities // if they wish to display < and > -/* - $match_php_tags = array('#\<\?php.*?\?\>#is', '#<[^\w<]*(script)(((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?(language[^<>\'"]+("[^"]*php[^"]*"|\'[^\']*php[^\']*\'))((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?)?>.*?</script>#is', '#\<\?.*?\?\>#s', '#\<%.*?%\>#s'); - $code = preg_replace($match_php_tags, '', $code); -*/ - - // An alternative to the above would be calling this function which would be the ultimate solution but also has its drawbacks. $this->remove_php_tags($code); // Pull out all block/statement level elements and seperate plain text @@ -279,14 +214,14 @@ class template_compile // There will be a number of occassions 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 - $template_php = str_replace(' ?><?php ', '', $template_php); + $template_php = str_replace(' ?><?php ', ' ', $template_php); return (!$no_echo) ? $template_php : "\$$echo_var .= '" . $template_php . "'"; } /** * Compile variables - * @access: private + * @access private */ function compile_var_tags(&$text_blocks) { @@ -328,7 +263,7 @@ class template_compile /** * Compile blocks - * @access: private + * @access private */ function compile_tag_block($tag_args) { @@ -419,7 +354,7 @@ class template_compile /** * Compile IF tags - much of this is from Smarty with * some adaptions for our block level methods - * @access: private + * @access private */ function compile_tag_if($tag_args, $elseif) { @@ -533,8 +468,10 @@ class template_compile } else if (preg_match('#^\.(([a-z0-9\-_]+\.?)+)$#s', $token, $varrefs)) { + // Allow checking if loops are set with .loopname + // It is also possible to check the loop count by doing <!-- IF .loopname > 1 --> for example $_tok = $this->generate_block_data_ref($varrefs[1], false); - $token = "(isset($_tok) && sizeof($_tok))"; + $token = "sizeof($_tok)"; } break; @@ -546,7 +483,7 @@ class template_compile /** * Compile DEFINE tags - * @access: private + * @access private */ function compile_tag_define($tag_args, $op) { @@ -599,7 +536,7 @@ class template_compile /** * Compile INCLUDE tag - * @access: private + * @access private */ function compile_tag_include($tag_args) { @@ -608,21 +545,21 @@ class template_compile /** * Compile INCLUDE_PHP tag - * @access: private + * @access private */ function compile_tag_include_php($tag_args) { - return "include('" . $this->template->root . '/' . $tag_args . "');"; + return "include('" . $tag_args . "');"; } /** * parse expression * This is from Smarty - * @access: private + * @access private */ function _parse_is_expr($is_arg, $tokens) { - $expr_end = 0; + $expr_end = 0; $negate_expr = false; if (($first_token = array_shift($tokens)) == 'not') @@ -641,12 +578,12 @@ class template_compile if (@$tokens[$expr_end] == 'by') { $expr_end++; - $expr_arg = $tokens[$expr_end++]; - $expr = "!(($is_arg / $expr_arg) % $expr_arg)"; + $expr_arg = $tokens[$expr_end++]; + $expr = "!(($is_arg / $expr_arg) % $expr_arg)"; } else { - $expr = "!($is_arg % 2)"; + $expr = "!($is_arg % 2)"; } break; @@ -654,12 +591,12 @@ class template_compile if (@$tokens[$expr_end] == 'by') { $expr_end++; - $expr_arg = $tokens[$expr_end++]; - $expr = "(($is_arg / $expr_arg) % $expr_arg)"; + $expr_arg = $tokens[$expr_end++]; + $expr = "(($is_arg / $expr_arg) % $expr_arg)"; } else { - $expr = "($is_arg % 2)"; + $expr = "($is_arg % 2)"; } break; @@ -667,18 +604,18 @@ class template_compile if (@$tokens[$expr_end] == 'by') { $expr_end++; - $expr_arg = $tokens[$expr_end++]; - $expr = "!($is_arg % $expr_arg)"; + $expr_arg = $tokens[$expr_end++]; + $expr = "!($is_arg % $expr_arg)"; } break; } if ($negate_expr) { - $expr = "!($expr)"; + $expr = "!($expr)"; } - array_splice($tokens, 0, $expr_end, $expr); + array_splice($tokens, 0, $expr_end, $expr); return $tokens; } @@ -689,7 +626,7 @@ class template_compile * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . ' * It's ready to be inserted into an "echo" line in one of the templates. * NOTE: expects a trailing "." on the namespace. - * @access: private + * @access private */ function generate_block_varref($namespace, $varname, $echo = true, $defop = false) { @@ -714,7 +651,7 @@ class template_compile * * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. * NOTE: does not expect a trailing "." on the blockname. - * @access: private + * @access private */ function generate_block_data_ref($blockname, $include_last_iterator, $defop = false) { @@ -743,7 +680,7 @@ class template_compile /** * Write compiled file to cache directory - * @access: private + * @access private */ function compile_write(&$handle, $data) { diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index d2cc95f728..00ef78f933 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -189,6 +189,24 @@ class transfer } /** + * Check if a specified file exist... + */ + function file_exists($directory, $filename) + { + global $phpbb_root_path; + + $directory = $this->root_path . str_replace($phpbb_root_path, '', $directory); + $result = $this->_ls($directory); + + if ($result !== false && is_array($result)) + { + return (in_array($filename, $result)) ? true : false; + } + + return false; + } + + /** * Open session */ function open_session() @@ -245,7 +263,7 @@ class ftp extends transfer // Make sure $this->root_path is layed out the same way as the $user->page['root_script_path'] value (/ at the end) $this->root_path = str_replace('\\', '/', $this->root_path); - $this->root_path = (($root_path{0} != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/'); + $this->root_path = (($root_path[0] != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/'); // Init some needed values transfer::transfer(); @@ -272,7 +290,7 @@ class ftp extends transfer /** * Init FTP Session - * @access: private + * @access private */ function _init() { @@ -304,7 +322,7 @@ class ftp extends transfer /** * Create Directory (MKDIR) - * @access: private + * @access private */ function _mkdir($dir) { @@ -313,7 +331,7 @@ class ftp extends transfer /** * Remove directory (RMDIR) - * @access: private + * @access private */ function _rmdir($dir) { @@ -322,7 +340,7 @@ class ftp extends transfer /** * Rename file - * @access: private + * @access private */ function _rename($old_handle, $new_handle) { @@ -331,7 +349,7 @@ class ftp extends transfer /** * Change current working directory (CHDIR) - * @access: private + * @access private */ function _chdir($dir = '') { @@ -345,7 +363,7 @@ class ftp extends transfer /** * change file permissions (CHMOD) - * @access: private + * @access private */ function _chmod($file, $perms) { @@ -364,7 +382,7 @@ class ftp extends transfer /** * Upload file to location (PUT) - * @access: private + * @access private */ function _put($from_file, $to_file) { @@ -386,7 +404,7 @@ class ftp extends transfer /** * Delete file (DELETE) - * @access: private + * @access private */ function _delete($file) { @@ -395,7 +413,7 @@ class ftp extends transfer /** * Close ftp session (CLOSE) - * @access: private + * @access private */ function _close() { @@ -410,7 +428,7 @@ class ftp extends transfer /** * Return current working directory (CWD) * At the moment not used by parent class - * @access: private + * @access private */ function _cwd() { @@ -419,8 +437,7 @@ class ftp extends transfer /** * Return list of files in a given directory (LS) - * At the moment not used by parent class - * @access: private + * @access private */ function _ls($dir = './') { @@ -429,7 +446,7 @@ class ftp extends transfer /** * FTP SITE command (ftp-only function) - * @access: private + * @access private */ function _site($command) { @@ -458,9 +475,9 @@ class ftp_fsock extends transfer $this->password = $password; $this->timeout = $timeout; - // Make sure $this->root_path is layed out the same way as the $user->page['root_script_path'] value (prefixed with / and no / at the end) + // Make sure $this->root_path is layed out the same way as the $user->page['root_script_path'] value (/ at the end) $this->root_path = str_replace('\\', '/', $this->root_path); - $this->root_path = (($root_path{0} != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/'); + $this->root_path = (($root_path[0] != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/'); // Init some needed values transfer::transfer(); @@ -487,7 +504,7 @@ class ftp_fsock extends transfer /** * Init FTP Session - * @access: private + * @access private */ function _init() { @@ -526,7 +543,7 @@ class ftp_fsock extends transfer /** * Create Directory (MKDIR) - * @access: private + * @access private */ function _mkdir($dir) { @@ -535,7 +552,7 @@ class ftp_fsock extends transfer /** * Remove directory (RMDIR) - * @access: private + * @access private */ function _rmdir($dir) { @@ -544,7 +561,7 @@ class ftp_fsock extends transfer /** * Rename File - * @access: private + * @access private */ function _rename($old_handle, $new_handle) { @@ -554,7 +571,7 @@ class ftp_fsock extends transfer /** * Change current working directory (CHDIR) - * @access: private + * @access private */ function _chdir($dir = '') { @@ -568,7 +585,7 @@ class ftp_fsock extends transfer /** * change file permissions (CHMOD) - * @access: private + * @access private */ function _chmod($file, $perms) { @@ -577,7 +594,7 @@ class ftp_fsock extends transfer /** * Upload file to location (PUT) - * @access: private + * @access private */ function _put($from_file, $to_file) { @@ -613,7 +630,7 @@ class ftp_fsock extends transfer /** * Delete file (DELETE) - * @access: private + * @access private */ function _delete($file) { @@ -622,7 +639,7 @@ class ftp_fsock extends transfer /** * Close ftp session (CLOSE) - * @access: private + * @access private */ function _close() { @@ -637,7 +654,7 @@ class ftp_fsock extends transfer /** * Return current working directory (CWD) * At the moment not used by parent class - * @access: private + * @access private */ function _cwd() { @@ -647,8 +664,7 @@ class ftp_fsock extends transfer /** * Return list of files in a given directory (LS) - * At the moment not used by parent class - * @access: private + * @access private */ function _ls($dir = './') { @@ -671,7 +687,7 @@ class ftp_fsock extends transfer /** * Send a command to server (FTP fsock only function) - * @access: private + * @access private */ function _send_command($command, $args = '', $check = true) { @@ -692,7 +708,7 @@ class ftp_fsock extends transfer /** * Opens a connection to send data (FTP fosck only function) - * @access: private + * @access private */ function _open_data_connection() { @@ -727,7 +743,7 @@ class ftp_fsock extends transfer /** * Closes a connection used to send data - * @access: private + * @access private */ function _close_data_connection() { @@ -736,7 +752,7 @@ class ftp_fsock extends transfer /** * Check to make sure command was successful (FTP fsock only function) - * @access: private + * @access private */ function _check_command($return = false) { diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 28701339e4..a7a76cf526 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -38,7 +38,7 @@ class filespec /** * File Class - * @access: private + * @access private */ function filespec($upload_ary, $upload_namespace) { @@ -138,7 +138,7 @@ class filespec /** * Check if the file got correctly uploaded * - * @return true if it is a valid upload and the file exist, false if not + * @return true if it is a valid upload, false if not */ function is_uploaded() { @@ -147,7 +147,12 @@ class filespec return false; } - return (file_exists($this->filename)) ? true : false; + if ($this->local && !file_exists($this->filename)) + { + return false; + } + + return true; } /** @@ -221,24 +226,27 @@ class filespec return false; } - // Adjust destination path (no trailing slash) - if ($destination{(sizeof($destination)-1)} == '/' || $destination{(sizeof($destination)-1)} == '\\') - { - $destination = substr($destination, 0, sizeof($destination)-2); - } + // We need to trust the admin in specifying valid upload directories and an attacker not being able to overwrite it... + $this->destination_path = $phpbb_root_path . $destination; - $destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination); - if ($destination && ($destination{0} == '/' || $destination{0} == "\\")) + // Check if the destination path exist... + if (!file_exists($this->destination_path)) { - $destination = ''; + @unlink($this->filename); + return false; } - $this->destination_path = $phpbb_root_path . $destination; - $upload_mode = (@ini_get('open_basedir') || @ini_get('safe_mode')) ? 'move' : 'copy'; $upload_mode = ($this->local) ? 'local' : $upload_mode; $this->destination_file = $this->destination_path . '/' . basename($this->realname); + // Check if the file already exist, else there is something wrong... + if (file_exists($this->destination_file)) + { + @unlink($this->filename); + return false; + } + switch ($upload_mode) { case 'copy': @@ -305,6 +313,25 @@ class filespec { $this->mimetype = $this->image_info['mime']; } + + // Check image type + $types = $this->upload->image_types(); + + if (!isset($types[$this->image_info[2]]) || !in_array($this->extension, $types[$this->image_info[2]])) + { + if (!isset($types[$this->image_info[2]])) + { + $this->error[] = sprintf($user->lang['IMAGE_FILETYPE_INVALID'], $this->image_info[2], $this->mimetype); + } + else + { + $this->error[] = sprintf($user->lang['IMAGE_FILETYPE_MISMATCH'], $types[$this->image_info[2]][0], $this->extension); + } + } + } + else + { + $this->error[] = $user->lang['UNABLE_GET_IMAGE_SIZE']; } } @@ -790,6 +817,31 @@ class fileupload { return (isset($_FILES[$form_name]) && $_FILES[$form_name]['name'] != 'none') ? true : false; } + + /** + * Return image type/extension mapping + */ + function image_types() + { + return array( + 1 => array('gif'), + 2 => array('jpg', 'jpeg'), + 3 => array('png'), + 4 => array('swf'), + 5 => array('psd'), + 6 => array('bmp'), + 7 => array('tif', 'tiff'), + 8 => array('tif', 'tiff'), + 9 => array('jpg', 'jpeg'), + 10 => array('jpg', 'jpeg'), + 11 => array('jpg', 'jpeg'), + 12 => array('jpg', 'jpeg'), + 13 => array('swc'), + 14 => array('iff'), + 15 => array('wbmp'), + 16 => array('xbm'), + ); + } } ?>
\ No newline at end of file diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index c03e92d0b0..15daa0c999 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -12,7 +12,7 @@ * Obtain user_ids from usernames or vice versa. Returns false on * success else the error string */ -function user_get_id_name(&$user_id_ary, &$username_ary) +function user_get_id_name(&$user_id_ary, &$username_ary, $only_active = false) { global $db; @@ -34,16 +34,22 @@ function user_get_id_name(&$user_id_ary, &$username_ary) $$which_ary = array($$which_ary); } - $sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', $$which_ary) : $$which_ary; + $sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', $$which_ary) : array_map('utf8_clean_string', $$which_ary); unset($$which_ary); $user_id_ary = $username_ary = array(); // Grab the user id/username records - $sql_where = ($which_ary == 'user_id_ary') ? 'user_id' : 'username'; + $sql_where = ($which_ary == 'user_id_ary') ? 'user_id' : 'username_clean'; $sql = 'SELECT user_id, username FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set($sql_where, $sql_in); + + if ($only_active) + { + $sql .= ' AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')'; + } + $result = $db->sql_query($sql); if (!($row = $db->sql_fetchrow($result))) @@ -134,6 +140,7 @@ function user_add($user_row, $cp_data = false) $sql_ary = array( 'username' => $user_row['username'], + 'username_clean' => utf8_clean_string($user_row['username']), 'user_password' => (isset($user_row['user_password'])) ? $user_row['user_password'] : '', 'user_email' => $user_row['user_email'], 'user_email_hash' => (int) crc32(strtolower($user_row['user_email'])) . strlen($user_row['user_email']), @@ -141,10 +148,6 @@ function user_add($user_row, $cp_data = false) 'user_type' => $user_row['user_type'], ); - /** - * @todo user_allow_email is not used anywhere. Think about removing it. - */ - // These are the additional vars able to be specified $additional_vars = array( 'user_permissions' => '', @@ -156,7 +159,10 @@ function user_add($user_row, $cp_data = false) 'user_actkey' => '', 'user_ip' => '', 'user_regdate' => time(), + 'user_passchg' => time(), + 'user_inactive_reason' => 0, + 'user_inactive_time' => 0, 'user_lastmark' => time(), 'user_lastvisit' => 0, 'user_lastpost_time' => 0, @@ -164,6 +170,7 @@ function user_add($user_row, $cp_data = false) 'user_posts' => 0, 'user_dst' => 0, 'user_colour' => '', + 'user_interests' => '', 'user_avatar' => '', 'user_avatar_type' => 0, 'user_avatar_width' => 0, @@ -179,7 +186,6 @@ function user_add($user_row, $cp_data = false) 'user_notify_pm' => 1, 'user_notify_type' => NOTIFY_EMAIL, 'user_allow_pm' => 1, - 'user_allow_email' => 1, 'user_allow_viewonline' => 1, 'user_allow_viewemail' => 1, 'user_allow_massemail' => 1, @@ -254,39 +260,67 @@ function user_add($user_row, $cp_data = false) */ function user_delete($mode, $user_id, $post_username = false) { - global $config, $db, $user, $auth; + global $cache, $config, $db, $user, $auth; + global $phpbb_root_path, $phpEx; $db->sql_transaction('begin'); switch ($mode) { case 'retain': + + if ($post_username === false) + { + $post_username = $user->lang['GUEST']; + } + $sql = 'UPDATE ' . FORUMS_TABLE . ' - SET forum_last_poster_id = ' . ANONYMOUS . (($post_username !== false) ? ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "'" : '') . " + SET forum_last_poster_id = ' . ANONYMOUS . ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "', forum_last_poster_colour = '' WHERE forum_last_poster_id = $user_id"; $db->sql_query($sql); $sql = 'UPDATE ' . POSTS_TABLE . ' - SET poster_id = ' . ANONYMOUS . (($post_username !== false) ? ", post_username = '" . $db->sql_escape($post_username) . "'" : '') . " + SET poster_id = ' . ANONYMOUS . ", post_username = '" . $db->sql_escape($post_username) . "' WHERE poster_id = $user_id"; $db->sql_query($sql); + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET post_edit_user = ' . ANONYMOUS . " + WHERE post_edit_user = $user_id"; + $db->sql_query($sql); + $sql = 'UPDATE ' . TOPICS_TABLE . ' - SET topic_poster = ' . ANONYMOUS . " + SET topic_poster = ' . ANONYMOUS . ", topic_first_poster_name = '" . $db->sql_escape($post_username) . "', topic_first_poster_colour = '' WHERE topic_poster = $user_id"; $db->sql_query($sql); $sql = 'UPDATE ' . TOPICS_TABLE . ' - SET topic_last_poster_id = ' . ANONYMOUS . (($post_username !== false) ? ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "'" : '') . " + SET topic_last_poster_id = ' . ANONYMOUS . ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "', topic_last_poster_colour = '' WHERE topic_last_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 + $sql = 'SELECT user_posts + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . $user_id; + $result = $db->sql_query($sql); + $num_posts = (int) $db->sql_fetchfield('user_posts'); + $db->sql_freeresult($result); + + // Update the post count for the anonymous user + if ($num_posts) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_posts = user_posts + ' . $num_posts . ' + WHERE user_id = ' . ANONYMOUS; + $db->sql_query($sql); + } break; case 'remove': if (!function_exists('delete_posts')) { - global $phpbb_root_path, $phpEx; include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); } @@ -334,7 +368,7 @@ function user_delete($mode, $user_id, $post_username = false) break; } - $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE); + $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE); foreach ($table_ary as $table) { @@ -343,6 +377,67 @@ function user_delete($mode, $user_id, $post_username = false) $db->sql_query($sql); } + $cache->destroy('sql', MODERATOR_CACHE_TABLE); + + include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); + + // Remove any undelivered mails... + $sql = 'SELECT msg_id, user_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE author_id = ' . $user_id . ' + AND folder_id = ' . PRIVMSGS_NO_BOX; + $result = $db->sql_query($sql); + + $undelivered_msg = $undelivered_user = array(); + while ($row = $db->sql_fetchrow($result)) + { + $undelivered_msg[] = $row['msg_id']; + $undelivered_user[$row['user_id']][] = true; + } + $db->sql_freeresult($result); + + if (sizeof($undelivered_msg)) + { + $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg); + $db->sql_query($sql); + } + + $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE author_id = ' . $user_id . ' + AND folder_id = ' . PRIVMSGS_NO_BOX; + $db->sql_query($sql); + + // Delete all to-informations + $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE user_id = ' . $user_id; + $db->sql_query($sql); + + // Set the remaining author id to anonymous - this way users are still able to read messages from users being removed + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' + SET author_id = ' . ANONYMOUS . ' + WHERE author_id = ' . $user_id; + $db->sql_query($sql); + + $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' + SET author_id = ' . ANONYMOUS . ' + WHERE author_id = ' . $user_id; + $db->sql_query($sql); + + foreach ($undelivered_user as $_user_id => $ary) + { + if ($_user_id == $user_id) + { + continue; + } + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new_privmsg = user_new_privmsg - ' . sizeof($ary) . ', + user_unread_privmsg = user_unread_privmsg - ' . sizeof($ary) . ' + WHERE user_id = ' . $_user_id; + $db->sql_query($sql); + } + // Reset newest user info if appropriate if ($config['newest_user_id'] == $user_id) { @@ -351,98 +446,96 @@ function user_delete($mode, $user_id, $post_username = false) set_config('num_users', $config['num_users'] - 1, true); - // Adjust last post info... - - $db->sql_transaction('commit'); return false; } /** -* Flips user_type from active to inactive and vice versa, handles -* group membership updates +* Flips user_type from active to inactive and vice versa, handles group membership updates +* +* @param string $mode can be flip for flipping from active/inactive, activate or deactivate */ -function user_active_flip($user_id, $user_type, $user_actkey = false, $username = false, $no_log = false) +function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL) { - global $db, $user, $auth; + global $config, $db, $user, $auth; - $sql = 'SELECT group_id, group_name - FROM ' . GROUPS_TABLE . " - WHERE group_name IN ('REGISTERED', 'REGISTERED_COPPA', 'INACTIVE', 'INACTIVE_COPPA')"; - $result = $db->sql_query($sql); + $deactivated = $activated = 0; + $sql_statements = array(); - $group_id_ary = array(); - while ($row = $db->sql_fetchrow($result)) + if (!is_array($user_id_ary)) { - $group_id_ary[$row['group_name']] = $row['group_id']; + $user_id_ary = array($user_id_ary); + } + + if (!sizeof($user_id_ary)) + { + return; } - $db->sql_freeresult($result); - $sql = 'SELECT group_id - FROM ' . USER_GROUP_TABLE . " - WHERE user_id = $user_id"; + $sql = 'SELECT user_id, group_id, user_type, user_inactive_reason + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $user_id_ary); $result = $db->sql_query($sql); - $group_name = ($user_type == USER_NORMAL) ? 'REGISTERED' : 'INACTIVE'; while ($row = $db->sql_fetchrow($result)) { - if ($name = array_search($row['group_id'], $group_id_ary)) + $sql_ary = array(); + + if ($row['user_type'] == USER_IGNORE || $row['user_type'] == USER_FOUNDER || + ($mode == 'activate' && $row['user_type'] != USER_INACTIVE) || + ($mode == 'deactivate' && $row['user_type'] == USER_INACTIVE)) { - $group_name = $name; - break; + continue; } - } - $db->sql_freeresult($result); - $current_group = ($user_type == USER_NORMAL) ? 'REGISTERED' : 'INACTIVE'; - $switch_group = ($user_type == USER_NORMAL) ? 'INACTIVE' : 'REGISTERED'; + if ($row['user_type'] == USER_INACTIVE) + { + $activated++; + } + else + { + $deactivated++; - $new_group_id = $group_id_ary[str_replace($current_group, $switch_group, $group_name)]; + // Remove the users session key... + $user->reset_login_keys($row['user_id']); + } - $sql = 'UPDATE ' . USER_GROUP_TABLE . " - SET group_id = $new_group_id - WHERE user_id = $user_id - AND group_id = " . $group_id_ary[$group_name]; - $db->sql_query($sql); + $sql_ary += array( + 'user_type' => ($row['user_type'] == USER_NORMAL) ? USER_INACTIVE : USER_NORMAL, + 'user_inactive_time' => ($row['user_type'] == USER_NORMAL) ? time() : 0, + 'user_inactive_reason' => ($row['user_type'] == USER_NORMAL) ? $reason : 0, + ); - $sql_ary = array( - 'user_type' => ($user_type == USER_NORMAL) ? USER_INACTIVE : USER_NORMAL - ); + $sql_statements[$row['user_id']] = $sql_ary; + } + $db->sql_freeresult($result); - if ($new_group_id == $group_id_ary[$group_name]) + if (sizeof($sql_statements)) { - $sql_ary['group_id'] = $new_group_id; + foreach ($sql_statements as $user_id => $sql_ary) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . $user_id; + $db->sql_query($sql); + } + + $auth->acl_clear_prefetch(array_keys($sql_statements)); } - if ($user_actkey !== false) + if ($deactivated) { - $sql_ary['user_actkey'] = $user_actkey; + set_config('num_users', $config['num_users'] - $deactivated, true); } - $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " - WHERE user_id = $user_id"; - $db->sql_query($sql); - - $auth->acl_clear_prefetch($user_id); - - if (!$no_log) + if ($activated) { - if ($username === false) - { - $sql = 'SELECT username - FROM ' . USERS_TABLE . " - WHERE user_id = $user_id"; - $result = $db->sql_query($sql); - $username = (string) $db->sql_fetchfield('username'); - $db->sql_freeresult($result); - } - - $log = ($user_type == USER_NORMAL) ? 'LOG_USER_INACTIVE' : 'LOG_USER_ACTIVE'; - add_log('admin', $log, $username); + set_config('num_users', $config['num_users'] + $activated, true); } - return false; + // Update latest username + update_last_username(); } /** @@ -528,7 +621,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas $username = trim($username); if ($username != '') { - $sql_usernames[] = strtolower($username); + $sql_usernames[] = utf8_clean_string($username); } } @@ -540,11 +633,16 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas $sql = 'SELECT user_id FROM ' . USERS_TABLE . ' - WHERE ' . $db->sql_in_set('LOWER(username)', $sql_usernames); + WHERE ' . $db->sql_in_set('username_clean', $sql_usernames); + // Do not allow banning yourself if (sizeof($founder)) { - $sql .= ' AND ' . $db->sql_in_set('user_id', array_keys($founder), true); + $sql .= ' AND ' . $db->sql_in_set('user_id', array_merge(array_keys($founder), array($user->data['user_id'])), true); + } + else + { + $sql .= ' AND user_id <> ' . $user->data['user_id']; } $result = $db->sql_query($sql); @@ -736,24 +834,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas ); } - if (sizeof($sql_ary)) - { - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query('INSERT INTO ' . BANLIST_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); - break; - - default: - foreach ($sql_ary as $ary) - { - $db->sql_query('INSERT INTO ' . BANLIST_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; - } - } + $db->sql_multi_insert(BANLIST_TABLE, $sql_ary); // If we are banning we want to logout anyone matching the ban if (!$ban_exclude) @@ -973,11 +1054,11 @@ function validate_string($string, $optional = false, $min = 0, $max = 0) return false; } - if ($min && strlen($string) < $min) + if ($min && utf8_strlen(htmlspecialchars_decode($string)) < $min) { return 'TOO_SHORT'; } - else if ($max && strlen($string) > $max) + else if ($max && utf8_strlen(htmlspecialchars_decode($string)) > $max) { return 'TOO_LONG'; } @@ -1034,25 +1115,28 @@ function validate_match($string, $optional = false, $match) * Also checks if it includes the " character, which we don't allow in usernames. * Used for registering, changing names, and posting anonymously with a username * +* @todo do we really check and disallow the " character in usernames as written above. Has it only be forgotten to include the check? * @return boolean|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) */ function validate_username($username) { - global $config, $db, $user; + global $config, $db, $user, $cache; - if (strtolower($user->data['username']) == strtolower($username)) + $clean_username = utf8_clean_string($username); + + if (utf8_clean_string($user->data['username']) == $clean_username) { return false; } - if (!preg_match('#^' . str_replace('\\\\', '\\', $config['allow_name_chars']) . '$#i', $username)) + if (!preg_match('#^' . str_replace('\\\\', '\\', $config['allow_name_chars']) . '$#i', $username) || strpos($username, '"') !== false || strpos($username, '"') !== false) { return 'INVALID_CHARS'; } $sql = 'SELECT username FROM ' . USERS_TABLE . " - WHERE LOWER(username) = '" . strtolower($db->sql_escape($username)) . "'"; + WHERE username_clean = '" . $db->sql_escape($clean_username) . "'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -1064,7 +1148,7 @@ function validate_username($username) $sql = 'SELECT group_name FROM ' . GROUPS_TABLE . " - WHERE LOWER(group_name) = '" . strtolower($db->sql_escape($username)) . "'"; + WHERE LOWER(group_name) = '" . $db->sql_escape(utf8_strtolower($username)) . "'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -1074,19 +1158,16 @@ function validate_username($username) return 'USERNAME_TAKEN'; } - $sql = 'SELECT disallow_username - FROM ' . DISALLOW_TABLE; - $result = $db->sql_query($sql); - while ($row = $db->sql_fetchrow($result)) + $bad_usernames = $cache->obtain_disallowed_usernames(); + + foreach ($bad_usernames as $bad_username) { - if (preg_match('#^' . str_replace('%', '.*?', preg_quote($row['disallow_username'], '$#')) . '#i', $username)) + if (preg_match('#^' . $bad_username . '#', $clean_username)) { - $db->sql_freeresult($result); return 'USERNAME_DISALLOWED'; } } - $db->sql_freeresult($result); $sql = 'SELECT word FROM ' . WORDS_TABLE; @@ -1106,6 +1187,29 @@ function validate_username($username) } /** +* Check to see if the password meets the complexity settings +* +* @return boolean|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) +*/ +function validate_password($password) +{ + global $config, $db, $user; + + if (!$password) + { + return false; + } + + // We only check for existance of characters + if (!preg_match('#' . str_replace('\\\\', '\\', $config['pass_complex']) . '#i', $password)) + { + return 'INVALID_CHARS'; + } + + return false; +} + +/** * Check to see if email address is banned or already present in the DB * * @return boolean|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) @@ -1124,6 +1228,18 @@ function validate_email($email) return 'EMAIL_INVALID'; } + // Check MX record. + // The idea for this is from reading the UseBB blog/announcement. :) + if ($config['email_check_mx']) + { + list(, $domain) = explode('@', $email); + + if (phpbb_checkdnsrr($domain, 'MX') === false) + { + return 'DOMAIN_NO_MX_RECORD'; + } + } + if ($user->check_ban(false, false, $email, true) == true) { return 'EMAIL_BANNED'; @@ -1150,13 +1266,23 @@ function validate_email($email) /** * Remove avatar */ -function avatar_delete($id) +function avatar_delete($mode, $row) { global $phpbb_root_path, $config, $db, $user; - if (file_exists($phpbb_root_path . $config['avatar_path'] . '/' . basename($id))) + // Check if the users avatar is actually *not* a group avatar + if ($mode == 'user') { - @unlink($phpbb_root_path . $config['avatar_path'] . '/' . basename($id)); + if (strpos($row['user_avatar'], 'g' . $row['group_id'] . '_') === 0 || strpos($row['user_avatar'], $row['user_id'] . '_') !== 0) + { + return false; + } + } + + if (file_exists($phpbb_root_path . $config['avatar_path'] . '/' . basename($row[$mode . '_avatar']))) + { + @unlink($phpbb_root_path . $config['avatar_path'] . '/' . basename($row[$mode . '_avatar'])); + return true; } return false; @@ -1167,7 +1293,7 @@ function avatar_delete($id) */ function avatar_remote($data, &$error) { - global $config, $db, $user, $phpbb_root_path; + global $config, $db, $user, $phpbb_root_path, $phpEx; if (!preg_match('#^(http|https|ftp)://#i', $data['remotelink'])) { @@ -1196,6 +1322,24 @@ function avatar_remote($data, &$error) return false; } + // Check image type + include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx); + $types = fileupload::image_types(); + $extension = strtolower(filespec::get_extension($data['remotelink'])); + + if (!isset($types[$image_data[2]]) || !in_array($extension, $types[$image_data[2]])) + { + if (!isset($types[$image_data[2]])) + { + $error[] = $user->lang['UNABLE_GET_IMAGE_SIZE']; + } + else + { + $error[] = sprintf($user->lang['IMAGE_FILETYPE_MISMATCH'], $types[$image_data[2]][0], $extension); + } + return false; + } + if ($config['avatar_max_width'] || $config['avatar_max_height']) { if ($width > $config['avatar_max_width'] || $height > $config['avatar_max_height']) @@ -1238,7 +1382,21 @@ function avatar_upload($data, &$error) } $file->clean_filename('real', $data['user_id'] . '_'); - $file->move_file($config['avatar_path']); + + $destination = $config['avatar_path']; + + if ($destination{(sizeof($destination)-1)} == '/' || $destination{(sizeof($destination)-1)} == '\\') + { + $destination = substr($destination, 0, sizeof($destination)-2); + } + + $destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination); + if ($destination && ($destination[0] == '/' || $destination[0] == "\\")) + { + $destination = ''; + } + + $file->move_file($destination); if (sizeof($file->error)) { @@ -1272,7 +1430,7 @@ function avatar_gallery($category, $avatar_select, $items_per_column, $block_var while (($file = readdir($dp)) !== false) { - if ($file{0} != '.' && is_dir("$path/$file")) + if ($file[0] != '.' && is_dir("$path/$file")) { $avatar_row_count = $avatar_col_count = 0; @@ -1376,12 +1534,12 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow $group_only_ary = array('group_receive_pm', 'group_legend', 'group_message_limit'); // Check data - if (!strlen($name) || strlen($name) > 40) + if (!utf8_strlen($name) || utf8_strlen($name) > 40) { - $error[] = (!strlen($name)) ? $user->lang['GROUP_ERR_USERNAME'] : $user->lang['GROUP_ERR_USER_LONG']; + $error[] = (!utf8_strlen($name)) ? $user->lang['GROUP_ERR_USERNAME'] : $user->lang['GROUP_ERR_USER_LONG']; } - if (strlen($desc) > 255) + if (utf8_strlen($desc) > 255) { $error[] = $user->lang['GROUP_ERR_DESC_LONG']; } @@ -1455,33 +1613,30 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow continue; } - $sql_ary[str_replace('group', 'user', $attribute)] = $group_attributes[$attribute]; + $sql_ary[$attribute] = $group_attributes[$attribute]; } } } if (sizeof($sql_ary)) { - // Before we update the user attributes, we will make a list of those having now the group avatar assigned - if (in_array('user_avatar', array_keys($sql_ary))) - { - // Ok, get the original avatar data from users having an uploaded one (we need to remove these from the filesystem) - $sql = 'SELECT user_id, user_avatar - FROM ' . USERS_TABLE . ' - WHERE group_id = ' . $group_id . ' - AND user_avatar_type = ' . AVATAR_UPLOAD; - $result = $db->sql_query($sql); + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . ' + WHERE group_id = ' . $group_id; + $result = $db->sql_query($sql); - while ($row = $db->sql_fetchrow($result)) - { - avatar_delete($row['user_avatar']); - } - $db->sql_freeresult($result); + $user_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $user_ary[] = $row['user_id']; } - $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " - WHERE group_id = $group_id"; - $db->sql_query($sql); + $db->sql_freeresult($result); + + if (sizeof($user_ary)) + { + group_set_user_default($group_id, $user_ary, $sql_ary); + } } $name = ($type == GROUP_SPECIAL) ? $user->lang['G_' . $name] : $name; @@ -1496,7 +1651,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow */ function group_delete($group_id, $group_name = false) { - global $db; + global $db, $phpbb_root_path, $phpEx; if (!$group_name) { @@ -1548,6 +1703,11 @@ function group_delete($group_id, $group_name = false) $db->sql_query($sql); // Re-cache moderators + if (!function_exists('cache_moderators')) + { + include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } + cache_moderators(); add_log('admin', 'LOG_GROUP_DELETE', $group_name); @@ -1557,6 +1717,8 @@ function group_delete($group_id, $group_name = false) /** * Add user(s) to group +* +* @return false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER' */ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $default = false, $leader = 0, $pending = 0, $group_attributes = false) { @@ -1580,11 +1742,11 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $add_id_ary = $update_id_ary = array(); while ($row = $db->sql_fetchrow($result)) { - $add_id_ary[] = $row['user_id']; + $add_id_ary[] = (int) $row['user_id']; if ($leader && !$row['group_leader']) { - $update_id_ary[] = $row['user_id']; + $update_id_ary[] = (int) $row['user_id']; } } $db->sql_freeresult($result); @@ -1598,31 +1760,24 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, return 'GROUP_USERS_EXIST'; } + $db->sql_transaction('begin'); + + // Insert the new users if (sizeof($add_id_ary)) { - // Insert the new users - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - case 'mssql': - case 'mssql_odbc': - case 'sqlite': - $sql = 'INSERT INTO ' . USER_GROUP_TABLE . " (user_id, group_id, group_leader, user_pending) - VALUES " . implode(', ', preg_replace('#^([0-9]+)$#', "(\\1, $group_id, $leader, $pending)", $add_id_ary)); - $db->sql_query($sql); - break; + $sql_ary = array(); - default: - foreach ($add_id_ary as $user_id) - { - $sql = 'INSERT INTO ' . USER_GROUP_TABLE . " (user_id, group_id, group_leader, user_pending) - VALUES ($user_id, $group_id, $leader, $pending)"; - $db->sql_query($sql); - } - break; + foreach ($add_id_ary as $user_id) + { + $sql_ary[] = array( + 'user_id' => $user_id, + 'group_id' => $group_id, + 'group_leader' => $leader, + 'user_pending' => $pending, + ); } + + $db->sql_multi_insert(USER_GROUP_TABLE, $sql_ary); } if (sizeof($update_id_ary)) @@ -1639,6 +1794,8 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, group_set_user_default($group_id, $user_id_ary, $group_attributes); } + $db->sql_transaction('commit'); + // Clear permissions cache of relevant users $auth->acl_clear_prefetch($user_id_ary); @@ -1651,13 +1808,18 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, add_log('admin', $log, $group_name, implode(', ', $username_ary)); - return ($leader) ? 'GROUP_LEADERS_ADDED' : 'GROUP_USERS_ADDED'; + group_update_listings($group_id); + + // Return false - no error + return false; } /** * Remove a user/s from a given group. When we remove users we update their * default group_id. We do this by examining which "special" groups they belong * to. The selection is made based on a reasonable priority system +* +* @return false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER' */ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false) { @@ -1684,18 +1846,18 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_order_id[$row['group_name']] = $row['group_id']; $special_group_data[$row['group_id']] = array( - 'user_colour' => $row['group_colour'], - 'user_rank' => $row['group_rank'], + 'group_colour' => $row['group_colour'], + 'group_rank' => $row['group_rank'], ); // Only set the group avatar if one is defined... if ($row['group_avatar']) { $special_group_data[$row['group_id']] = array_merge($special_group_data[$row['group_id']], array( - 'user_avatar' => $row['group_avatar'], - 'user_avatar_type' => $row['group_avatar_type'], - 'user_avatar_width' => $row['group_avatar_width'], - 'user_avatar_height' => $row['group_avatar_height']) + 'group_avatar' => $row['group_avatar'], + 'group_avatar_type' => $row['group_avatar_type'], + 'group_avatar_width' => $row['group_avatar_width'], + 'group_avatar_height' => $row['group_avatar_height']) ); } } @@ -1745,28 +1907,7 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, { if (isset($sql_where_ary[$gid]) && sizeof($sql_where_ary[$gid])) { - $special_group_data[$gid]['group_id'] = $gid; - - // Before we update the user attributes, we will make a list of those having now the group avatar assigned - if (in_array('user_avatar', array_keys($special_group_data[$gid]))) - { - // Ok, get the original avatar data from users having an uploaded one (we need to remove these from the filesystem) - $sql = 'SELECT user_id, user_avatar - FROM ' . USERS_TABLE . ' - WHERE ' . $db->sql_in_set('user_id', $sql_where_ary[$gid]) . ' - AND user_avatar_type = ' . AVATAR_UPLOAD; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - avatar_delete($row['user_avatar']); - } - $db->sql_freeresult($result); - } - - $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $special_group_data[$gid]) . ' - WHERE ' . $db->sql_in_set('user_id', $sql_where_ary[$gid]); - $db->sql_query($sql); + group_set_user_default($gid, $sql_where_ary[$gid], $special_group_data[$gid]); } } unset($special_group_data); @@ -1788,7 +1929,8 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, add_log('admin', $log, $group_name, implode(', ', $username_ary)); - return 'GROUP_USERS_REMOVE'; + // Return false - no error + return false; } /** @@ -1857,8 +1999,6 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $messenger = new messenger(); - $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); - foreach ($email_users as $row) { $messenger->template('group_approved', $row['user_lang']); @@ -1868,11 +2008,8 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna $messenger->im($row['user_jabber'], $row['username']); $messenger->assign_vars(array( - 'EMAIL_SIG' => $email_sig, - 'SITENAME' => $config['sitename'], - 'USERNAME' => html_entity_decode($row['username']), - 'GROUP_NAME' => html_entity_decode($group_name), - + 'USERNAME' => htmlspecialchars_decode($row['username']), + 'GROUP_NAME' => htmlspecialchars_decode($group_name), 'U_GROUP' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=membership") ); @@ -1954,7 +2091,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal if (in_array('user_avatar', array_keys($sql_ary))) { // Ok, get the original avatar data from users having an uploaded one (we need to remove these from the filesystem) - $sql = 'SELECT user_id, user_avatar + $sql = 'SELECT user_id, group_id, user_avatar FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $user_id_ary) . ' AND user_avatar_type = ' . AVATAR_UPLOAD; @@ -1962,7 +2099,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal while ($row = $db->sql_fetchrow($result)) { - avatar_delete($row['user_avatar']); + avatar_delete('user', $row); } $db->sql_freeresult($result); } @@ -1970,6 +2107,22 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE ' . $db->sql_in_set('user_id', $user_id_ary); $db->sql_query($sql); + + if (in_array('user_colour', array_keys($sql_ary))) + { + // Update any cached colour information for these users + $sql = 'UPDATE ' . FORUMS_TABLE . " SET forum_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' + WHERE " . $db->sql_in_set('forum_last_poster_id', $user_id_ary); + $db->sql_query($sql); + + $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_first_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' + WHERE " . $db->sql_in_set('topic_poster', $user_id_ary); + $db->sql_query($sql); + + $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' + WHERE " . $db->sql_in_set('topic_last_poster_id', $user_id_ary); + $db->sql_query($sql); + } } /** @@ -2062,4 +2215,64 @@ function group_memberships($group_id_ary = false, $user_id_ary = false, $return_ return $return; } +/** +* Re-cache moderators and foes if group has a_ or m_ permissions +*/ +function group_update_listings($group_id) +{ + global $auth; + + $hold_ary = $auth->acl_group_raw_data($group_id, array('a_', 'm_')); + + if (!sizeof($hold_ary)) + { + return; + } + + $mod_permissions = $admin_permissions = false; + + foreach ($hold_ary as $g_id => $forum_ary) + { + foreach ($forum_ary as $forum_id => $auth_ary) + { + foreach ($auth_ary as $auth_option => $setting) + { + if ($mod_permissions && $admin_permissions) + { + break 3; + } + + if ($setting != ACL_YES) + { + continue; + } + + if ($auth_option == 'm_') + { + $mod_permissions = true; + } + + if ($auth_option == 'a_') + { + $admin_permissions = true; + } + } + } + } + + if ($mod_permissions) + { + if (!function_exists('cache_moderators')) + { + include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } + cache_moderators(); + } + + if ($mod_permissions || $admin_permissions) + { + update_foes(); + } +} + ?>
\ No newline at end of file diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 09470b8269..b20bd63a08 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -74,6 +74,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) 'S_CAN_LOCK' => $auth->acl_get('m_lock', $forum_id), 'S_CAN_SYNC' => $auth->acl_get('m_', $forum_id), 'S_CAN_APPROVE' => $auth->acl_get('m_approve', $forum_id), + 'S_MERGE_SELECT' => ($action == 'merge_select') ? true : false, 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), 'U_VIEW_FORUM_LOGS' => ($auth->acl_gets('a_', 'm_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&mode=forum_logs&f=' . $forum_id) : '', @@ -86,8 +87,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) ); // Grab icons - $icons = array(); - $cache->obtain_icons($icons); + $icons = $cache->obtain_icons(); $topic_rows = array(); @@ -117,8 +117,8 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $topic_title = censor_text($row['topic_title']); - $topic_unapproved = (!$row['topic_approved'] && $auth->acl_gets('m_approve', $row['forum_id'])) ? true : false; - $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_gets('m_approve', $row['forum_id'])) ? true : false; + $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false; + $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false; $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? $url . '&i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . '&t=' . $row['topic_id'] : ''; $template->assign_block_vars('topicrow', array( @@ -129,7 +129,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) 'U_MCP_QUEUE' => $u_mcp_queue, 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=topic_view&t=' . $row['topic_id'] . '&action=reports'), - 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', @@ -144,7 +144,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) 'TOPIC_ID' => $row['topic_id'], 'S_TOPIC_CHECKED' => ($topic_id_list && in_array($row['topic_id'], $topic_id_list)) ? 'checked="checked" ' : '', - 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_report', $row['forum_id'])) ? true : false, + 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false, 'S_TOPIC_UNAPPROVED' => $topic_unapproved, 'S_POSTS_UNAPPROVED' => $posts_unapproved) ); @@ -191,7 +191,7 @@ function mcp_resync_topics($topic_ids) $redirect = request_var('redirect', $user->data['session_page']); - meta_refresh(2, $redirect); + meta_refresh(3, $redirect); trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); return; diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index 745b2c0d61..8b798fc1b2 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -114,7 +114,7 @@ function mcp_front_view($id, $mode, $action) } // Latest 5 reported - $forum_list = get_forum_list('m_'); + $forum_list = get_forum_list('m_report'); $template->assign_var('S_SHOW_REPORTS', (!empty($forum_list)) ? true : false); diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index b77c3e4451..1fe9233ba9 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -207,9 +207,18 @@ function lock_unlock($action, $ids) $l_prefix = 'POST'; } - if (!($forum_id = check_ids($ids, $table, $sql_id, array('f_user_lock', 'm_lock')))) + if (!($forum_id = check_ids($ids, $table, $sql_id, array('m_lock')))) { - return; + // Make sure that for f_user_lock only the lock action is triggered. + if ($action != 'lock') + { + return; + } + + if (!($forum_id = check_ids($ids, $table, $sql_id, array('f_user_lock')))) + { + return; + } } $redirect = request_var('redirect', $user->data['session_page']); @@ -474,8 +483,17 @@ function mcp_move_topic($topic_ids) $forum_ids[] = $row['forum_id']; add_log('mod', $to_forum_id, $topic_id, 'LOG_MOVE', $row['forum_name']); + // If we have moved a global announcement, we need to correct the topic type + if ($row['topic_type'] == POST_GLOBAL) + { + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_type = ' . POST_ANNOUNCE . ' + WHERE topic_id = ' . (int) $row['topic_id']; + $db->sql_query($sql); + } + // Leave a redirection if required and only if the topic is visible to users - if ($leave_shadow && $row['topic_approved']) + if ($leave_shadow && $row['topic_approved'] && $row['topic_type'] != POST_GLOBAL) { $shadow = array( 'forum_id' => (int) $row['forum_id'], @@ -884,7 +902,6 @@ function mcp_fork_topic($topic_ids) 'post_edit_reason' => (string) $row['post_edit_reason'], 'post_edit_user' => (int) $row['post_edit_user'], 'post_checksum' => (string) $row['post_checksum'], - 'post_encoding' => (string) $row['post_encoding'], 'post_attachment' => (int) $row['post_attachment'], 'bbcode_bitfield' => $row['bbcode_bitfield'], 'bbcode_uid' => (string) $row['bbcode_uid'], diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index cc4ed0e72b..302ace9755 100755 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -68,13 +68,13 @@ class mcp_notes global $template, $db, $user, $auth; $user_id = request_var('u', 0); - $username = request_var('username', ''); + $username = request_var('username', '', true); $start = request_var('start', 0); $st = request_var('st', 0); $sk = request_var('sk', 'b'); $sd = request_var('sd', 'd'); - $sql_where = ($user_id) ? "user_id = $user_id" : "username = '" . $db->sql_escape($username) . "'"; + $sql_where = ($user_id) ? "user_id = $user_id" : "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; $sql = 'SELECT * FROM ' . USERS_TABLE . " @@ -161,7 +161,7 @@ class mcp_notes $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('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_IP'], 'd' => $user->lang['SORT_ACTION']); - $sort_by_sql = array('a' => 'l.username', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation'); + $sort_by_sql = array('a' => 'u.username', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation'); $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 08bcc713f8..201137a9a4 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -42,7 +42,7 @@ function mcp_post_details($id, $mode, $action) $whois = user_ipwhois($ip); $whois = preg_replace('#(\s)([\w\-\._\+]+@[\w\-\.]+)(\s)#', '\1<a href="mailto:\2">\2</a>\3', $whois); - $whois = preg_replace('#(\s)(http:/{2}[^\s]*)(\s)#', '\1<a href="\2" target="_blank">\2</a>\3', $whois); + $whois = preg_replace('#(\s)(http:/{2}[^\s]*)(\s)#', '\1<a href="\2">\2</a>\3', $whois); $template->assign_vars(array( 'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&p=$post_id") . '">', '</a>'), @@ -59,8 +59,8 @@ function mcp_post_details($id, $mode, $action) if ($action == 'chgposter') { - $username = request_var('username', ''); - $sql_where = "username = '" . $db->sql_escape($username) . "'"; + $username = request_var('username', '', true); + $sql_where = "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; } else { @@ -89,12 +89,13 @@ function mcp_post_details($id, $mode, $action) } // Set some vars - $users_ary = array(); + $users_ary = $usernames_ary = array(); $post_id = $post_info['post_id']; $poster = ($post_info['user_colour']) ? '<span style="color:#' . $post_info['user_colour'] . '">' . $post_info['username'] . '</span>' : $post_info['username']; // Process message, leave it uncensored $message = $post_info['post_text']; + $message = str_replace("\n", '<br />', $message); if ($post_info['bbcode_bitfield']) { include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); @@ -102,7 +103,6 @@ function mcp_post_details($id, $mode, $action) $bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']); } $message = smiley_text($message); - $message = str_replace("\n", '<br />', $message); $template->assign_vars(array( 'U_MCP_ACTION' => "$url&i=main&quickmod=1", // Use this for mode paramaters @@ -134,6 +134,7 @@ function mcp_post_details($id, $mode, $action) 'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']), 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']), 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']), + 'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']), 'POSTER_NAME' => $poster, 'POST_PREVIEW' => $message, @@ -217,75 +218,62 @@ function mcp_post_details($id, $mode, $action) } // Get other users who've posted under this IP + $sql = 'SELECT poster_id, COUNT(poster_id) as postings + FROM ' . POSTS_TABLE . " + WHERE poster_ip = '" . $db->sql_escape($post_info['poster_ip']) . "' + GROUP BY poster_id + ORDER BY postings DESC"; + $result = $db->sql_query($sql); - // Firebird does not support ORDER BY on aliased columns - // MySQL does not support ORDER BY on functions - switch (SQL_LAYER) + while ($row = $db->sql_fetchrow($result)) { - case 'firebird': - $sql = 'SELECT u.user_id, u.username, COUNT(*) as postings - FROM ' . USERS_TABLE . ' u, ' . POSTS_TABLE . " p - WHERE p.poster_id = u.user_id - AND p.poster_ip = '" . $db->sql_escape($post_info['poster_ip']) . "' - AND p.poster_id <> {$post_info['user_id']} - GROUP BY u.user_id, u.username - ORDER BY COUNT(*) DESC"; - break; - - default: - $sql = 'SELECT u.user_id, u.username, COUNT(*) as postings - FROM ' . USERS_TABLE . ' u, ' . POSTS_TABLE . " p - WHERE p.poster_id = u.user_id - AND p.poster_ip = '" . $db->sql_escape($post_info['poster_ip']) . "' - AND p.poster_id <> {$post_info['user_id']} - GROUP BY u.user_id, u.username - ORDER BY postings DESC"; - break; + // Fill the user select list with users who have posted under this IP + if ($row['poster_id'] != $post_info['poster_id']) + { + $users_ary[$row['poster_id']] = $row; + } } - $result = $db->sql_query($sql); + $db->sql_freeresult($result); - while ($row = $db->sql_fetchrow($result)) + if (sizeof($users_ary)) { - // Fill the user select list with users who have posted - // under this IP - if ($row['user_id'] != $post_info['poster_id']) + // Get the usernames + $sql = 'SELECT user_id, username + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', array_keys($users_ary)); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) { - $users_ary[strtolower($row['username'])] = $row; + $users_ary[$row['user_id']]['username'] = $row['username']; + $usernames_ary[utf8_clean_string($row['username'])] = $users_ary[$row['user_id']]; } + $db->sql_freeresult($result); - $template->assign_block_vars('userrow', array( - 'USERNAME' => ($row['user_id'] == ANONYMOUS) ? $user->lang['GUEST'] : $row['username'], - 'NUM_POSTS' => $row['postings'], - 'L_POST_S' => ($row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'], + foreach ($users_ary as $user_id => $user_row) + { + $template->assign_block_vars('userrow', array( + 'USERNAME' => ($user_id == ANONYMOUS) ? $user->lang['GUEST'] : $user_row['username'], + 'NUM_POSTS' => $user_row['postings'], + 'L_POST_S' => ($user_row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'], - 'U_PROFILE' => ($row['user_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), - 'U_SEARCHPOSTS' => append_sid("{$phpbb_root_path}search.$phpEx", 'author=' . urlencode($row['username']) . '&sr=topics')) - ); + 'U_PROFILE' => ($user_id == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $user_id), + 'U_SEARCHPOSTS' => append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $user_id . '&sr=topics')) + ); + } } - $db->sql_freeresult($result); // Get other IP's this user has posted under - // Firebird does not support ORDER BY on aliased columns - // MySQL does not support ORDER BY on functions - switch (SQL_LAYER) - { - case 'firebird': - $sql = 'SELECT poster_ip, COUNT(*) AS postings - FROM ' . POSTS_TABLE . ' - WHERE poster_id = ' . $post_info['poster_id'] . ' - GROUP BY poster_ip - ORDER BY COUNT(*) DESC'; - break; - - default: - $sql = 'SELECT poster_ip, COUNT(*) AS postings - FROM ' . POSTS_TABLE . ' - WHERE poster_id = ' . $post_info['poster_id'] . ' - GROUP BY poster_ip - ORDER BY postings DESC'; - break; - } + // A compound index on poster_id, poster_ip (posts table) would help speed up this query a lot, + // but the extra size is only valuable if there are persons having more than a thousands posts. + // This is better left to the really really big forums. + + $sql = 'SELECT poster_ip, COUNT(poster_ip) AS postings + FROM ' . POSTS_TABLE . ' + WHERE poster_id = ' . $post_info['poster_id'] . ' + GROUP BY poster_ip + ORDER BY postings DESC'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) @@ -305,12 +293,17 @@ function mcp_post_details($id, $mode, $action) $db->sql_freeresult($result); $user_select = ''; - ksort($users_ary); - foreach ($users_ary as $row) + if (sizeof($usernames_ary)) { - $user_select .= '<option value="' . $row['user_id'] . '">' . $row['username'] . "</option>\n"; + ksort($usernames_ary); + + foreach ($usernames_ary as $row) + { + $user_select .= '<option value="' . $row['poster_id'] . '">' . $row['username'] . "</option>\n"; + } } + $template->assign_var('S_USER_SELECT', $user_select); } @@ -379,7 +372,16 @@ function change_poster(&$post_info, $userdata) } } - // Do not change the poster_id within the attachments table, since they were still posted by the original user + // change the poster_id within the attachments table, else the data becomes out of sync and errors displayed because of wrong ownership + if ($post_info['post_attachment']) + { + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' + SET poster_id = ' . $userdata['user_id'] . ' + WHERE poster_id = ' . $post_info['user_id'] . ' + AND post_msg_id = ' . $post_info['post_id'] . ' + AND topic_id = ' . $post_info['topic_id']; + $db->sql_query($sql); + } $from_username = $post_info['username']; $to_username = $userdata['username']; diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 95e89fa9dc..0f6fae18ee 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -109,6 +109,7 @@ class mcp_queue // Process message, leave it uncensored $message = $post_info['post_text']; + $message = str_replace("\n", '<br />', $message); if ($post_info['bbcode_bitfield']) { include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); @@ -181,13 +182,15 @@ class mcp_queue $forum_list[] = $row['forum_id']; } - $global_id = $forum_list[0]; - - if (!($forum_list = implode(', ', $forum_list))) + if (!sizeof($forum_list)) { trigger_error('NOT_MODERATOR'); } + $global_id = $forum_list[0]; + + $forum_list = implode(', ', $forum_list); + $sql = 'SELECT SUM(forum_topics) as sum_forum_topics FROM ' . FORUMS_TABLE . " WHERE forum_id IN (0, $forum_list)"; @@ -228,10 +231,10 @@ class mcp_queue if ($mode == 'unapproved_posts') { $sql = 'SELECT p.post_id - FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql{0} == 'u') ? ', ' . USERS_TABLE . ' u' : '') . " + FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . " WHERE p.forum_id IN (0, $forum_list) AND p.post_approved = 0 - " . (($sort_order_sql{0} == 'u') ? 'AND u.user_id = p.poster_id' : '') . ' + " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . ' ' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . " AND t.topic_id = p.topic_id AND t.topic_first_post_id <> p.post_id @@ -283,8 +286,8 @@ class mcp_queue { $sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_title AS post_subject, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_first_poster_name AS username FROM ' . TOPICS_TABLE . " t - WHERE topic_approved = 0 - AND forum_id IN (0, $forum_list) + WHERE forum_id IN (0, $forum_list) + AND topic_approved = 0 $limit_time_sql ORDER BY $sort_order_sql"; $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); @@ -409,6 +412,8 @@ function approve_post($post_id_list, $mode) $total_topics = $total_posts = $forum_topics = $forum_posts = 0; $topic_approve_sql = $topic_replies_sql = $post_approve_sql = $topic_id_list = array(); + $update_forum_information = false; + foreach ($post_info as $post_id => $post_data) { $topic_id_list[$post_data['topic_id']] = 1; @@ -443,6 +448,12 @@ function approve_post($post_id_list, $mode) } $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; + } } if (sizeof($topic_approve_sql)) @@ -496,7 +507,11 @@ function approve_post($post_id_list, $mode) unset($topic_approve_sql, $topic_replies_sql, $post_approve_sql); update_post_information('topic', array_keys($topic_id_list)); - update_post_information('forum', $forum_id); + + if ($update_forum_information) + { + update_post_information('forum', $forum_id); + } unset($topic_id_list); $messenger = new messenger(); @@ -504,8 +519,6 @@ function approve_post($post_id_list, $mode) // Notify Poster? if ($notify_poster) { - $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); - foreach ($post_info as $post_id => $post_data) { if ($post_data['poster_id'] == ANONYMOUS) @@ -522,11 +535,9 @@ function approve_post($post_id_list, $mode) $messenger->im($post_data['user_jabber'], $post_data['username']); $messenger->assign_vars(array( - 'EMAIL_SIG' => $email_sig, - 'SITENAME' => $config['sitename'], - 'USERNAME' => html_entity_decode($post_data['username']), - 'POST_SUBJECT' => html_entity_decode(censor_text($post_data['post_subject'])), - 'TOPIC_TITLE' => html_entity_decode(censor_text($post_data['topic_title'])), + 'USERNAME' => htmlspecialchars_decode($post_data['username']), + 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_data['post_subject'])), + 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_data['topic_title'])), 'U_VIEW_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t={$post_data['topic_id']}&e=0", 'U_VIEW_POST' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t={$post_data['topic_id']}&p=$post_id&e=$post_id") @@ -629,7 +640,7 @@ function disapprove_post($post_id_list, $mode) $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if (!$row || (!$reason && $row['reason_title'] == 'other')) + if (!$row || (!$reason && strtolower($row['reason_title']) == 'other')) { $additional_msg = $user->lang['NO_REASON_DISAPPROVAL']; unset($_POST['confirm']); @@ -637,7 +648,7 @@ function disapprove_post($post_id_list, $mode) else { // If the reason is defined within the language file, we will use the localized version, else just use the database entry... - $disapprove_reason = ($row['reason_title'] != 'other') ? ((isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])] : $row['reason_description']) : ''; + $disapprove_reason = (strtolower($row['reason_title']) != 'other') ? ((isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])] : $row['reason_description']) : ''; $disapprove_reason .= ($reason) ? "\n\n" . $reason : ''; } } @@ -719,8 +730,6 @@ function disapprove_post($post_id_list, $mode) // Notify Poster? if ($notify_poster) { - $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); - foreach ($post_info as $post_id => $post_data) { if ($post_data['poster_id'] == ANONYMOUS) @@ -737,12 +746,10 @@ function disapprove_post($post_id_list, $mode) $messenger->im($post_data['user_jabber'], $post_data['username']); $messenger->assign_vars(array( - 'EMAIL_SIG' => $email_sig, - 'SITENAME' => $config['sitename'], - 'USERNAME' => html_entity_decode($post_data['username']), - 'REASON' => html_entity_decode($disapprove_reason), - 'POST_SUBJECT' => html_entity_decode(censor_text($post_data['post_subject'])), - 'TOPIC_TITLE' => html_entity_decode(censor_text($post_data['topic_title']))) + 'USERNAME' => htmlspecialchars_decode($post_data['username']), + 'REASON' => htmlspecialchars_decode($disapprove_reason), + 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_data['post_subject'])), + 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_data['topic_title']))) ); $messenger->send($post_data['user_notify_type']); diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index a52bc02359..ebd1295090 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -117,6 +117,7 @@ class mcp_reports // Process message, leave it uncensored $message = $post_info['post_text']; + $message = str_replace("\n", '<br />', $message); if ($post_info['bbcode_bitfield']) { include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); @@ -200,13 +201,13 @@ class mcp_reports $forum_list[] = $row['forum_id']; } - $global_id = $forum_list[0]; - if (!sizeof($forum_list)) { trigger_error('NOT_MODERATOR'); } + $global_id = $forum_list[0]; + $sql = 'SELECT SUM(forum_topics) as sum_forum_topics FROM ' . FORUMS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $forum_list); @@ -363,7 +364,7 @@ function close_report($post_id_list, $mode, $action) trigger_error('NOT_AUTHORIZED'); } - if (($action == 'delete') && (strpos($user->data['session_page'], 'mode=report_details') !== false)) + if ($action == 'delete' && strpos($user->data['session_page'], 'mode=report_details') !== false) { $redirect = request_var('redirect', build_url(array('mode')) . '&mode=reports'); } @@ -474,8 +475,6 @@ function close_report($post_id_list, $mode, $action) // Notify reporters if (sizeof($notify_reporters)) { - $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); - foreach ($notify_reporters as $post_id => $reporter) { if ($reporter['user_id'] == ANONYMOUS) @@ -490,12 +489,10 @@ function close_report($post_id_list, $mode, $action) $messenger->im($reporter['user_jabber'], $reporter['username']); $messenger->assign_vars(array( - 'EMAIL_SIG' => $email_sig, - 'SITENAME' => $config['sitename'], - 'USERNAME' => html_entity_decode($reporter['username']), - 'CLOSER_NAME' => html_entity_decode($user->data['username']), - 'POST_SUBJECT' => html_entity_decode(censor_text($post_info[$post_id]['post_subject'])), - 'TOPIC_TITLE' => html_entity_decode(censor_text($post_info[$post_id]['topic_title']))) + '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']); diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 691b92bd36..3b674139e9 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -37,6 +37,8 @@ function mcp_topic_view($id, $mode, $action) $to_topic_id = request_var('to_topic_id', 0); $to_forum_id = request_var('to_forum_id', 0); $post_id_list = request_var('post_id_list', array(0)); + + utf8_normalize_nfc(&$subject); // Split Topic? if ($action == 'split_all' || $action == 'split_beyond') @@ -96,10 +98,10 @@ function mcp_topic_view($id, $mode, $action) } $db->sql_freeresult($result); - if ($bbcode_bitfield) + if ($bbcode_bitfield !== '') { include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); - $bbcode = new bbcode($bbcode_bitfield); + $bbcode = new bbcode(base64_encode($bbcode_bitfield)); } foreach ($rowset as $i => $row) @@ -110,6 +112,7 @@ function mcp_topic_view($id, $mode, $action) $message = $row['post_text']; $post_subject = ($row['post_subject'] != '') ? $row['post_subject'] : $topic_info['topic_title']; + $message = str_replace("\n", '<br />', $message); if ($row['bbcode_bitfield']) { @@ -117,7 +120,6 @@ function mcp_topic_view($id, $mode, $action) } $message = smiley_text($message); - $message = str_replace("\n", '<br />', $message); if (!$row['post_approved']) { @@ -180,7 +182,7 @@ function mcp_topic_view($id, $mode, $action) 'U_VIEWTOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_info['forum_id'] . '&t=' . $topic_info['topic_id']), 'TO_TOPIC_ID' => $to_topic_id, - 'TO_TOPIC_INFO' => ($to_topic_id) ? sprintf($user->lang['YOU_SELECTED_TOPIC'], $to_topic_id, '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_topic_info['forum_id'] . '&t=' . $to_topic_id) . '" target="_new">' . $to_topic_info['topic_title'] . '</a>') : '', + 'TO_TOPIC_INFO' => ($to_topic_id) ? sprintf($user->lang['YOU_SELECTED_TOPIC'], $to_topic_id, '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_topic_info['forum_id'] . '&t=' . $to_topic_id) . '">' . $to_topic_info['topic_title'] . '</a>') : '', 'SPLIT_SUBJECT' => $subject, 'POSTS_PER_PAGE' => $posts_per_page, @@ -197,6 +199,7 @@ function mcp_topic_view($id, $mode, $action) 'S_CAN_APPROVE' => ($has_unapproved_posts && $auth->acl_get('m_approve', $topic_info['forum_id'])) ? true : false, 'S_CAN_LOCK' => ($auth->acl_get('m_lock', $topic_info['forum_id'])) ? true : false, 'S_REPORT_VIEW' => ($action == 'reports') ? true : false, + 'S_MERGE_VIEW' => ($action == 'merge') ? true : false, 'S_SHOW_TOPIC_ICONS' => $s_topic_icons, 'S_TOPIC_ICON' => $icon_id, @@ -302,7 +305,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) $limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : ''; - if ($sort_order_sql{0} == 'u') + if ($sort_order_sql[0] == 'u') { $sql = 'SELECT p.post_id, p.forum_id, p.post_approved FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index bc428570ab..da76dc8b58 100755 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -247,6 +247,7 @@ function mcp_warn_post_view($id, $mode, $action) // We want to make the message available here as a reminder // Parse the message and subject $message = $userrow['post_text']; + $message = str_replace("\n", '<br />', censor_text($message)); // Second parse bbcode here if ($userrow['bbcode_bitfield']) @@ -260,9 +261,6 @@ function mcp_warn_post_view($id, $mode, $action) // Always process smilies after parsing bbcodes $message = smiley_text($message); - // Replace naughty words such as farty pants - $message = str_replace("\n", '<br />', censor_text($message)); - // Generate the appropriate user information for the user we are looking at $rank_title = $rank_img = ''; // get_user_rank($userrow['user_rank'], $userrow['user_posts'], $rank_title, $rank_img); @@ -312,11 +310,11 @@ function mcp_warn_user_view($id, $mode, $action) global $template, $db, $user, $auth; $user_id = request_var('u', 0); - $username = request_var('username', ''); + $username = request_var('username', '', true); $notify = (isset($_REQUEST['notify_user'])) ? true : false; $warning = request_var('warning', '', true); - $sql_where = ($user_id) ? "user_id = $user_id" : "username = '" . $db->sql_escape($username) . "'"; + $sql_where = ($user_id) ? "user_id = $user_id" : "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; $sql = 'SELECT * FROM ' . USERS_TABLE . ' @@ -405,7 +403,7 @@ function add_warning($userrow, $warning, $send_pm = true, $post_id = 0) $message_parser = new parse_message(); $message_parser->message = sprintf($lang['WARNING_PM_BODY'], $warning); - $message_parser->parse(true, true, true, false, false, true); + $message_parser->parse(true, true, true, false, false, true, true); $pm_data = array( 'from_user_id' => $user->data['user_id'], diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 6aa78d091f..6538bd7721 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -47,7 +47,6 @@ class bbcode_firstpass extends bbcode $this->bbcode_bitfield = ''; $bitfield = new bitfield(); - $size = strlen($this->message); foreach ($this->bbcodes as $bbcode_name => $bbcode_data) { if (isset($bbcode_data['disabled']) && $bbcode_data['disabled']) @@ -65,18 +64,15 @@ class bbcode_firstpass extends bbcode { foreach ($bbcode_data['regexp'] as $regexp => $replacement) { - $this->message = preg_replace($regexp, $replacement, $this->message); + // The pattern gets compiled and cached by the PCRE extension, + // it should not demand recompilation + if (preg_match($regexp, $this->message)) + { + $this->message = preg_replace($regexp, $replacement, $this->message); + $bitfield->set($bbcode_data['bbcode_id']); + } } } - - // Because we add bbcode_uid to all tags, the message length - // will increase whenever a tag is found - $new_size = strlen($this->message); - if ($size != $new_size) - { - $bitfield->set($bbcode_data['bbcode_id']); - $size = $new_size; - } } $this->bbcode_bitfield = $bitfield->get_base64(); @@ -368,15 +364,11 @@ class bbcode_firstpass extends bbcode // We remove the hardcoded elements from the code block here because it is not used in code blocks // Having it here saves us one preg_replace per message containing [code] blocks // Additionally, magic url parsing should go after parsing bbcodes, but for safety those are stripped out too... - $htm_match = array( - '#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#', - '#<!\-\- m \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- m \-\->#', - '#<!\-\- w \-\-><a href="http:\/\/(.*?)" target="_blank">.*?</a><!\-\- w \-\->#', - '#<!\-\- l \-\-><a href="(.*?)">.*?</a><!\-\- l \-\->#', - '#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#', - '#&\#([0-9]+);#', - ); - $htm_replace = array('\1', '\1', '\1', '\1', '\1', '&#\1;'); + $htm_match = get_preg_expression('bbcode_htm'); +// $htm_match[3] = '/&#([0-9]+);/'; + unset($htm_match[3], $htm_match[4]); + + $htm_replace = array('\1', '\2', '\1'); //, '&#\1;'); $out = ''; @@ -427,7 +419,7 @@ class bbcode_firstpass extends bbcode } // Because highlight_string is specialcharing the text (but we already did this before), we have to reverse this in order to get correct results - $code = html_entity_decode($code); + $code = htmlspecialchars_decode($code); $code = highlight_string($code, true); $str_from = array('<span style="color: ', '<font color="syntax', '</font>', '<code>', '</code>','[', ']', '.', ':'); @@ -507,13 +499,15 @@ class bbcode_firstpass extends bbcode $tok = ']'; $out = '['; + // First character is [ $in = substr($in, 1); $list_end_tags = array(); do { $pos = strlen($in); - for ($i = 0; $i < strlen($tok); ++$i) + + for ($i = 0, $tok_len = strlen($tok); $i < $tok_len; ++$i) { $tmp_pos = strpos($in, $tok{$i}); @@ -531,7 +525,7 @@ class bbcode_firstpass extends bbcode if ($tok == ']') { // if $tok is ']' the buffer holds a tag - if ($buffer == '/list' && sizeof($list_end_tags)) + if (strtolower($buffer) == '/list' && sizeof($list_end_tags)) { $out .= array_pop($list_end_tags) . ']'; $tok = '['; @@ -547,6 +541,12 @@ class bbcode_firstpass extends bbcode { array_push($list_end_tags, '/list:o:' . $this->bbcode_uid); } + + if (strtolower(substr($buffer, 0, 4)) == 'list') + { + $buffer = 'list' . substr($buffer, 4, $pos); + } + $out .= $buffer . ':' . $this->bbcode_uid . ']'; $tok = '['; } @@ -598,7 +598,7 @@ class bbcode_firstpass extends bbcode do { $pos = strlen($in); - for ($i = 0; $i < strlen($tok); ++$i) + for ($i = 0, $tok_len = strlen($tok); $i < $tok_len; ++$i) { $tmp_pos = strpos($in, $tok{$i}); if ($tmp_pos !== false && $tmp_pos < $pos) @@ -649,7 +649,7 @@ class bbcode_firstpass extends bbcode preg_match_all('#\[((?:/)?(?:[a-z]+))#i', $username, $tags); foreach ($tags[1] as $tag) { - if ($tag{0} != '/') + if ($tag[0] != '/') { $end_tags[] = '/' . $tag; } @@ -807,7 +807,7 @@ class bbcode_firstpass extends bbcode * @param string $url the url to check * @return true if the url is pointing to this domain/script_path/php-file, false if not * - * @access: private + * @access private */ function path_in_domain($url) { @@ -857,6 +857,7 @@ class parse_message extends bbcode_firstpass var $allow_img_bbcode = true; var $allow_flash_bbcode = true; var $allow_quote_bbcode = true; + var $allow_url_bbcode = true; var $mode; @@ -877,7 +878,7 @@ class parse_message extends bbcode_firstpass /** * Parse Message */ - function parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $update_this_message = true, $mode = 'post') + function parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $update_this_message = true, $mode = 'post') { global $config, $db, $user; @@ -888,6 +889,7 @@ class parse_message extends bbcode_firstpass $this->allow_img_bbcode = $allow_img_bbcode; $this->allow_flash_bbcode = $allow_flash_bbcode; $this->allow_quote_bbcode = $allow_quote_bbcode; + $this->allow_url_bbcode = $allow_url_bbcode; // If false, then $this->message won't be altered, the text will be returned instead. if (!$update_this_message) @@ -911,7 +913,7 @@ class parse_message extends bbcode_firstpass // Message length check. -1 disables this check completely. if ($config['max_' . $mode . '_chars'] != -1) { - $msg_len = ($mode == 'post') ? strlen($this->message) : strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#is', ' ', $this->message)); + $msg_len = ($mode == 'post') ? utf8_strlen($this->message) : utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#is', ' ', $this->message)); if ((!$msg_len && $mode !== 'sig') || $config['max_' . $mode . '_chars'] && $msg_len > $config['max_' . $mode . '_chars']) { @@ -924,7 +926,7 @@ class parse_message extends bbcode_firstpass if ($allow_bbcode && strpos($this->message, '[') !== false) { $this->bbcode_init(); - $disallow = array('img', 'flash', 'quote'); + $disallow = array('img', 'flash', 'quote', 'url'); foreach ($disallow as $bool) { if (!${'allow_' . $bool . '_bbcode'}) @@ -995,7 +997,7 @@ class parse_message extends bbcode_firstpass if ($this->message_status == 'plain') { // Force updating message - of course. - $this->parse($allow_bbcode, $allow_magic_url, $allow_smilies, $this->allow_img_bbcode, $this->allow_flash_bbcode, $this->allow_quote_bbcode, true); + $this->parse($allow_bbcode, $allow_magic_url, $allow_smilies, $this->allow_img_bbcode, $this->allow_flash_bbcode, $this->allow_quote_bbcode, $this->allow_url_bbcode, true); } // Parse BBcode @@ -1076,7 +1078,7 @@ class parse_message extends bbcode_firstpass // NOTE: obtain_* function? chaching the table contents? // For now setting the ttl to 10 minutes - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mssql': case 'mssql_odbc': @@ -1088,7 +1090,7 @@ class parse_message extends bbcode_firstpass case 'firebird': $sql = 'SELECT * FROM ' . SMILIES_TABLE . ' - ORDER BY STRLEN(code) DESC'; + ORDER BY CHAR_LENGTH(code) DESC'; break; // LENGTH supported by MySQL, IBM DB2, Oracle and Access for sure... @@ -1104,7 +1106,7 @@ class parse_message extends bbcode_firstpass { // (assertion) $match[] = '#(?<=^|[\n ]|\.)' . preg_quote($row['code'], '#') . '#'; - $replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILIES_PATH}/' . $row['smiley_url'] . '" border="0" alt="' . $row['emotion'] . '" title="' . $row['emotion'] . '" /><!-- s' . $row['code'] . ' -->'; + $replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILIES_PATH}/' . $row['smiley_url'] . '" alt="' . $row['emotion'] . '" title="' . $row['emotion'] . '" /><!-- s' . $row['code'] . ' -->'; } $db->sql_freeresult($result); } @@ -1131,12 +1133,13 @@ class parse_message extends bbcode_firstpass */ function parse_attachments($form_name, $mode, $forum_id, $submit, $preview, $refresh, $is_message = false) { - global $config, $auth, $user, $phpbb_root_path, $phpEx; + global $config, $auth, $user, $phpbb_root_path, $phpEx, $db; $error = array(); $num_attachments = sizeof($this->attachment_data); $this->filename_data['filecomment'] = request_var('filecomment', '', true); + utf8_normalize_nfc(&$this->filename_data['filecomment']); $upload_file = (isset($_FILES[$form_name]) && $_FILES[$form_name]['name'] != 'none' && trim($_FILES[$form_name]['name'])) ? true : false; $add_file = (isset($_POST['add_file'])) ? true : false; @@ -1156,7 +1159,7 @@ class parse_message extends bbcode_firstpass if ($filedata['post_attach'] && !sizeof($error)) { - $new_entry = array( + $sql_ary = array( 'physical_filename' => $filedata['physical_filename'], 'attach_comment' => $this->filename_data['filecomment'], 'real_filename' => $filedata['real_filename'], @@ -1164,8 +1167,19 @@ class parse_message extends bbcode_firstpass 'mimetype' => $filedata['mimetype'], 'filesize' => $filedata['filesize'], 'filetime' => $filedata['filetime'], - 'attach_id' => 0, - 'thumbnail' => $filedata['thumbnail'] + 'thumbnail' => $filedata['thumbnail'], + 'is_orphan' => 1, + 'in_message' => ($is_message) ? 1 : 0, + 'poster_id' => $user->data['user_id'], + ); + + $db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + + $new_entry = array( + 'attach_id' => $db->sql_nextid(), + 'is_orphan' => 1, + 'real_filename' => $filedata['real_filename'], + 'attach_comment'=> $this->filename_data['filecomment'], ); $this->attachment_data = array_merge(array(0 => $new_entry), $this->attachment_data); @@ -1199,32 +1213,51 @@ class parse_message extends bbcode_firstpass $index = (int) key($_POST['delete_file']); - // delete selected attachment - if (!$this->attachment_data[$index]['attach_id']) + if (!empty($this->attachment_data[$index])) { - phpbb_unlink($this->attachment_data[$index]['physical_filename'], 'file'); - if ($this->attachment_data[$index]['thumbnail']) + // delete selected attachment + if ($this->attachment_data[$index]['is_orphan']) { - phpbb_unlink($this->attachment_data[$index]['physical_filename'], 'thumbnail'); + $sql = 'SELECT attach_id, physical_filename, thumbnail + FROM ' . ATTACHMENTS_TABLE . ' + WHERE attach_id = ' . (int) $this->attachment_data[$index]['attach_id'] . ' + AND is_orphan = 1 + AND poster_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + phpbb_unlink($row['physical_filename'], 'file'); + + if ($row['thumbnail']) + { + phpbb_unlink($row['physical_filename'], 'thumbnail'); + } + + $db->sql_query('DELETE FROM ' . ATTACHMENTS_TABLE . ' WHERE attach_id = ' . (int) $this->attachment_data[$index]['attach_id']); + } + } + else + { + delete_attachments('attach', array(intval($this->attachment_data[$index]['attach_id']))); } - } - else - { - delete_attachments('attach', array(intval($this->attachment_data[$index]['attach_id']))); - } - unset($this->attachment_data[$index]); - $this->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#e', "(\\1 == \$index) ? '' : ((\\1 > \$index) ? '[attachment=' . (\\1 - 1) . ']\\2[/attachment]' : '\\0')", $this->message); + unset($this->attachment_data[$index]); + $this->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#e', "(\\1 == \$index) ? '' : ((\\1 > \$index) ? '[attachment=' . (\\1 - 1) . ']\\2[/attachment]' : '\\0')", $this->message); - // Reindex Array - $this->attachment_data = array_values($this->attachment_data); + // Reindex Array + $this->attachment_data = array_values($this->attachment_data); + } } else if ($edit_comment || $add_file || $preview) { if ($edit_comment) { $actual_comment_list = request_var('comment_list', array(''), true); + utf8_normalize_nfc(&$actual_comment_list); $edit_comment = request_var('edit_comment', array(0 => '')); $edit_comment = key($edit_comment); @@ -1233,14 +1266,14 @@ class parse_message extends bbcode_firstpass if (($add_file || $preview) && $upload_file) { - if ($num_attachments < $cfg['max_attachments'] || $auth->acl_gets('m_', 'a_')) + if ($num_attachments < $cfg['max_attachments'] || $auth->acl_gets('m_', 'a_', $forum_id)) { $filedata = upload_attachment($form_name, $forum_id, false, '', $is_message); $error = array_merge($error, $filedata['error']); if (!sizeof($error)) { - $new_entry = array( + $sql_ary = array( 'physical_filename' => $filedata['physical_filename'], 'attach_comment' => $this->filename_data['filecomment'], 'real_filename' => $filedata['real_filename'], @@ -1248,8 +1281,19 @@ class parse_message extends bbcode_firstpass 'mimetype' => $filedata['mimetype'], 'filesize' => $filedata['filesize'], 'filetime' => $filedata['filetime'], - 'attach_id' => 0, - 'thumbnail' => $filedata['thumbnail'] + 'thumbnail' => $filedata['thumbnail'], + 'is_orphan' => 1, + 'in_message' => ($is_message) ? 1 : 0, + 'poster_id' => $user->data['user_id'], + ); + + $db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + + $new_entry = array( + 'attach_id' => $db->sql_nextid(), + 'is_orphan' => 1, + 'real_filename' => $filedata['real_filename'], + 'attach_comment'=> $this->filename_data['filecomment'], ); $this->attachment_data = array_merge(array(0 => $new_entry), $this->attachment_data); @@ -1279,99 +1323,84 @@ class parse_message extends bbcode_firstpass global $user, $db, $phpbb_root_path, $phpEx, $config; $this->filename_data['filecomment'] = request_var('filecomment', '', true); - $this->attachment_data = (isset($_POST['attachment_data'])) ? $_POST['attachment_data'] : array(); + utf8_normalize_nfc(&$this->filename_data['filecomment']); + $attachment_data = (isset($_POST['attachment_data'])) ? $_POST['attachment_data'] : array(); + $this->attachment_data = array(); $check_user_id = ($check_user_id === false) ? $user->data['user_id'] : $check_user_id; - // Regenerate data array... - $attach_ids = $filenames = array(); + if (!sizeof($attachment_data)) + { + return; + } - foreach ($this->attachment_data as $pos => $var_ary) + $not_orphan = $orphan = array(); + + foreach ($attachment_data as $pos => $var_ary) { - if ($var_ary['attach_id']) + if ($var_ary['is_orphan']) { - $attach_ids[(int) $this->attachment_data[$pos]['attach_id']] = $pos; + $orphan[(int) $var_ary['attach_id']] = $pos; } else { - $filenames[$pos] = ''; - set_var($filenames[$pos], $this->attachment_data[$pos]['physical_filename'], 'string'); - $filenames[$pos] = basename($filenames[$pos]); + $not_orphan[(int) $var_ary['attach_id']] = $pos; } } - $this->attachment_data = array(); - - // Regenerate already posted attachments... - if (sizeof($attach_ids)) + // Regenerate already posted attachments + if (sizeof($not_orphan)) { - // Get the data from the attachments - $sql = 'SELECT attach_id, physical_filename, real_filename, extension, mimetype, filesize, filetime, thumbnail + // Get the attachment data, based on the poster id... + $sql = 'SELECT attach_id, is_orphan, real_filename, attach_comment FROM ' . ATTACHMENTS_TABLE . ' - WHERE ' . $db->sql_in_set('attach_id', array_keys($attach_ids)) . ' + WHERE ' . $db->sql_in_set('attach_id', array_keys($not_orphan)) . ' AND poster_id = ' . $check_user_id; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - if (isset($attach_ids[$row['attach_id']])) - { - $pos = $attach_ids[$row['attach_id']]; - $this->attachment_data[$pos] = $row; - set_var($this->attachment_data[$pos]['attach_comment'], $_POST['attachment_data'][$pos]['attach_comment'], 'string', true); + $pos = $not_orphan[$row['attach_id']]; + $this->attachment_data[$pos] = $row; + set_var($this->attachment_data[$pos]['attach_comment'], $_POST['attachment_data'][$pos]['attach_comment'], 'string', true); - unset($attach_ids[$row['attach_id']]); - } + unset($not_orphan[$row['attach_id']]); } $db->sql_freeresult($result); + } - if (sizeof($attach_ids)) - { - trigger_error($user->lang['NO_ACCESS_ATTACHMENT'], E_USER_ERROR); - } + if (sizeof($not_orphan)) + { + trigger_error($user->lang['NO_ACCESS_ATTACHMENT'], E_USER_ERROR); } // Regenerate newly uploaded attachments - if (sizeof($filenames)) + if (sizeof($orphan)) { - include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx); - - $sql = 'SELECT attach_id + $sql = 'SELECT attach_id, is_orphan, real_filename, attach_comment FROM ' . ATTACHMENTS_TABLE . ' - WHERE ' . $db->sql_in_set('LOWER(physical_filename)', array_map('strtolower', $filenames)); - $result = $db->sql_query_limit($sql, 1); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if ($row) - { - trigger_error($user->lang['NO_ACCESS_ATTACHMENT'], E_USER_ERROR); - } + WHERE ' . $db->sql_in_set('attach_id', array_keys($orphan)) . ' + AND poster_id = ' . $user->data['user_id'] . ' + AND is_orphan = 1'; + $result = $db->sql_query($sql); - foreach ($filenames as $pos => $physical_filename) + while ($row = $db->sql_fetchrow($result)) { - $this->attachment_data[$pos] = array( - 'physical_filename' => $physical_filename, - 'extension' => strtolower(filespec::get_extension($phpbb_root_path . $config['upload_path'] . '/' . $physical_filename)), - 'filesize' => filespec::get_filesize($phpbb_root_path . $config['upload_path'] . '/' . $physical_filename), - 'attach_id' => 0, - 'thumbnail' => (file_exists($phpbb_root_path . $config['upload_path'] . '/thumb_' . $physical_filename)) ? 1 : 0, - ); - + $pos = $orphan[$row['attach_id']]; + $this->attachment_data[$pos] = $row; set_var($this->attachment_data[$pos]['attach_comment'], $_POST['attachment_data'][$pos]['attach_comment'], 'string', true); - set_var($this->attachment_data[$pos]['real_filename'], $_POST['attachment_data'][$pos]['real_filename'], 'string', true); - set_var($this->attachment_data[$pos]['filetime'], $_POST['attachment_data'][$pos]['filetime'], 'int'); - if (strpos($_POST['attachment_data'][$pos]['mimetype'], 'image/') !== false) - { - set_var($this->attachment_data[$pos]['mimetype'], $_POST['attachment_data'][$pos]['mimetype'], 'string'); - } - else - { - $this->attachment_data[$pos]['mimetype'] = filespec::get_mimetype($phpbb_root_path . $config['upload_path'] . '/' . $physical_filename); - } + unset($orphan[$row['attach_id']]); } + $db->sql_freeresult($result); + } + + if (sizeof($orphan)) + { + trigger_error($user->lang['NO_ACCESS_ATTACHMENT'], E_USER_ERROR); } + + ksort($this->attachment_data); } /** @@ -1388,8 +1417,7 @@ class parse_message extends bbcode_firstpass $this->message = $poll['poll_option_text']; - $poll['poll_option_text'] = $this->parse($poll['enable_bbcode'], $poll['enable_urls'], $poll['enable_smilies'], $poll['img_status'], false, false, 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); $this->message = $tmp_message; @@ -1398,8 +1426,7 @@ class parse_message extends bbcode_firstpass $this->message = $poll['poll_title']; - $poll['poll_title'] = $this->parse($poll['enable_bbcode'], $poll['enable_urls'], $poll['enable_smilies'], $poll['img_status'], false, false, 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); $this->message = $tmp_message; diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 4a9a57df34..755bd5b814 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -49,7 +49,7 @@ class fulltext_mysql extends search_backend { global $db, $user; - if (strpos(SQL_LAYER, 'mysql') === false) + if (strpos($db->sql_layer, 'mysql') === false) { return $user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_VERSION']; } @@ -153,7 +153,7 @@ class fulltext_mysql extends search_backend $clean_word = preg_replace('#^[+\-|]#', '', $word); // check word length - $clean_len = strlen(str_replace('*', '', $clean_word)); + $clean_len = utf8_strlen(str_replace('*', '', $clean_word)); if (($clean_len < $config['fulltext_mysql_min_word_len']) || ($clean_len > $config['fulltext_mysql_max_word_len'])) { $this->common_words[] = $word; @@ -203,7 +203,7 @@ class fulltext_mysql extends search_backend for ($i = 0, $n = sizeof($text); $i < $n; $i++) { $text[$i] = trim($text[$i]); - if (strlen($text[$i]) < $config['fulltext_mysql_min_word_len'] || strlen($text[$i]) > $config['fulltext_mysql_max_word_len']) + if (utf8_strlen($text[$i]) < $config['fulltext_mysql_min_word_len'] || utf8_strlen($text[$i]) > $config['fulltext_mysql_max_word_len']) { unset($text[$i]); } @@ -561,7 +561,7 @@ class fulltext_mysql extends search_backend * * @param string $mode contains the post mode: edit, post, reply, quote ... */ - function index($mode, $post_id, &$message, &$subject, $encoding, $poster_id, $forum_id) + function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) { global $db; @@ -732,7 +732,7 @@ class fulltext_mysql extends search_backend { global $db; - if (strpos(SQL_LAYER, 'mysql') === false) + if (strpos($db->sql_layer, 'mysql') === false) { $this->stats = array(); return; diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index bc11d2ed20..b47076228a 100755 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -56,10 +56,6 @@ class fulltext_native extends search_backend { include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx); } - if (!function_exists('utf8_strlen')) - { - include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); - } $error = false; @@ -86,38 +82,89 @@ class fulltext_native extends search_backend { global $db, $config, $user; - // Clean up the query search - $match = array( - // Replace multiple spaces with a single space - '# +#', + $keywords = trim($this->cleanup($keywords, '+-|()*')); - // Strip spaces after: +-|( - '#([+\\-|(]) #', + // allow word|word|word without brackets + if ((strpos($keywords, ' ') === false) && (strpos($keywords, '|') !== false) && (strpos($keywords, '(') === false)) + { + $keywords = '(' . $keywords . ')'; + } - // Strip spaces before: |*) - '# ([|*)])#', + $open_bracket = $space = false; + for ($i = 0, $n = strlen($keywords); $i < $n; $i++) + { + if ($open_bracket !== false) + { + switch ($keywords[$i]) + { + case ')': + if ($open_bracket + 1 == $i) + { + $keywords[$i - 1] = '|'; + $keywords[$i] = '|'; + } + $open_bracket = false; + break; + case '(': + $keywords[$i] = '|'; + break; + case '+': + case '-': + case ' ': + $keywords[$i] = '|'; + break; + } + } + else + { + switch ($keywords[$i]) + { + case ')': + $keywords[$i] = ' '; + break; + case '(': + $open_bracket = $i; + break; + case '|': + $keywords[$i] = ' '; + break; + case '-': + case '+': + $space = $keywords[$i]; + break; + case ' ': + if ($space !== false) + { + $keywords[$i] = $space; + } + break; + default: + $space = false; + } + } + } - // Make word|word|word work without brackets - '#^[^()]*\\|[^()]*$#', + if ($open_bracket) + { + $keywords .= ')'; + } - // Remove nested brackets - '#(\\([^()]*)(?=\\()#', - '#\\)([^()]*)(?=\\))#', + $match = array( + '# +#', + '#\|\|+#', + '#(\+|\-)(?:\+|\-)+#', + '#\(\|#', + '#\|\)#', ); - $replace = array( ' ', + '|', '$1', - '$1', - '($0)', - '$1)', - '$1', + '(', + ')', ); - $keywords = trim(preg_replace($match, $replace, $this->cleanup($keywords, '+-|()*', $user->lang['ENCODING']))); - - // remove some useless bracket combinations which might be created by the previous regexps - $keywords = str_replace(array('()', ')|('), array('', '|'), $keywords); + $keywords = preg_replace($match, $replace, $keywords); // $keywords input format: each word seperated by a space, words in a bracket are not seperated @@ -134,7 +181,7 @@ class fulltext_native extends search_backend } // set the search_query which is shown to the user - $this->search_query = utf8_encode_ncr($keywords, ENT_QUOTES); + $this->search_query = $keywords; $exact_words = array(); preg_match_all('#([^\\s+\\-|*()]+)(?:$|[\\s+\\-|()])#', $keywords, $exact_words); @@ -152,7 +199,7 @@ class fulltext_native extends search_backend { if ($row['word_common']) { - $this->common_words[] = $row['wort_text']; + $this->common_words[] = $row['word_text']; continue; } @@ -187,7 +234,7 @@ class fulltext_native extends search_backend // a group of which at least one may not be in the resulting posts if ($word[0] == '(') { - $word = explode('|', substr($word, 1, -1)); + $word = array_unique(explode('|', substr($word, 1, -1))); $mode = 'must_exclude_one'; } // one word which should not be in the resulting posts @@ -209,12 +256,17 @@ class fulltext_native extends search_backend // a group of words of which at least one word should be in every resulting post if ($word[0] == '(') { - $word = explode('|', substr($word, 1, -1)); + $word = array_unique(explode('|', substr($word, 1, -1))); } $ignore_no_id = false; $mode = 'must_contain'; } + if (empty($word)) + { + continue; + } + // if this is an array of words then retrieve an id for each if (is_array($word)) { @@ -246,7 +298,7 @@ class fulltext_native extends search_backend // throw an error if we shall not ignore unexistant words else if (!$ignore_no_id) { - trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], utf8_encode_ncr(implode(', ', $word)))); + trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode(', ', $word))); } } // else we only need one id @@ -264,7 +316,7 @@ class fulltext_native extends search_backend // throw an error if we shall not ignore unexistant words else if (!$ignore_no_id) { - trigger_error(sprintf($user->lang['WORD_IN_NO_POST'], utf8_encode_ncr($word))); + trigger_error(sprintf($user->lang['WORD_IN_NO_POST'], $word)); } } @@ -357,12 +409,6 @@ class fulltext_native extends search_backend ); $sql_where[] = 'm0.post_id = p.post_id'; - if ($type == 'topics') - { - $sql_array['FROM'][TOPICS_TABLE] = 't'; - $group_by = true; - } - $title_match = ''; $group_by = true; // Build some display specific sql strings @@ -383,6 +429,16 @@ class fulltext_native extends search_backend break; } + if ($type == 'topics') + { + if (!isset($sql_array['FROM'][TOPICS_TABLE])) + { + $sql_array['FROM'][TOPICS_TABLE] = 't'; + $sql_where[] = 'p.topic_id = t.topic_id'; + } + $group_by = true; + } + /** * @todo Add a query optimizer (handle stuff like "+(4|3) +4") */ @@ -540,20 +596,24 @@ class fulltext_native extends search_backend $sql = ''; $sql_array_count = $sql_array; - switch (SQL_LAYER) + switch ($db->sql_layer) { - case 'mysql': case 'mysql4': case 'mysqli': + + // 3.x does not support SQL_CALC_FOUND_ROWS $sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT']; $is_mysql = true; + break; case 'sqlite': $sql_array_count['SELECT'] = ($type == 'posts') ? 'DISTINCT p.post_id' : 'DISTINCT p.topic_id'; $sql = 'SELECT COUNT(' . (($type == 'posts') ? 'post_id' : 'topic_id') . ') as total_results FROM (' . $db->sql_build_query('SELECT', $sql_array_count) . ')'; + // no break + default: $sql_array_count['SELECT'] = ($type == 'posts') ? 'COUNT(DISTINCT p.post_id) AS total_results' : 'COUNT(DISTINCT p.topic_id) AS total_results'; $sql = (!$sql) ? $db->sql_build_query('SELECT', $sql_array_count) : $sql; @@ -735,9 +795,8 @@ class fulltext_native extends search_backend // If the cache was completely empty count the results if (!$total_results) { - switch (SQL_LAYER) + switch ($db->sql_layer) { - case 'mysql': case 'mysql4': case 'mysqli': $select = 'SQL_CALC_FOUND_ROWS ' . $select; @@ -757,7 +816,7 @@ class fulltext_native extends search_backend } else { - if (SQL_LAYER == 'sqlite') + if ($db->sql_layer == 'sqlite') { $sql = 'SELECT COUNT(topic_id) as total_results FROM (SELECT DISTINCT t.topic_id'; @@ -773,7 +832,7 @@ class fulltext_native extends search_backend $m_approve_fid_sql $sql_fora AND t.topic_id = p.topic_id - $sql_time" . ((SQL_LAYER == 'sqlite') ? ')' : ''); + $sql_time" . (($db->sql_layer == 'sqlite') ? ')' : ''); } $result = $db->sql_query($sql); @@ -858,7 +917,7 @@ class fulltext_native extends search_backend * * NOTE: duplicates are NOT removed from the return array * - * @param string $text Text to split, encoded in user's encoding + * @param string $text Text to split, encoded in UTF-8 * @return array Array of UTF-8 words * * @access private @@ -876,7 +935,7 @@ class fulltext_native extends search_backend // Do not index code $match[] = '#\[code(?:=.*?)?(\:?[0-9a-z]{5,})\].*?\[\/code(\:?[0-9a-z]{5,})\]#is'; // BBcode - $match[] = '#\[\/?[a-z\*\+\-]+(?:=.*?)?(\:?[0-9a-z]{5,})\]#'; + $match[] = '#\[\/?[a-z0-9\*\+\-]+(?:=.*?)?(?::[a-z])?(\:?[0-9a-z]{5,})\]#'; $min = $config['fulltext_native_min_chars']; $max = $config['fulltext_native_max_chars']; @@ -886,15 +945,15 @@ class fulltext_native extends search_backend /** * Clean up the string, remove HTML tags, remove BBCodes */ - $word = strtok($this->cleanup(preg_replace($match, ' ', strip_tags($text)), '', $user->lang['ENCODING']), ' '); + $word = strtok($this->cleanup(preg_replace($match, ' ', strip_tags($text)), -1), ' '); while (isset($word[0])) { - if (isset($word[252]) + if (isset($word[255]) || !isset($word[$isset_min])) { /** - * Words longer than 252 bytes are ignored. This will have to be + * Words longer than 255 bytes are ignored. This will have to be * changed whenever we change the length of search_wordlist.word_text * * Words shorter than $isset_min bytes are ignored, too @@ -939,13 +998,12 @@ class fulltext_native extends search_backend * @param int $post_id The id of the post which is modified/created * @param string $message New or updated post content * @param string $subject New or updated post subject - * @param string $encoding The post content's encoding * @param int $poster_id Post author's user id * @param int $forum_id The id of the forum in which the post is located * * @access public */ - function index($mode, $post_id, &$message, &$subject, $encoding, $poster_id, $forum_id) + function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) { global $config, $db, $user; @@ -1024,26 +1082,16 @@ class fulltext_native extends search_backend if (sizeof($new_words)) { - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $sql = 'INSERT INTO ' . SEARCH_WORDLIST_TABLE . " (word_text) - VALUES ('" . implode("'),('", array_map(array(&$db, 'sql_escape'), $new_words)) . "')"; - $db->sql_query($sql); - break; + $sql_ary = array(); - default: - foreach ($new_words as $word) - { - $sql = 'INSERT INTO ' . SEARCH_WORDLIST_TABLE . " (word_text) - VALUES ('" . $db->sql_escape($word) . "')"; - $db->sql_query($sql); - } + foreach ($new_words as $word) + { + $sql_ary[] = array('word_text' => $word); } + + $db->sql_multi_insert(SEARCH_WORDLIST_TABLE, $sql_ary); } - unset($new_words); + unset($new_words, $sql_ary); } // now update the search match table, remove links to removed words and add links to new words @@ -1091,22 +1139,6 @@ class fulltext_native extends search_backend } /** - * Used by index() to sort strings by string length, longest first - */ - function strlencmp($a, $b) - { - $len_a = strlen($a); - $len_b = strlen($b); - - if ($len_a == $len_b) - { - return 0; - } - - return ($len_a > $len_b) ? -1 : 1; - } - - /** * Removes entries from the wordmatch table for the specified post_ids */ function index_remove($post_ids, $author_ids, $forum_ids) @@ -1142,14 +1174,14 @@ class fulltext_native extends search_backend $destroy_cache_words = array(); - // Remove common (> 60% of posts ) words + // Remove common (> 20% of posts ) words if ($config['num_posts'] >= 100) { // First, get the IDs of common words $sql = 'SELECT word_id FROM ' . SEARCH_WORDMATCH_TABLE . ' GROUP BY word_id - HAVING COUNT(word_id) > ' . floor($config['num_posts'] * 0.6); + HAVING COUNT(word_id) > ' . floor($config['num_posts'] * 0.2); $result = $db->sql_query($sql); $sql_in = array(); @@ -1200,9 +1232,9 @@ class fulltext_native extends search_backend { global $db; - $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . SEARCH_WORDLIST_TABLE); - $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . SEARCH_WORDMATCH_TABLE); - $db->sql_query(((SQL_LAYER != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . SEARCH_RESULTS_TABLE); + $db->sql_query((($db->sql_layer != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . SEARCH_WORDLIST_TABLE); + $db->sql_query((($db->sql_layer != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . SEARCH_WORDMATCH_TABLE); + $db->sql_query((($db->sql_layer != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM ') . SEARCH_RESULTS_TABLE); } /** @@ -1265,7 +1297,7 @@ class fulltext_native extends search_backend * @param string $encoding Text encoding * @return string Cleaned up text, only alphanumeric chars are left */ - function cleanup($text, $allowed_chars = null, $encoding = 'iso-8859-1') + function cleanup($text, $allowed_chars = null, $encoding = 'utf-8') { global $phpbb_root_path, $phpEx; static $conv = array(), $conv_loaded = array(); @@ -1290,7 +1322,7 @@ class fulltext_native extends search_backend /** * Replace HTML entities and NCRs */ - $text = html_entity_decode(utf8_decode_ncr($text), ENT_QUOTES); + $text = htmlspecialchars_decode(utf8_decode_ncr($text), ENT_QUOTES); /** * Load the UTF-8 normalizer @@ -1524,7 +1556,7 @@ class fulltext_native extends search_backend // These are fields required in the config table return array( 'tpl' => $tpl, - 'config' => array('fulltext_native_load_upd' => 'bool', 'fulltext_native_min_chars' => 'integer:0:252', 'fulltext_native_max_chars' => 'integer:0:252') + 'config' => array('fulltext_native_load_upd' => 'bool', 'fulltext_native_min_chars' => 'integer:0:255', 'fulltext_native_max_chars' => 'integer:0:255') ); } } diff --git a/phpBB/includes/search/search.php b/phpBB/includes/search/search.php index fa91b9eef5..4c8387bd22 100755 --- a/phpBB/includes/search/search.php +++ b/phpBB/includes/search/search.php @@ -285,7 +285,7 @@ class search_backend { $cache->destroy('_search_results_' . $row['search_key']); } - $db->sql_freeresult(); + $db->sql_freeresult($result); } // clear all searches that searched for the specified authors @@ -306,7 +306,7 @@ class search_backend { $cache->destroy('_search_results_' . $row['search_key']); } - $db->sql_freeresult(); + $db->sql_freeresult($result); } $sql = 'DELETE diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 64a203e0bf..b69bcc5f44 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -64,7 +64,8 @@ class session $query_string = trim(implode('&', $args)); // basenamed page name (for example: index.php) - $page_name = htmlspecialchars(basename($script_name)); + $page_name = basename($script_name); + $page_name = urlencode(htmlspecialchars($page_name)); // current directory within the phpBB root (for example: adm) $root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($root_path))); @@ -112,6 +113,13 @@ class session 'page' => $page ); +/* + if (!file_exists($page_name)) + { + trigger_error('You are on a page that does not exist!', E_USER_ERROR); + } +*/ + return $page_array; } @@ -127,9 +135,6 @@ class session * * @param bool $update_session_page if true the session page gets updated. * This can be set to circumvent certain scripts to update the users last visited page. - * - * @todo Introduce further user types, bot, guest - * @todo Change user_type (as above) to a bitfield? user_type & USER_FOUNDER for example */ function session_begin($update_session_page = true) { @@ -148,12 +153,9 @@ class session if (isset($_COOKIE[$config['cookie_name'] . '_sid']) || isset($_COOKIE[$config['cookie_name'] . '_u'])) { - // Switch to request_var ... can this cause issues, can a _GET/_POST param - // be used to poison this? Not sure that it makes any difference in terms of - // the end result, be it a cookie or param. - $this->cookie_data['u'] = request_var($config['cookie_name'] . '_u', 0); - $this->cookie_data['k'] = request_var($config['cookie_name'] . '_k', ''); - $this->session_id = request_var($config['cookie_name'] . '_sid', ''); + $this->cookie_data['u'] = request_var($config['cookie_name'] . '_u', 0, false, true); + $this->cookie_data['k'] = request_var($config['cookie_name'] . '_k', '', false, true); + $this->session_id = request_var($config['cookie_name'] . '_sid', '', false, true); $SID = (defined('NEED_SID')) ? '?sid=' . $this->session_id : '?sid='; $_SID = (defined('NEED_SID')) ? $this->session_id : ''; @@ -265,7 +267,6 @@ class session $db->sql_query($sql); } - // Ultimately to be removed $this->data['is_registered'] = ($this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false; $this->data['is_bot'] = (!$this->data['is_registered'] && $this->data['user_id'] != ANONYMOUS) ? true : false; @@ -275,7 +276,10 @@ class session else { // Added logging temporarly to help debug bugs... - add_log('critical', 'LOG_IP_BROWSER_CHECK', $u_ip, $s_ip, $u_browser, $s_browser); + if (defined('DEBUG_EXTRA')) + { + add_log('critical', 'LOG_IP_BROWSER_CHECK', $u_ip, $s_ip, $u_browser, $s_browser); + } } } } @@ -320,8 +324,7 @@ class session * bot, act accordingly */ $bot = false; - $active_bots = array(); - $cache->obtain_bots($active_bots); + $active_bots = $cache->obtain_bots(); foreach ($active_bots as $row) { @@ -374,7 +377,7 @@ class session $sql = 'SELECT u.* FROM ' . USERS_TABLE . ' u, ' . SESSIONS_KEYS_TABLE . ' k WHERE u.user_id = ' . (int) $this->cookie_data['u'] . ' - AND u.user_type <> ' . USER_INACTIVE . " + AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ") AND k.user_id = u.user_id AND k.key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'"; $result = $db->sql_query($sql); @@ -389,7 +392,7 @@ class session $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . (int) $this->cookie_data['u'] . ' - AND user_type <> ' . USER_INACTIVE; + AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')'; $result = $db->sql_query($sql); $this->data = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -405,9 +408,21 @@ class session $this->cookie_data['k'] = ''; $this->cookie_data['u'] = ($bot) ? $bot : ANONYMOUS; - $sql = 'SELECT * - FROM ' . USERS_TABLE . ' - WHERE user_id = ' . (int) $this->cookie_data['u']; + if (!$bot) + { + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . (int) $this->cookie_data['u']; + } + else + { + // We give bots always the same session if it is not yet expired. + $sql = 'SELECT u.*, s.* + FROM ' . USERS_TABLE . ' u + LEFT JOIN ' . SESSIONS_TABLE . ' s ON (s.session_user_id = u.user_id) + WHERE u.user_id = ' . (int) $bot; + } + $result = $db->sql_query($sql); $this->data = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -422,26 +437,66 @@ class session $this->data['session_last_visit'] = $this->time_now; } + // Force user id to be integer... + $this->data['user_id'] = (int) $this->data['user_id']; + // At this stage we should have a filled data array, defined cookie u and k data. // data array should contain recent session info if we're a real user and a recent // session exists in which case session_id will also be set // Is user banned? Are they excluded? Won't return on ban, exists within method - // @todo Change to !$this->data['user_type'] & USER_FOUNDER && !$this->data['user_type'] & USER_BOT in time if ($this->data['user_type'] != USER_FOUNDER) { $this->check_ban($this->data['user_id'], $this->ip); } - // - // Do away with ultimately? - $this->data['is_registered'] = (!$bot && $this->data['user_id'] != ANONYMOUS) ? true : false; + + $this->data['is_registered'] = (!$bot && $this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false; $this->data['is_bot'] = ($bot) ? true : false; - // - // - // @todo Change this ... check for "... && user_type & USER_NORMAL" ? + // If our friend is a bot, we re-assign a previously assigned session + if ($this->data['is_bot'] && $bot == $this->data['user_id'] && $this->data['session_id']) + { + // Only assign the current session if the ip and browser match... + $s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check'])); + $u_ip = implode('.', array_slice(explode('.', $this->ip), 0, $config['ip_check'])); + + $s_browser = ($config['browser_check']) ? strtolower(substr($this->data['session_browser'], 0, 149)) : ''; + $u_browser = ($config['browser_check']) ? strtolower(substr($this->browser, 0, 149)) : ''; + + if ($u_ip === $s_ip && $s_browser === $u_browser) + { + $this->session_id = $this->data['session_id']; + + // Only update session DB a minute or so after last update or if page changes + if ($this->time_now - $this->data['session_time'] > 60 || ($this->update_session_page && $this->data['session_page'] != $this->page['page'])) + { + $sql_ary = array('session_time' => $this->time_now, 'session_last_visit' => $this->time_now, 'session_admin' => 0); + + if ($this->update_session_page) + { + $sql_ary['session_page'] = substr($this->page['page'], 0, 199); + } + + $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE session_id = '" . $db->sql_escape($this->session_id) . "'"; + $db->sql_query($sql); + } + + $SID = '?sid='; + $_SID = ''; + + return true; + } + else + { + // If the ip and browser does not match make sure we only have one bot assigned to one session + $db->sql_query('DELETE FROM ' . SESSIONS_TABLE . ' WHERE session_user_id = ' . $this->data['user_id']); + } + } + $session_autologin = (($this->cookie_data['k'] || $persist_login) && $this->data['is_registered']) ? true : false; + $set_admin = ($set_admin && $this->data['is_registered']) ? true : false; // Create or update the session $sql_ary = array( @@ -516,6 +571,11 @@ class session unset($cookie_expire); } + else + { + $SID = '?sid='; + $_SID = ''; + } return true; } @@ -588,6 +648,9 @@ class session $SID = '?sid='; $this->session_id = $_SID = ''; + // To make sure a valid session is created we create one for the anonymous user + $this->session_create(ANONYMOUS); + return true; } @@ -610,88 +673,48 @@ class session $this->time_now = time(); } - switch (SQL_LAYER) - { - case 'mysql4': - case 'mysqli': - // Firstly, delete guest sessions - $sql = 'DELETE FROM ' . SESSIONS_TABLE . ' - WHERE session_user_id = ' . ANONYMOUS . ' - AND session_time < ' . (int) ($this->time_now - $config['session_length']); - $db->sql_query($sql); - - // Keep only the most recent session for each user - // Note: if the user is currently browsing the board, his - // last_visit field won't be updated, which I believe should be - // the normal behavior anyway - $db->sql_return_on_error(true); - - $sql = 'DELETE FROM ' . SESSIONS_TABLE . ' - USING ' . SESSIONS_TABLE . ' s1, ' . SESSIONS_TABLE . ' s2 - WHERE s1.session_user_id = s2.session_user_id - AND s1.session_time < s2.session_time'; - $db->sql_query($sql); - - $db->sql_return_on_error(false); - - // Update last visit time - $sql = 'UPDATE ' . USERS_TABLE. ' u, ' . SESSIONS_TABLE . ' s - SET u.user_lastvisit = s.session_time, u.user_lastpage = s.session_page - WHERE s.session_time < ' . (int) ($this->time_now - $config['session_length']) . ' - AND u.user_id = s.session_user_id'; - $db->sql_query($sql); - - // Delete everything else now - $sql = 'DELETE FROM ' . SESSIONS_TABLE . ' - WHERE session_time < ' . (int) ($this->time_now - $config['session_length']); - $db->sql_query($sql); - - set_config('session_last_gc', $this->time_now, true); - break; - - default: + // Firstly, delete guest sessions + $sql = 'DELETE FROM ' . SESSIONS_TABLE . ' + WHERE session_user_id = ' . ANONYMOUS . ' + AND session_time < ' . (int) ($this->time_now - $config['session_length']); + $db->sql_query($sql); - // Get expired sessions, only most recent for each user - $sql = 'SELECT session_user_id, session_page, MAX(session_time) AS recent_time - FROM ' . SESSIONS_TABLE . ' - WHERE session_time < ' . ($this->time_now - $config['session_length']) . ' - GROUP BY session_user_id, session_page'; - $result = $db->sql_query_limit($sql, 5); + // Get expired sessions, only most recent for each user + $sql = 'SELECT session_user_id, session_page, MAX(session_time) AS recent_time + FROM ' . SESSIONS_TABLE . ' + WHERE session_time < ' . ($this->time_now - $config['session_length']) . ' + GROUP BY session_user_id, session_page'; + $result = $db->sql_query_limit($sql, 10); - $del_user_id = array(); - $del_sessions = 0; + $del_user_id = array(); + $del_sessions = 0; - while ($row = $db->sql_fetchrow($result)); - { - if ($row['session_user_id'] != ANONYMOUS) - { - $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_lastvisit = ' . (int) $row['recent_time'] . ", user_lastpage = '" . $db->sql_escape($row['session_page']) . "' - WHERE user_id = " . (int) $row['session_user_id']; - $db->sql_query($sql); - } + while ($row = $db->sql_fetchrow($result)) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_lastvisit = ' . (int) $row['recent_time'] . ", user_lastpage = '" . $db->sql_escape($row['session_page']) . "' + WHERE user_id = " . (int) $row['session_user_id']; + $db->sql_query($sql); - $del_user_id[] = (int) $row['session_user_id']; - $del_sessions++; - } - $db->sql_freeresult($result); + $del_user_id[] = (int) $row['session_user_id']; + $del_sessions++; + } + $db->sql_freeresult($result); - if (sizeof($del_user_id)) - { - // Delete expired sessions - $sql = 'DELETE FROM ' . SESSIONS_TABLE . ' - WHERE ' . $db->sql_in_set('session_user_id', $del_user_id) . ' - AND session_time < ' . ($this->time_now - $config['session_length']); - $db->sql_query($sql); - } + if (sizeof($del_user_id)) + { + // Delete expired sessions + $sql = 'DELETE FROM ' . SESSIONS_TABLE . ' + WHERE ' . $db->sql_in_set('session_user_id', $del_user_id) . ' + AND session_time < ' . ($this->time_now - $config['session_length']); + $db->sql_query($sql); + } - if ($del_sessions < 5) - { - // Less than 5 sessions, update gc timer ... else we want gc - // called again to delete other sessions - set_config('session_last_gc', $this->time_now, true); - } - break; + if ($del_sessions < 10) + { + // Less than 10 sessions, update gc timer ... else we want gc + // called again to delete other sessions + set_config('session_last_gc', $this->time_now, true); } if ($config['max_autologin_time']) @@ -713,20 +736,11 @@ class session { global $config; - if (!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') - { - @setcookie($config['cookie_name'] . '_' . $name, $cookiedata, $cookietime, $config['cookie_path']); - } - else - { - // Firefox does not allow setting cookies with a domain containing no periods. - if (strpos($config['cookie_domain'], '.') === false) - { - $config['cookie_domain'] = '.' . $config['cookie_domain']; - } + $name_data = rawurlencode($config['cookie_name'] . '_' . $name) . '=' . rawurlencode($cookiedata); + $expire = gmdate('D, d-M-Y H:i:s \\G\\M\\T', $cookietime); + $domain = (!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain']; - @setcookie($config['cookie_name'] . '_' . $name, $cookiedata, $cookietime, $config['cookie_path'], $config['cookie_domain'], $config['cookie_secure']); - } + header('Set-Cookie: ' . $name_data . '; expires=' . $expire . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . '; HttpOnly', false); } /** @@ -781,6 +795,7 @@ class session $result = $db->sql_query($sql); + $ban_triggered_by = 'user'; while ($row = $db->sql_fetchrow($result)) { if ((!empty($row['ban_userid']) && intval($row['ban_userid']) == $user_id) || @@ -796,6 +811,20 @@ class session { $banned = true; $ban_row = $row; + + if (!empty($row['ban_userid']) && intval($row['ban_userid']) == $user_id) + { + $ban_triggered_by = 'user'; + } + else if (!empty($row['ban_ip']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $user_ip)) + { + $ban_triggered_by = 'ip'; + } + else + { + $ban_triggered_by = 'email'; + } + // Don't break. Check if there is an exclude rule for this user } } @@ -819,6 +848,8 @@ class session $message = sprintf($this->lang[$message], $till_date, '<a href="mailto:' . $config['board_contact'] . '">', '</a>'); $message .= ($ban_row['ban_give_reason']) ? '<br /><br />' . sprintf($this->lang['BOARD_BAN_REASON'], $ban_row['ban_give_reason']) : ''; + $message .= '<br /><br /><em>' . $this->lang['BAN_TRIGGERED_BY_' . strtoupper($ban_triggered_by)] . '</em>'; + trigger_error($message); } @@ -826,6 +857,45 @@ class session } /** + * Check if ip is blacklisted + * This should be called only where absolutly necessary + * + * Only IPv4 (rbldns does not support AAAA records/IPv6 lookups) + * + * @author satmd (from the php manual) + * @return false if ip is not blacklisted, else an array([checked server], [lookup]) + */ + function check_dnsbl($ip = false) + { + if ($ip === false) + { + $ip = $this->ip; + } + + $dnsbl_check = array( + 'bl.spamcop.net' => 'http://spamcop.net/bl.shtml?', + 'list.dsbl.org' => 'http://dsbl.org/listing?', + 'sbl-xbl.spamhaus.org' => 'http://www.spamhaus.org/query/bl?ip=', + ); + + if ($ip) + { + $quads = explode('.', $ip); + $reverse_ip = $quads[3] . '.' . $quads[2] . '.' . $quads[1] . '.' . $quads[0]; + + foreach ($dnsbl_check as $dnsbl => $lookup) + { + if (phpbb_checkdnsrr($reverse_ip . '.' . $dnsbl . '.', 'A') === true) + { + return array($dnsbl, $lookup . $ip); + } + } + } + + return false; + } + + /** * Set/Update a persistent login key * * This method creates or updates a persistent session key. When a user makes @@ -960,15 +1030,20 @@ class user extends session $this->timezone = $config['board_timezone'] * 3600; $this->dst = $config['board_dst'] * 3600; -/* Browser-specific language setting removed - might re-appear later + /** + * If a guest user is surfing, we try to guess his/her language first by obtaining the browser language + * @todo if re-enabled we need to make sure only those languages installed are checked if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); + foreach ($accept_lang_ary as $accept_lang) { // Set correct format ... guess full xx_YY form $accept_lang = substr($accept_lang, 0, 2) . '_' . strtoupper(substr($accept_lang, 3, 2)); + $accept_lang = basename($accept_lang); + if (file_exists($phpbb_root_path . 'language/' . $accept_lang . "/common.$phpEx")) { $this->lang_name = $config['default_lang'] = $accept_lang; @@ -979,6 +1054,8 @@ class user extends session { // No match on xx_YY so try xx $accept_lang = substr($accept_lang, 0, 2); + $accept_lang = basename($accept_lang); + if (file_exists($phpbb_root_path . 'language/' . $accept_lang . "/common.$phpEx")) { $this->lang_name = $config['default_lang'] = $accept_lang; @@ -988,7 +1065,7 @@ class user extends session } } } -*/ + */ } // We include common language file here to not load it every time a custom language file is included @@ -1141,7 +1218,7 @@ class user extends session // 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') && $config['chg_passforce'] && $this->data['is_registered'] && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400)) + if (!defined('IN_ADMIN') && !defined('ADMIN_START') && $config['chg_passforce'] && $this->data['is_registered'] && $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") { @@ -1207,7 +1284,7 @@ class user extends session /** * Set language entry (called by add_lang) - * @access: private + * @access private */ function set_lang(&$lang, &$help, $lang_file, $use_db = false, $use_help = false) { @@ -1263,12 +1340,17 @@ class user extends session $midnight = gmmktime(0, 0, 0, $m, $d, $y) - $this->timezone - $this->dst; } - if (strpos($format, '|') === false || (!($gmepoch > $midnight && !$forcedate) && !($gmepoch > $midnight - 86400 && !$forcedate))) + if (strpos($format, '|') === false || ($gmepoch < $midnight - 86400 && !$forcedate) || ($gmepoch > $midnight + 172800 && !$forcedate)) { return strtr(@gmdate(str_replace('|', '', $format), $gmepoch + $this->timezone + $this->dst), $lang_dates); } - if ($gmepoch > $midnight && !$forcedate) + if ($gmepoch > $midnight + 86400 && !$forcedate) + { + $format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1); + return str_replace('||', $this->lang['datetime']['TOMORROW'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates)); + } + else if ($gmepoch > $midnight && !$forcedate) { $format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1); return str_replace('||', $this->lang['datetime']['TODAY'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates)); @@ -1337,13 +1419,15 @@ class user extends session static $imgs; global $phpbb_root_path; - if (empty($imgs[$img . $suffix]) || $width !== false) + $img_data = &$imgs[$img . $suffix]; + + if (empty($img_data) || $width !== false) { if (!isset($this->theme[$img]) || !$this->theme[$img]) { // Do not fill the image to let designers decide what to do if the image is empty - $imgs[$img . $suffix] = ''; - return $imgs[$img . $suffix]; + $img_data = ''; + return $img_data; } // Do not include dimensions? @@ -1369,9 +1453,9 @@ class user extends session $imgsrc = str_replace('{SUFFIX}', $suffix, $imgsrc); } - $imgs[$img . $suffix]['src'] = $phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . str_replace('{LANG}', $this->img_lang, $imgsrc); - $imgs[$img . $suffix]['width'] = $width; - $imgs[$img . $suffix]['height'] = $height; + $img_data['src'] = $phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . str_replace('{LANG}', $this->img_lang, $imgsrc); + $img_data['width'] = $width; + $img_data['height'] = $height; } $alt = (!empty($this->lang[$alt])) ? $this->lang[$alt] : $alt; @@ -1379,19 +1463,19 @@ class user extends session switch ($type) { case 'src': - return $imgs[$img . $suffix]['src']; + return $img_data['src']; break; case 'width': - return $imgs[$img . $suffix]['width']; + return $img_data['width']; break; case 'height': - return $imgs[$img . $suffix]['height']; + return $img_data['height']; break; default: - return '<img src="' . $imgs[$img . $suffix]['src'] . '"' . (($imgs[$img . $suffix]['width']) ? ' width="' . $imgs[$img . $suffix]['width'] . '"' : '') . (($imgs[$img . $suffix]['height']) ? ' height="' . $imgs[$img . $suffix]['height'] . '"' : '') . ' alt="' . $alt . '" title="' . $alt . '" />'; + return '<img src="' . $img_data['src'] . '"' . (($img_data['width']) ? ' width="' . $img_data['width'] . '"' : '') . (($img_data['height']) ? ' height="' . $img_data['height'] . '"' : '') . ' alt="' . $alt . '" title="' . $alt . '" />'; break; } } diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 5281860ac5..36a0b8920b 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -39,11 +39,11 @@ class template /** * Set template location - * @access: public + * @access public */ function set_template() { - global $phpbb_root_path, $config, $user; + global $phpbb_root_path, $user; if (file_exists($phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template')) { @@ -60,7 +60,7 @@ class template /** * Set custom template location (able to use directory outside of phpBB) - * @access: public + * @access public */ function set_custom_template($template_path, $template_name) { @@ -75,7 +75,7 @@ class template /** * Sets the template filenames for handles. $filename_array * should be a hash of handle => filename pairs. - * @access: public + * @access public */ function set_filenames($filename_array) { @@ -100,7 +100,7 @@ class template /** * Destroy template data set - * @access: public + * @access public */ function destroy() { @@ -109,7 +109,7 @@ class template /** * Reset/empty complete block - * @access: public + * @access public */ function destroy_block_vars($blockname) { @@ -139,7 +139,7 @@ class template /** * Display handle - * @access: public + * @access public */ function display($handle, $include_once = true) { @@ -159,7 +159,7 @@ class template /** * Display the handle and assign the output to a template variable or return the compiled result. - * @access: public + * @access public */ function assign_display($handle, $template_var = '', $return_content = true, $include_once = false) { @@ -179,7 +179,7 @@ class template /** * Load a compiled template if possible, if not, recompile it - * @access: private + * @access private */ function _tpl_load(&$handle) { @@ -197,7 +197,11 @@ class template global $db, $phpbb_root_path; - include_once($phpbb_root_path . 'includes/functions_template.' . $phpEx); + if (!class_exists('template_compile')) + { + include($phpbb_root_path . 'includes/functions_template.' . $phpEx); + } + $compile = new template_compile($this); // If the file for this handle is already loaded and compiled, do nothing. @@ -271,7 +275,7 @@ class template /** * Assign key variable pairs from an array - * @access: public + * @access public */ function assign_vars($vararray) { @@ -285,7 +289,7 @@ class template /** * Assign a single variable to a single key - * @access: public + * @access public */ function assign_var($varname, $varval) { @@ -296,7 +300,7 @@ class template /** * Assign key variable pairs from an array to a specified block - * @access: public + * @access public */ function assign_block_vars($blockname, $vararray) { @@ -398,7 +402,7 @@ class template * and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars) * * @return false on error, true on success - * @access: public + * @access public */ function alter_block_array($blockname, $vararray, $key = false, $mode = 'insert') { @@ -484,7 +488,7 @@ class template /** * Include a seperate template - * @access: private + * @access private */ function _tpl_include($filename, $include = true) { @@ -500,7 +504,7 @@ class template if ($filename) { - include_once($filename); + include($filename); return; } eval(' ?>' . $this->compiled_code[$handle] . '<?php '); diff --git a/phpBB/includes/ucp/info/ucp_attachments.php b/phpBB/includes/ucp/info/ucp_attachments.php index 6028b5922a..a6aa393da5 100644 --- a/phpBB/includes/ucp/info/ucp_attachments.php +++ b/phpBB/includes/ucp/info/ucp_attachments.php @@ -20,7 +20,7 @@ class ucp_attachments_info 'title' => 'UCP_ATTACHMENTS', 'version' => '1.0.0', 'modes' => array( - 'attachments' => array('title' => 'UCP_ATTACHMENTS', 'auth' => 'acl_u_attach', 'cat' => array('UCP_ATTACHMENTS')), + 'attachments' => array('title' => 'UCP_MAIN_ATTACHMENTS', 'auth' => 'acl_u_attach', 'cat' => array('UCP_MAIN')), ), ); } diff --git a/phpBB/includes/ucp/info/ucp_prefs.php b/phpBB/includes/ucp/info/ucp_prefs.php index 4700ebc43a..53a012ea3c 100644 --- a/phpBB/includes/ucp/info/ucp_prefs.php +++ b/phpBB/includes/ucp/info/ucp_prefs.php @@ -21,8 +21,8 @@ class ucp_prefs_info 'version' => '1.0.0', 'modes' => array( 'personal' => array('title' => 'UCP_PREFS_PERSONAL', 'auth' => '', 'cat' => array('UCP_PREFS')), - 'view' => array('title' => 'UCP_PREFS_VIEW', 'auth' => '', 'cat' => array('UCP_PREFS')), 'post' => array('title' => 'UCP_PREFS_POST', 'auth' => '', 'cat' => array('UCP_PREFS')), + 'view' => array('title' => 'UCP_PREFS_VIEW', 'auth' => '', 'cat' => array('UCP_PREFS')), ), ); } diff --git a/phpBB/includes/ucp/info/ucp_profile.php b/phpBB/includes/ucp/info/ucp_profile.php index 61daccda45..86b731c280 100644 --- a/phpBB/includes/ucp/info/ucp_profile.php +++ b/phpBB/includes/ucp/info/ucp_profile.php @@ -20,10 +20,10 @@ class ucp_profile_info 'title' => 'UCP_PROFILE', 'version' => '1.0.0', 'modes' => array( - 'reg_details' => array('title' => 'UCP_PROFILE_REG_DETAILS', 'auth' => '', 'cat' => array('UCP_PROFILE')), 'profile_info' => array('title' => 'UCP_PROFILE_PROFILE_INFO', 'auth' => '', 'cat' => array('UCP_PROFILE')), 'signature' => array('title' => 'UCP_PROFILE_SIGNATURE', 'auth' => '', 'cat' => array('UCP_PROFILE')), 'avatar' => array('title' => 'UCP_PROFILE_AVATAR', 'auth' => '', 'cat' => array('UCP_PROFILE')), + 'reg_details' => array('title' => 'UCP_PROFILE_REG_DETAILS', 'auth' => '', 'cat' => array('UCP_PROFILE')), ), ); } diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php index 5f7ba150f4..b3cb27223a 100644 --- a/phpBB/includes/ucp/ucp_activate.php +++ b/phpBB/includes/ucp/ucp_activate.php @@ -53,7 +53,6 @@ class ucp_activate if ($update_password) { $sql_ary = array( - 'user_type' => USER_NORMAL, 'user_actkey' => '', 'user_password' => $user_row['user_newpasswd'], 'user_newpasswd' => '' @@ -69,12 +68,12 @@ class ucp_activate { include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); - // Now we need to demote the user from the inactive group and add him to the registered group - user_active_flip($user_row['user_id'], $user_row['user_type'], '', $user_row['username'], true); + user_active_flip('activate', $user_row['user_id']); - // Update last username - update_last_username(); - set_config('num_users', $config['num_users'] + 1, true); + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_actkey = '' + WHERE user_id = {$user_row['user_id']}"; + $db->sql_query($sql); } if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password) @@ -94,10 +93,7 @@ class ucp_activate $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); $messenger->assign_vars(array( - 'SITENAME' => $config['sitename'], - 'USERNAME' => html_entity_decode($user_row['username']), - - 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])) + 'USERNAME' => htmlspecialchars_decode($user_row['username'])) ); $messenger->send($user_row['user_notify_type']); diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index 549e3a11b2..2312d1f30d 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -78,11 +78,17 @@ class ucp_attachments $s_sort_dir .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>'; } + if (!isset($sort_key_sql[$sort_key])) + { + $sort_key = 'a'; + } + $order_by = $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); $sql = 'SELECT COUNT(attach_id) as num_attachments FROM ' . ATTACHMENTS_TABLE . ' - WHERE poster_id = ' . $user->data['user_id']; + WHERE poster_id = ' . $user->data['user_id'] . ' + AND is_orphan = 0'; $result = $db->sql_query($sql); $num_attachments = $db->sql_fetchfield('num_attachments'); $db->sql_freeresult($result); @@ -92,6 +98,7 @@ class ucp_attachments LEFT JOIN ' . TOPICS_TABLE . ' t ON (a.topic_id = t.topic_id AND a.in_message = 0) LEFT JOIN ' . PRIVMSGS_TABLE . ' p ON (a.post_msg_id = p.msg_id AND a.in_message = 1) WHERE a.poster_id = ' . $user->data['user_id'] . " + AND a.is_orphan = 0 ORDER BY $order_by"; $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); diff --git a/phpBB/includes/ucp/ucp_confirm.php b/phpBB/includes/ucp/ucp_confirm.php index 2c83306e5e..087a186fa7 100644 --- a/phpBB/includes/ucp/ucp_confirm.php +++ b/phpBB/includes/ucp/ucp_confirm.php @@ -54,37 +54,9 @@ class ucp_confirm exit; } - // Some people might want the olde style CAPTCHA even if they have GD enabled, this also saves us from people who have GD but no TTF - $policy_modules = array('policy_entropy', 'policy_3dbitmap'); - - if (function_exists('imagettfbbox') && function_exists('imagettftext')) - { - $policy_modules = array_merge($policy_modules, array('policy_overlap', 'policy_shape', 'policy_cells', 'policy_stencil', 'policy_composite')); - } - - foreach ($policy_modules as $key => $name) + if ($config['captcha_gd']) { - if ($config[$name] === '0') - { - unset($policy_modules[$key]); - } - } - - $policy = ''; - if (@extension_loaded('gd') && sizeof($policy_modules)) - { - $change_lang = request_var('change_lang', ''); - - if ($change_lang) - { - $lang = $change_lang; - $user->lang_name = $lang = $change_lang; - $user->lang_path = $phpbb_root_path . 'language/' . $lang . '/'; - $user->lang = array(); - $user->add_lang(array('common', 'ucp')); - } include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx); - $policy = $policy_modules[array_rand($policy_modules)]; } else { @@ -92,7 +64,7 @@ class ucp_confirm } $captcha = new captcha(); - $captcha->execute($row['code'], $policy); + $captcha->execute($row['code']); exit; } } diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 47403c83da..ad6bde9be7 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -172,8 +172,6 @@ class ucp_groups include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $messenger = new messenger(); - $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); - $sql = 'SELECT u.username, u.user_email, u.user_notify_type, u.user_jabber, u.user_lang FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u WHERE ug.user_id = u.user_id @@ -190,10 +188,8 @@ class ucp_groups $messenger->im($row['user_jabber'], $row['username']); $messenger->assign_vars(array( - 'EMAIL_SIG' => $email_sig, - 'SITENAME' => $config['sitename'], - 'USERNAME' => html_entity_decode($row['username']), - 'GROUP_NAME' => html_entity_decode($group_row[$group_id]['group_name']), + 'USERNAME' => htmlspecialchars_decode($row['username']), + 'GROUP_NAME' => htmlspecialchars_decode($group_row[$group_id]['group_name']), 'U_PENDING' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=manage&action=list&g=$group_id", 'U_GROUP' => generate_board_url() . "/memberlist.$phpEx?mode=group&g=$group_id") @@ -496,7 +492,7 @@ class ucp_groups { if (isset($group_row['group_avatar']) && $group_row['group_avatar']) { - avatar_delete($group_row['group_avatar']); + avatar_delete('group', $group_row); } } @@ -723,7 +719,8 @@ class ucp_groups 'PAGINATION' => generate_pagination($this->u_action . "&action=$action&g=$group_id", $total_members, $config['topics_per_page'], $start, true), 'U_ACTION' => $this->u_action . "&g=$group_id", - 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=usernames')) + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=usernames'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=usernames', false)) ); break; @@ -862,7 +859,7 @@ class ucp_groups $user->add_lang(array('acp/groups', 'acp/common')); - $name_ary = request_var('usernames', ''); + $name_ary = request_var('usernames', '', true); if (!$group_id) { diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 8936a7728b..67e1c4d155 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -65,7 +65,7 @@ class ucp_main if (sizeof($forum_ary)) { - $sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary); + $sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true); } $result = $db->sql_query_limit($sql, 1); $g_forum_id = (int) $db->sql_fetchfield('forum_id'); @@ -76,15 +76,20 @@ class ucp_main WHERE t.forum_id = 0 AND t.topic_type = " . POST_GLOBAL . ' ORDER BY t.topic_last_post_time DESC'; - $result = $db->sql_query($sql); $topic_list = $rowset = array(); - while ($row = $db->sql_fetchrow($result)) + // If the user can't see any forums, he can't read any posts because fid of 0 is invalid + if ($g_forum_id) { - $topic_list[] = $row['topic_id']; - $rowset[$row['topic_id']] = $row; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $topic_list[] = $row['topic_id']; + $rowset[$row['topic_id']] = $row; + } + $db->sql_freeresult($result); } - $db->sql_freeresult($result); $topic_tracking_info = array(); if ($config['load_db_lastread']) @@ -122,8 +127,10 @@ class ucp_main $template->assign_block_vars('topicrow', array( 'FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, + 'LAST_POST_SUBJECT' => $row['topic_last_post_subject'], 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), 'LAST_POST_AUTHOR' => ($row['topic_last_poster_id'] == ANONYMOUS) ? (($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] . ' ' : $user->lang['GUEST'] . ' ') : $row['topic_last_poster_name'], + 'LAST_POST_AUTHOR_COLOUR' => ($row['topic_last_poster_colour']) ? '#' . $row['topic_last_poster_colour'] : '', 'TOPIC_TITLE' => censor_text($row['topic_title']), 'TOPIC_TYPE' => $topic_type, @@ -131,7 +138,7 @@ class ucp_main 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'), 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), - 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', '') : '', + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', '') : '', 'S_USER_POSTED' => (!empty($row['topic_posted']) && $row['topic_posted']) ? true : false, 'S_UNREAD' => $unread_topic, @@ -170,7 +177,6 @@ class ucp_main 'INTERESTS' => (!empty($row['user_interests'])) ? $row['user_interests'] : '', // 'S_GROUP_OPTIONS' => $group_options, - 'S_SHOW_ACTIVITY' => ($config['load_user_activity']) ? true : false, 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $user->data['user_id'] . '&sr=posts') : '') ); @@ -286,6 +292,7 @@ class ucp_main $last_post_time = $user->format_date($row['forum_last_post_time']); $last_poster = ($row['forum_last_poster_name'] != '') ? $row['forum_last_poster_name'] : $user->lang['GUEST']; + $last_poster_colour = ($row['forum_last_poster_colour']) ? '#' . $row['forum_last_poster_colour'] : ''; $last_poster_url = ($row['forum_last_poster_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['forum_last_poster_id']); $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&p=" . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id']; @@ -299,10 +306,14 @@ class ucp_main 'FORUM_ID' => $forum_id, 'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt), 'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'), + 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '', + 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'FORUM_NAME' => $row['forum_name'], 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'), + 'LAST_POST_SUBJECT' => $row['forum_last_post_subject'], 'LAST_POST_TIME' => $last_post_time, 'LAST_POST_AUTHOR' => $last_poster, + 'LAST_POST_AUTHOR_COLOUR' => $last_poster_colour, 'U_LAST_POST_AUTHOR' => $last_poster_url, 'U_LAST_POST' => $last_post_url, @@ -417,13 +428,17 @@ class ucp_main // Send vars to template $template->assign_block_vars('topicrow', array( - 'FORUM_ID' => $forum_id, - 'TOPIC_ID' => $topic_id, - 'TOPIC_AUTHOR' => topic_topic_author($row), - 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), - 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), - 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), - 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'], + 'FORUM_ID' => $forum_id, + 'TOPIC_ID' => $topic_id, + 'TOPIC_AUTHOR' => ($row['topic_first_poster_name']) ? $row['topic_first_poster_name'] : $user->lang['GUEST'], + 'TOPIC_AUTHOR_COLOUR' => ($row['topic_first_poster_colour']) ? '#' . $row['topic_first_poster_colour'] : '', + 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), + 'LAST_POST_SUBJECT' => $row['topic_last_post_subject'], + 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), + 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), + 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'], + 'LAST_POST_AUTHOR_COLOUR' => ($row['topic_last_poster_colour']) ? '#' . $row['topic_last_poster_colour'] : '', + 'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&t=$topic_id")), 'REPLIES' => $replies, 'VIEWS' => $row['topic_views'], @@ -437,7 +452,7 @@ class ucp_main 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '', - 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'S_TOPIC_TYPE' => $row['topic_type'], 'S_USER_POSTED' => (!empty($row['topic_posted'])) ? true : false, @@ -446,6 +461,7 @@ class ucp_main 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=unread") . '#unread', 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR' => ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_last_poster_id']) : '', + 'U_TOPIC_AUTHOR' => ($row['topic_poster'] != ANONYMOUS && $row['topic_poster']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_poster']) : '', 'U_VIEW_TOPIC' => $view_topic_url) ); } @@ -578,22 +594,26 @@ class ucp_main 'S_DELETED_TOPIC' => (!$row['topic_id']) ? true : false, 'S_GLOBAL_TOPIC' => (!$forum_id) ? true : false, - 'TOPIC_AUTHOR' => topic_topic_author($row), - 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), - 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), - 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), - 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'], - 'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&t=$topic_id")), + 'TOPIC_AUTHOR' => ($row['topic_first_poster_name']) ? $row['topic_first_poster_name'] : $user->lang['GUEST'], + 'TOPIC_AUTHOR_COLOUR' => ($row['topic_first_poster_colour']) ? '#' . $row['topic_first_poster_colour'] : '', + 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), + 'LAST_POST_SUBJECT' => $row['topic_last_post_subject'], + 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), + 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), + 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'], + 'LAST_POST_AUTHOR_COLOUR' => ($row['topic_last_poster_colour']) ? '#' . $row['topic_last_poster_colour'] : '', + 'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&t=$topic_id")), 'POSTED_AT' => $user->format_date($row['topic_time']), 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), - 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', '') : '', + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', '') : '', 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'), 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR' => ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_last_poster_id']) : '', + 'U_TOPIC_AUTHOR' => ($row['topic_poster'] != ANONYMOUS && $row['topic_poster']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_poster']) : '', 'U_VIEW_TOPIC' => $view_topic_url, 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), 'U_MOVE_UP' => ($row['order_id'] != 1) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=main&mode=bookmarks&move_up=' . $row['order_id']) : '', @@ -642,6 +662,8 @@ class ucp_main { $draft_subject = request_var('subject', '', true); $draft_message = request_var('message', '', true); + + utf8_normalize_nfc(array(&$draft_subject, &$draft_message)); if ($draft_message && $draft_subject) { diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index 5d1a4297ee..14afc81686 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -96,7 +96,7 @@ class ucp_pm $template->assign_vars(array( 'MESSAGE' => $l_new_message, 'S_NOT_LOGGED_IN' => ($user->data['user_id'] == ANONYMOUS) ? true : false, - 'CLICK_TO_VIEW' => sprintf($user->lang['CLICK_VIEW_PRIVMSG'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox') . '" onclick="jump_to_inbox();return false;" target="_new">', '</a>'), + 'CLICK_TO_VIEW' => sprintf($user->lang['CLICK_VIEW_PRIVMSG'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox') . '" onclick="jump_to_inbox(); return false;">', '</a>'), 'U_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'), 'UA_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox', false)) ); @@ -246,6 +246,17 @@ class ucp_pm { place_pm_into_folder($global_privmsgs_rules, request_var('release', 0)); $num_not_moved = $user->data['user_new_privmsg']; + + // Make sure num_not_moved is valid. + if ($num_not_moved < 0) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new_privmsg = 0, user_unread_privmsg = 0 + WHERE user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + + $num_not_moved = $user->data['user_new_privmsg'] = $user->data['user_unread_privmsg'] = 0; + } } if (!$msg_id && $folder_id == PRIVMSGS_NO_BOX) @@ -392,7 +403,7 @@ class ucp_pm break; default: - trigger_error('NO_ACTION_MODE'); + trigger_error('NO_ACTION_MODE', E_USER_ERROR); break; } diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index ff95bfc307..98aa35117b 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -66,6 +66,34 @@ function compose_pm($id, $mode, $action) redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm')); } + // Output PM_TO box if message composing + if ($action != 'edit') + { + if ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) + { + $sql = 'SELECT group_id, group_name, group_type + FROM ' . GROUPS_TABLE . ' + WHERE group_type NOT IN (' . GROUP_HIDDEN . ', ' . GROUP_CLOSED . ') + AND group_receive_pm = 1 + ORDER BY group_type DESC'; + $result = $db->sql_query($sql); + + $group_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="blue"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>'; + } + $db->sql_freeresult($result); + } + + $template->assign_vars(array( + 'S_SHOW_PM_BOX' => true, + 'S_ALLOW_MASS_PM' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? true : false, + 'S_GROUP_OPTIONS' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? $group_options : '', + 'U_SEARCH_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=post&field=username_list')) + ); + } + $sql = ''; // What is all this following SQL for? Well, we need to know @@ -149,7 +177,7 @@ function compose_pm($id, $mode, $action) break; default: - trigger_error('NO_ACTION_MODE'); + trigger_error('NO_ACTION_MODE', E_USER_ERROR); } if ($action == 'forward' && (!$config['forward_pm'] || !$auth->acl_get('u_pm_forward'))) @@ -177,7 +205,7 @@ function compose_pm($id, $mode, $action) $folder_id = (isset($post['folder_id'])) ? $post['folder_id'] : 0; $message_text = (isset($post['message_text'])) ? $post['message_text'] : ''; - if (!$post['author_id'] && $msg_id) + if ((!$post['author_id'] || ($post['author_id'] == ANONYMOUS && $action != 'delete')) && $msg_id) { trigger_error('NO_AUTHOR'); } @@ -307,19 +335,21 @@ function compose_pm($id, $mode, $action) $error[] = $user->lang['TOO_MANY_RECIPIENTS']; } + // Always check if the submitted attachment data is valid and belongs to the user. + // Further down (especially in submit_post()) we do not check this again. $message_parser->get_submitted_attachment_data(); if ($message_attachment && !$submit && !$refresh && !$preview && $action == 'edit') { - $sql = 'SELECT attach_id, physical_filename, attach_comment, real_filename, extension, mimetype, filesize, filetime, thumbnail + // Do not change to SELECT * + $sql = 'SELECT attach_id, is_orphan, attach_comment, real_filename FROM ' . ATTACHMENTS_TABLE . " WHERE post_msg_id = $msg_id AND in_message = 1 - ORDER BY filetime " . ((!$config['display_order']) ? 'DESC' : 'ASC'); + AND is_orphan = 0 + ORDER BY filetime " . ((!$config['display_order']) ? 'DESC' : 'ASC'); $result = $db->sql_query($sql); - $message_parser->attachment_data = array_merge($message_parser->attachment_data, $db->sql_fetchrowset($result)); - $db->sql_freeresult($result); } @@ -361,6 +391,7 @@ function compose_pm($id, $mode, $action) $smilies_status = ($config['allow_smilies'] && $config['auth_smilies_pm'] && $auth->acl_get('u_pm_smilies')) ? true : false; $img_status = ($config['auth_img_pm'] && $auth->acl_get('u_pm_img')) ? true : false; $flash_status = ($config['auth_flash_pm'] && $auth->acl_get('u_pm_flash')) ? true : false; + $url_status = ($config['allow_post_links']) ? true : false; // Save Draft if ($save && $auth->acl_get('u_savedrafts')) @@ -368,6 +399,8 @@ function compose_pm($id, $mode, $action) $subject = request_var('subject', '', true); $subject = (!$subject && $action != 'post') ? $user->lang['NEW_MESSAGE'] : $subject; $message = request_var('message', '', true); + + utf8_normalize_nfc(array(&$subject, &$message)); if ($subject && $message) { @@ -444,13 +477,9 @@ function compose_pm($id, $mode, $action) if ($submit || $preview || $refresh) { $subject = request_var('subject', '', true); - - if (strcmp($subject, strtoupper($subject)) == 0 && $subject) - { - $subject = strtolower($subject); - } - $message_parser->message = request_var('message', '', true); + + utf8_normalize_nfc(array(&$subject, &$message_parser->message)); $icon_id = request_var('icon', 0); @@ -473,7 +502,7 @@ function compose_pm($id, $mode, $action) $message_parser->parse_attachments('fileupload', $action, 0, $submit, $preview, $refresh, true); // Parse message - $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $img_status, $flash_status, true); + $message_parser->parse($enable_bbcode, ($config['allow_post_links']) ? $enable_urls : false, $enable_smilies, $img_status, $flash_status, true, $config['allow_sig_links']); if ($action != 'edit' && !$preview && !$refresh && $config['flood_interval'] && !$auth->acl_get('u_ignoreflood')) { @@ -604,7 +633,14 @@ function compose_pm($id, $mode, $action) if ($action == 'quotepost') { $post_id = request_var('p', 0); - $message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}]{$message_subject}[/url]\n"; + if ($config['allow_post_links']) + { + $message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}]{$message_subject}[/url]\n\n"; + } + else + { + $message_link = $user->lang['SUBJECT'] . ': ' . $message_subject . " (" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id})\n\n"; + } } else { @@ -622,14 +658,23 @@ function compose_pm($id, $mode, $action) { $fwd_to_field = write_pm_addresses(array('to' => $post['to_address']), 0, true); + if ($config['allow_post_links']) + { + $quote_username_text = '[url=' . generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&u={$post['author_id']}]{$quote_username}[/url]"; + } + else + { + $quote_username_text = $quote_username . ' (' . generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&u={$post['author_id']})"; + } + $forward_text = array(); $forward_text[] = $user->lang['FWD_ORIGINAL_MESSAGE']; $forward_text[] = sprintf($user->lang['FWD_SUBJECT'], censor_text($message_subject)); $forward_text[] = sprintf($user->lang['FWD_DATE'], $user->format_date($message_time)); - $forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username); + $forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username_text); $forward_text[] = sprintf($user->lang['FWD_TO'], implode(', ', $fwd_to_field['to'])); - $message_parser->message = implode("\n", $forward_text) . "\n\n[quote=\"[url=" . generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&u={$post['author_id']}]{$quote_username}[/url]\"]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]"; + $message_parser->message = implode("\n", $forward_text) . "\n\n[quote=\"{$quote_username}\"]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]"; $message_subject = ((!preg_match('/^Fwd:/', $message_subject)) ? 'Fwd: ' : '') . censor_text($message_subject); } @@ -783,10 +828,11 @@ function compose_pm($id, $mode, $action) 'SUBJECT' => (isset($message_subject)) ? $message_subject : '', 'MESSAGE' => $message_text, - 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '" onclick="target=\'_phpbbcode\';">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '" onclick="target=\'_phpbbcode\';">', '</a>'), + 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'), 'IMG_STATUS' => ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], 'FLASH_STATUS' => ($flash_status) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], 'SMILIES_STATUS' => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], + 'URL_STATUS' => ($url_status) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'], 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['PM']), 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', @@ -798,6 +844,7 @@ function compose_pm($id, $mode, $action) 'S_SMILIES_CHECKED' => ($smilies_checked) ? ' checked="checked"' : '', 'S_SIG_ALLOWED' => ($config['allow_sig'] && $auth->acl_get('u_sig')), 'S_SIGNATURE_CHECKED' => ($sig_checked) ? ' checked="checked"' : '', + 'S_LINKS_ALLOWED' => $url_status, 'S_MAGIC_URL_CHECKED' => ($urls_checked) ? ' checked="checked"' : '', 'S_SAVE_ALLOWED' => $auth->acl_get('u_savedrafts'), 'S_HAS_DRAFTS' => ($auth->acl_get('u_savedrafts') && $drafts), @@ -806,6 +853,7 @@ function compose_pm($id, $mode, $action) 'S_BBCODE_IMG' => $img_status, 'S_BBCODE_FLASH' => $flash_status, 'S_BBCODE_QUOTE' => true, + 'S_BBCODE_URL' => $url_status, 'S_POST_ACTION' => $s_action, 'S_HIDDEN_ADDRESS_FIELD' => $s_hidden_address_field, @@ -868,8 +916,8 @@ function handle_message_list_actions(&$address_list, $remove_u, $remove_g, $add_ $user_id_ary = array(); // Build usernames to add - $usernames = (isset($_REQUEST['username'])) ? array(request_var('username', '')) : array(); - $username_list = request_var('username_list', ''); + $usernames = (isset($_REQUEST['username'])) ? array(request_var('username', '', true)) : array(); + $username_list = request_var('username_list', '', true); if ($username_list) { $usernames = array_merge($usernames, explode("\n", $username_list)); @@ -900,6 +948,11 @@ function handle_message_list_actions(&$address_list, $remove_u, $remove_g, $add_ while ($row = $db->sql_fetchrow($result)) { + if ($row['user_id'] == ANONYMOUS) + { + continue; + } + $address_list['u'][$row['user_id']] = $type; } $db->sql_freeresult($result); @@ -908,6 +961,11 @@ function handle_message_list_actions(&$address_list, $remove_u, $remove_g, $add_ { foreach ($user_id_ary as $user_id) { + if ($user_id == ANONYMOUS) + { + continue; + } + $address_list['u'][$user_id] = $type; } } diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php index c9e911b5f4..9b86553569 100644 --- a/phpBB/includes/ucp/ucp_pm_options.php +++ b/phpBB/includes/ucp/ucp_pm_options.php @@ -250,6 +250,8 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit $rule_string = ($cond_option != 'none') ? request_var('rule_string', '', true) : ''; $rule_user_id = ($cond_option != 'none') ? request_var('rule_user_id', 0) : 0; $rule_group_id = ($cond_option != 'none') ? request_var('rule_group_id', 0) : 0; + + utf8_normalize_nfc(&$rule_string); $action = (int) $action_option[0]; $folder_id = (int) $action_option[1]; @@ -433,7 +435,8 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit 'DEFAULT_ACTION' => ($config['full_folder_action'] == 1) ? $user->lang['DELETE_OLDEST_MESSAGES'] : $user->lang['HOLD_NEW_MESSAGES'], - 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=rule_string')) + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=rule_string'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=rule_string', true)) ); $rule_lang = $action_lang = $check_lang = array(); @@ -478,6 +481,11 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit } // Check + if (!isset($global_privmsgs_rules[$check_option])) + { + $check_option = 0; + } + define_check_option(($check_option && !isset($back['rule'])) ? true : false, $check_option, $check_lang); if ($check_option && !isset($back['rule'])) @@ -633,6 +641,8 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule { case 'text': $rule_string = request_var('rule_string', '', true); + + utf8_normalize_nfc(&$rule_string); $template->assign_vars(array( 'S_TEXT_CONDITION' => true, @@ -647,12 +657,14 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule case 'user': $rule_user_id = request_var('rule_user_id', 0); $rule_string = request_var('rule_string', '', true); + + utf8_normalize_nfc(&$rule_string); if ($rule_string && !$rule_user_id) { $sql = 'SELECT user_id FROM ' . USERS_TABLE . " - WHERE LOWER(username) = '" . $db->sql_escape(strtolower($rule_string)) . "'"; + WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($rule_string)) . "'"; $result = $db->sql_query($sql); $rule_user_id = (int) $db->sql_fetchfield('user_id'); $db->sql_freeresult($result); @@ -690,6 +702,8 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule case 'group': $rule_group_id = request_var('rule_group_id', 0); $rule_string = request_var('rule_string', '', true); + + utf8_normalize_nfc(&$rule_string); $sql_and = ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? '<> ' . GROUP_SPECIAL : 'NOT IN (' . GROUP_SPECIAL . ', ' . GROUP_HIDDEN . ')'; $sql = 'SELECT group_id, group_name, group_type diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index 91a44c31c1..862702d7fc 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -26,8 +26,7 @@ function view_folder($id, $mode, $folder_id, $folder) $user->add_lang('viewforum'); // Grab icons - $icons = array(); - $cache->obtain_icons($icons); + $icons = $cache->obtain_icons(); $color_rows = array('marked', 'replied'); @@ -164,7 +163,18 @@ function view_folder($id, $mode, $folder_id, $folder) { foreach ($id_ary as $ug_id => $_id) { - $address_list[$message_id][] = (($type == 'u') ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $ug_id) . '">' : '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $ug_id) . '">') . (($recipient_list[$type][$ug_id]['colour']) ? '<span style="color:#' . $recipient_list[$type][$ug_id]['colour'] . '">' : '<span>') . $recipient_list[$type][$ug_id]['name'] . '</span></a>'; + $user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : ''; + + if ($type == 'u') + { + $link = ($ug_id != ANONYMOUS) ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $ug_id) . '"' . $user_colour . '>' : ''; + } + else + { + $link = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $ug_id) . '"' . $user_colour . '>'; + } + + $address_list[$message_id][] = $link . $recipient_list[$type][$ug_id]['name'] . (($link) ? '</a>' : ''); } } } @@ -181,7 +191,7 @@ function view_folder($id, $mode, $folder_id, $folder) $folder_alt = ($row['pm_unread']) ? 'NEW_MESSAGES' : 'NO_NEW_MESSAGES'; // Generate all URIs ... - $message_author = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['author_id']) . '">' . $row['username'] . '</a>'; + $message_author = ($row['author_id'] != ANONYMOUS) ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['author_id']) . '">' . $row['username'] . '</a>' : $row['username']; $view_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=view&f=$folder_id&p=$message_id"); $remove_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=compose&action=delete&p=$message_id"); @@ -215,6 +225,7 @@ function view_folder($id, $mode, $folder_id, $folder) 'ATTACH_ICON_IMG' => ($auth->acl_get('u_pm_download') && $row['message_attachment'] && $config['allow_pm_attach']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'S_PM_DELETED' => ($row['pm_deleted']) ? true : false, + 'S_AUTHOR_DELETED' => ($row['author_id'] == ANONYMOUS) ? true : false, 'U_VIEW_PM' => ($row['pm_deleted']) ? '' : $view_message_url, 'U_REMOVE_PM' => ($row['pm_deleted']) ? $remove_message_url : '', @@ -428,8 +439,6 @@ function get_pm_from($folder_id, $folder, $user_id) $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); $sort_by_sql = array('a' => 'u.username', 't' => 'p.message_time', 's' => 'p.message_subject'); - $sort_key = (!in_array($sort_key, array('a', 't', 's'))) ? 't' : $sort_key; - $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); diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 4a399d847d..8da8f0bd18 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -35,8 +35,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) } // Grab icons - $icons = array(); - $cache->obtain_icons($icons); + $icons = $cache->obtain_icons(); $bbcode = false; @@ -54,6 +53,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) // Parse the message and subject $message = $message_row['message_text']; + $message = str_replace("\n", '<br />', censor_text($message)); // Second parse bbcode here if ($message_row['bbcode_bitfield']) @@ -66,7 +66,6 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) // Replace naughty words such as farty pants $message_row['message_subject'] = censor_text($message_row['message_subject']); - $message = str_replace("\n", '<br />', censor_text($message)); // Editing information if ($message_row['message_edit_count'] && $config['display_last_edited']) @@ -146,6 +145,9 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) // End signature parsing, only if needed if ($signature) { + $signature = censor_text($signature); + $signature = str_replace("\n", '<br />', censor_text($signature)); + if ($user_info['user_sig_bbcode_bitfield']) { if ($bbcode === false) @@ -158,7 +160,6 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) } $signature = smiley_text($signature); - $signature = str_replace("\n", '<br />', censor_text($signature)); } $url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm'); @@ -191,16 +192,17 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) 'U_INFO' => ($auth->acl_get('m_info') && $message_row['pm_forwarded']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'mode=pm_details&p=' . $message_row['msg_id'], true, $user->session_id) : '', 'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&mode=compose&action=delete&f=$folder_id&p=" . $message_row['msg_id'] : '', - 'U_AUTHOR_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $author_id), + 'U_AUTHOR_PROFILE' => ($author_id != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $author_id) : '', 'U_EMAIL' => $user_info['email'], - 'U_QUOTE' => ($auth->acl_get('u_sendpm')) ? "$url&mode=compose&action=quote&f=$folder_id&p=" . $message_row['msg_id'] : '', + 'U_QUOTE' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=quote&f=$folder_id&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&mode=compose&action=edit&f=$folder_id&p=" . $message_row['msg_id'] : '', - 'U_POST_REPLY_PM' => ($auth->acl_get('u_sendpm')) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $message_row['msg_id'] : '', + 'U_POST_REPLY_PM' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $message_row['msg_id'] : '', 'U_PREVIOUS_PM' => "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=previous", 'U_NEXT_PM' => "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=next", 'S_HAS_ATTACHMENTS' => (sizeof($attachments)) ? true : false, 'S_DISPLAY_NOTICE' => $display_notice && $message_row['message_attachment'], + 'S_AUTHOR_DELETED' => ($author_id == ANONYMOUS) ? true : false, 'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '', 'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '') @@ -295,13 +297,13 @@ function message_history($msg_id, $user_id, $message_row, $folder) } // Instantiate BBCode class - if ((empty($bbcode) || $bbcode === false) && $bbcode_bitfield) + if ((empty($bbcode) || $bbcode === false) && $bbcode_bitfield !== '') { if (!class_exists('bbcode')) { include($phpbb_root_path . 'includes/bbcode.' . $phpEx); } - $bbcode = new bbcode($bbcode_bitfield); + $bbcode = new bbcode(base64_encode($bbcode_bitfield)); } $title = censor_text($title); @@ -318,6 +320,9 @@ function message_history($msg_id, $user_id, $message_row, $folder) $subject = $row['message_subject']; $message = $row['message_text']; + $message = censor_text($message); + $message = str_replace("\n", '<br />', $message); + if ($row['bbcode_bitfield']) { $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']); @@ -326,7 +331,6 @@ function message_history($msg_id, $user_id, $message_row, $folder) $message = smiley_text($message, !$row['enable_smilies']); $subject = censor_text($subject); - $message = censor_text($message); if ($id == $msg_id) { @@ -339,16 +343,17 @@ function message_history($msg_id, $user_id, $message_row, $folder) 'AUTHOR_NAME' => $author, 'SUBJECT' => $subject, 'SENT_DATE' => $user->format_date($row['message_time']), - 'MESSAGE' => str_replace("\n", '<br />', $message), + 'MESSAGE' => $message, 'FOLDER' => implode(', ', $row['folder']), - 'S_CURRENT_MSG' => ($row['msg_id'] == $msg_id), - + 'S_CURRENT_MSG' => ($row['msg_id'] == $msg_id), + 'S_AUTHOR_DELETED' => ($author_id == ANONYMOUS) ? true : false, + 'U_MSG_ID' => $row['msg_id'], 'U_VIEW_MESSAGE' => "$url&f=$folder_id&p=" . $row['msg_id'], - 'U_AUTHOR_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$author_id"), - 'U_QUOTE' => ($auth->acl_get('u_sendpm') && $author_id != $user->data['user_id']) ? "$url&mode=compose&action=quote&f=" . $folder_id . "&p=" . $row['msg_id'] : '', - 'U_POST_REPLY_PM' => ($author_id != $user->data['user_id'] && $auth->acl_get('u_sendpm')) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $row['msg_id'] : '') + 'U_AUTHOR_PROFILE' => ($author_id != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$author_id") : '', + 'U_QUOTE' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS && $author_id != $user->data['user_id']) ? "$url&mode=compose&action=quote&f=" . $folder_id . "&p=" . $row['msg_id'] : '', + 'U_POST_REPLY_PM' => ($author_id != $user->data['user_id'] && $author_id != ANONYMOUS && $auth->acl_get('u_sendpm')) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $row['msg_id'] : '') ); unset($rowset[$id]); $prev_id = $id; @@ -389,8 +394,7 @@ function get_user_informations($user_id, $user_row) } // Grab ranks - $ranks = array(); - $cache->obtain_ranks($ranks); + $ranks = $cache->obtain_ranks(); // Generate online information for user if ($config['load_onlinetrack']) @@ -429,7 +433,7 @@ function get_user_informations($user_id, $user_row) } $avatar_img .= $user_row['user_avatar']; - $user_row['avatar'] = '<img src="' . $avatar_img . '" width="' . $user_row['user_avatar_width'] . '" height="' . $user_row['user_avatar_height'] . '" border="0" alt="" />'; + $user_row['avatar'] = '<img src="' . $avatar_img . '" width="' . $user_row['user_avatar_width'] . '" height="' . $user_row['user_avatar_height'] . '" alt="' . $user->lang['USER_AVATAR'] . '" />'; } $user_row['rank_title'] = $user_row['rank_image'] = ''; @@ -437,7 +441,7 @@ function get_user_informations($user_id, $user_row) if (!empty($user_row['user_rank'])) { $user_row['rank_title'] = (isset($ranks['special'][$user_row['user_rank']])) ? $ranks['special'][$user_row['user_rank']]['rank_title'] : ''; - $user_row['rank_image'] = (!empty($ranks['special'][$user_row['user_rank']]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$user_row['user_rank']]['rank_image'] . '" border="0" alt="' . $ranks['special'][$user_row['user_rank']]['rank_title'] . '" title="' . $ranks['special'][$user_row['user_rank']]['rank_title'] . '" /><br />' : ''; + $user_row['rank_image'] = (!empty($ranks['special'][$user_row['user_rank']]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$user_row['user_rank']]['rank_image'] . '" alt="' . $ranks['special'][$user_row['user_rank']]['rank_title'] . '" title="' . $ranks['special'][$user_row['user_rank']]['rank_title'] . '" /><br />' : ''; } else { @@ -448,7 +452,7 @@ function get_user_informations($user_id, $user_row) if ($user_row['user_posts'] >= $rank['rank_min']) { $user_row['rank_title'] = $rank['rank_title']; - $user_row['rank_image'] = (!empty($rank['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $rank['rank_image'] . '" border="0" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" /><br />' : ''; + $user_row['rank_image'] = (!empty($rank['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" /><br />' : ''; break; } } diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index ff8df44148..378562a2dd 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -30,42 +30,30 @@ class ucp_prefs case 'personal': $data = array( - 'notifymethod' => $user->data['user_notify_type'], - 'dateformat' => $user->data['user_dateformat'], - 'lang' => $user->data['user_lang'], - 'style' => $user->data['user_style'], - 'tz' => $user->data['user_timezone'], + 'notifymethod' => request_var('notifymethod', $user->data['user_notify_type']), + 'dateformat' => request_var('dateformat', $user->data['user_dateformat']), + 'lang' => request_var('lang', $user->data['user_lang']), + 'style' => request_var('style', (int) $user->data['user_style']), + 'tz' => request_var('tz', (float) $user->data['user_timezone']), + + 'dst' => request_var('dst', (bool) $user->data['user_dst']), + 'viewemail' => request_var('viewemail', (bool) $user->data['user_allow_viewemail']), + 'massemail' => request_var('massemail', (bool) $user->data['user_allow_massemail']), + 'hideonline' => request_var('hideonline', (bool) !$user->data['user_allow_viewonline']), + 'notifypm' => request_var('notifypm', (bool) $user->data['user_notify_pm']), + 'popuppm' => request_var('popuppm', (bool) $user->optionget('popuppm')), + 'allowpm' => request_var('allowpm', (bool) $user->data['user_allow_pm']), ); if ($submit) { - $var_ary = array( - 'dateformat' => (string) $config['default_dateformat'], - 'lang' => (string) $config['default_lang'], - 'tz' => (float) $config['board_timezone'], - 'style' => (int) $config['default_style'], - 'dst' => (bool) $config['board_dst'], - 'viewemail' => false, - 'massemail' => true, - 'hideonline' => false, - 'notifymethod' => 0, - 'notifypm' => true, - 'popuppm' => false, - 'allowpm' => true, - ); + $data['style'] = ($config['override_user_style']) ? $config['default_style'] : $data['style']; - foreach ($var_ary as $var => $default) - { - $data[$var] = request_var($var, $default); - } - - $var_ary = array( + $error = validate_data($data, array( 'dateformat' => array('string', false, 3, 30), - 'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'), + 'lang' => array('match', false, '#^[a-z0-9_\-]{2,}$#i'), 'tz' => array('num', false, -14, 14), - ); - - $error = validate_data($data, $var_ary); + )); if (!sizeof($error)) { @@ -126,13 +114,13 @@ class ucp_prefs 'S_NOTIFY_EMAIL' => ($data['notifymethod'] == NOTIFY_EMAIL) ? true : false, 'S_NOTIFY_IM' => ($data['notifymethod'] == NOTIFY_IM) ? true : false, 'S_NOTIFY_BOTH' => ($data['notifymethod'] == NOTIFY_BOTH) ? true : false, - 'S_VIEW_EMAIL' => (isset($data['viewemail'])) ? $data['viewemail'] : $user->data['user_allow_viewemail'], - 'S_MASS_EMAIL' => (isset($data['massemail'])) ? $data['massemail'] : $user->data['user_allow_massemail'], - 'S_ALLOW_PM' => (isset($data['allowpm'])) ? $data['allowpm'] : $user->data['user_allow_pm'], - 'S_HIDE_ONLINE' => (isset($data['hideonline'])) ? $data['hideonline'] : !$user->data['user_allow_viewonline'], - 'S_NOTIFY_PM' => (isset($data['notifypm'])) ? $data['notifypm'] : $user->data['user_notify_pm'], - 'S_POPUP_PM' => (isset($data['popuppm'])) ? $data['popuppm'] : $user->optionget('popuppm'), - 'S_DST' => (isset($data['dst'])) ? $data['dst'] : $user->data['user_dst'], + 'S_VIEW_EMAIL' => $data['viewemail'], + 'S_MASS_EMAIL' => $data['massemail'], + 'S_ALLOW_PM' => $data['allowpm'], + 'S_HIDE_ONLINE' => $data['hideonline'], + 'S_NOTIFY_PM' => $data['notifypm'], + 'S_POPUP_PM' => $data['popuppm'], + 'S_DST' => $data['dst'], 'DATE_FORMAT' => $data['dateformat'], 'S_DATEFORMAT_OPTIONS' => $dateformat_options, @@ -141,7 +129,7 @@ class ucp_prefs 'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']), 'S_LANG_OPTIONS' => language_select($data['lang']), - 'S_STYLE_OPTIONS' => style_select($data['style']), + 'S_STYLE_OPTIONS' => ($config['override_user_style']) ? '' : style_select($data['style']), 'S_TZ_OPTIONS' => tz_select($data['tz']), 'S_CAN_HIDE_ONLINE' => ($auth->acl_get('u_hideonline')) ? true : false, 'S_SELECT_NOTIFY' => ($config['jab_enable'] && $user->data['user_jabber'] && @extension_loaded('xml')) ? true : false) @@ -159,32 +147,23 @@ class ucp_prefs 'post_sk' => (!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't', 'post_sd' => (!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'a', 'post_st' => (!empty($user->data['user_post_show_days'])) ? $user->data['user_post_show_days'] : 0, + + 'images' => request_var('images', (bool) $user->optionget('viewimg')), + 'flash' => request_var('flash', (bool) $user->optionget('viewflash')), + 'smilies' => request_var('smilies', (bool) $user->optionget('viewsmilies')), + 'sigs' => request_var('sigs', (bool) $user->optionget('viewsigs')), + 'avatars' => request_var('avatars', (bool) $user->optionget('viewavatars')), + 'wordcensor' => request_var('wordcensor', (bool) $user->optionget('viewcensors')), ); if ($submit) { - $var_ary = array_merge($data, array( - 'images' => true, - 'flash' => false, - 'smilies' => true, - 'sigs' => true, - 'avatars' => true, - 'wordcensor'=> false, - )); - - foreach ($var_ary as $var => $default) - { - $data[$var] = request_var($var, $default); - } - - $var_ary = array( + $error = validate_data($data, array( 'topic_sk' => array('string', false, 1, 1), 'topic_sd' => array('string', false, 1, 1), 'post_sk' => array('string', false, 1, 1), 'post_sd' => array('string', false, 1, 1), - ); - - $error = validate_data($data, $var_ary); + )); if (!sizeof($error)) { @@ -269,12 +248,12 @@ class ucp_prefs $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', - 'S_IMAGES' => (isset($data['images'])) ? $data['images'] : $user->optionget('viewimg'), - 'S_FLASH' => (isset($data['flash'])) ? $data['flash'] : $user->optionget('viewflash'), - 'S_SMILIES' => (isset($data['smilies'])) ? $data['smilies'] : $user->optionget('viewsmilies'), - 'S_SIGS' => (isset($data['sigs'])) ? $data['sigs'] : $user->optionget('viewsigs'), - 'S_AVATARS' => (isset($data['avatars'])) ? $data['avatars'] : $user->optionget('viewavatars'), - 'S_DISABLE_CENSORS' => (isset($data['wordcensor'])) ? $data['wordcensor'] : $user->optionget('viewcensors'), + 'S_IMAGES' => $data['images'], + 'S_FLASH' => $data['flash'], + 'S_SMILIES' => $data['smilies'], + 'S_SIGS' => $data['sigs'], + 'S_AVATARS' => $data['avatars'], + 'S_DISABLE_CENSORS' => $data['wordcensor'], 'S_CHANGE_CENSORS' => ($auth->acl_get('u_chgcensors')) ? true : false, @@ -291,21 +270,14 @@ class ucp_prefs case 'post': $data = array( - 'bbcode' => $user->optionget('bbcode'), - 'smilies' => $user->optionget('smilies'), - 'sig' => $user->optionget('attachsig'), - 'notify' => $user->data['user_notify'], + 'bbcode' => request_var('bbcode', $user->optionget('bbcode')), + 'smilies' => request_var('smilies', $user->optionget('smilies')), + 'sig' => request_var('sig', $user->optionget('attachsig')), + 'notify' => request_var('notify', $user->data['user_notify']), ); if ($submit) { - $var_ary = $data; - - foreach ($var_ary as $var => $default) - { - $data[$var] = request_var($var, $default); - } - $user->optionset('bbcode', $data['bbcode']); $user->optionset('smilies', $data['smilies']); $user->optionset('attachsig', $data['sig']); diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index d757d6e14d..840f63ff48 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -33,25 +33,22 @@ class ucp_profile { case 'reg_details': + $data = array( + 'username' => request_var('username', $user->data['username'], true), + 'email' => request_var('email', $user->data['user_email']), + 'email_confirm' => request_var('email_confirm', ''), + 'new_password' => request_var('new_password', '', true), + 'cur_password' => request_var('cur_password', '', true), + 'password_confirm' => request_var('password_confirm', '', true), + ); + if ($submit) { - $var_ary = array( - 'username' => $user->data['username'], - 'email' => $user->data['user_email'], - 'email_confirm' => (string) '', - 'new_password' => (string) '', - 'cur_password' => (string) '', - 'password_confirm' => (string) '', - ); - - foreach ($var_ary as $var => $default) - { - $data[$var] = request_var($var, $default); - } - // Do not check cur_password, it is the old one. - $var_ary = array( - 'new_password' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']), + $check_ary = array( + 'new_password' => array( + array('string', true, $config['min_pass_chars'], $config['max_pass_chars']), + array('password')), 'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']), 'email' => array( array('string', false, 6, 60), @@ -61,27 +58,31 @@ class ucp_profile if ($auth->acl_get('u_chgname') && $config['allow_namechange']) { - $var_ary['username'] = array( + $check_ary['username'] = array( array('string', false, $config['min_name_chars'], $config['max_name_chars']), array('username', $data['username']), ); } - $error = validate_data($data, $var_ary); - extract($data); - unset($data); + $error = validate_data($data, $check_ary); - if ($auth->acl_get('u_chgpasswd') && $new_password && $password_confirm != $new_password) + if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password']) { $error[] = 'NEW_PASSWORD_ERROR'; } - if (($new_password || ($auth->acl_get('u_chgemail') && $email != $user->data['user_email']) || ($username != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange'])) && md5($cur_password) != $user->data['user_password']) + if (($data['new_password'] || ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email']) || ($data['username'] != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange'])) && md5($data['cur_password']) != $user->data['user_password']) { $error[] = 'CUR_PASSWORD_ERROR'; } - if ($auth->acl_get('u_chgemail') && $email != $user->data['user_email'] && $email_confirm != $email) + // Only check the new password against the previous password if there have been no errors + if (!sizeof($error) && $auth->acl_get('u_chgpasswd') && $data['new_password'] && md5($data['new_password']) == $user->data['user_password']) + { + $error[] = 'SAME_PASSWORD_ERROR'; + } + + if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email']) { $error[] = 'NEW_EMAIL_ERROR'; } @@ -89,32 +90,33 @@ class ucp_profile if (!sizeof($error)) { $sql_ary = array( - 'username' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? $username : $user->data['username'], - 'user_email' => ($auth->acl_get('u_chgemail')) ? $email : $user->data['user_email'], - 'user_email_hash' => ($auth->acl_get('u_chgemail')) ? crc32(strtolower($email)) . strlen($email) : $user->data['user_email_hash'], - 'user_password' => ($auth->acl_get('u_chgpasswd') && $new_password) ? md5($new_password) : $user->data['user_password'], - 'user_passchg' => ($auth->acl_get('u_chgpasswd') && $new_password) ? time() : 0, + '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(strtolower($data['email'])) . strlen($data['email']) : $user->data['user_email_hash'], + 'user_password' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? md5($data['new_password']) : $user->data['user_password'], + 'user_passchg' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? time() : 0, ); - if ($auth->acl_get('u_chgname') && $config['allow_namechange'] && $username != $user->data['username']) + if ($auth->acl_get('u_chgname') && $config['allow_namechange'] && $data['username'] != $user->data['username']) { - add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_NAME', $user->data['username'], $username); + add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_NAME', $user->data['username'], $data['username']); } - if ($auth->acl_get('u_chgpasswd') && $new_password && md5($new_password) != $user->data['user_password']) + if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && md5($data['new_password']) != $user->data['user_password']) { $user->reset_login_keys(); - add_log('user', $user->data['user_id'], 'LOG_USER_NEW_PASSWORD', $username); + add_log('user', $user->data['user_id'], 'LOG_USER_NEW_PASSWORD', $data['username']); } - if ($auth->acl_get('u_chgemail') && $email != $user->data['user_email']) + if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email']) { - add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_EMAIL', $username, $user->data['user_email'], $email); + add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_EMAIL', $data['username'], $user->data['user_email'], $data['email']); } - if ($config['email_enable'] && $email != $user->data['user_email'] && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN)) + if ($config['email_enable'] && $data['email'] != $user->data['user_email'] && $user->data['user_type'] != USER_FOUNDER && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN)) { - include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $server_url = generate_board_url(); @@ -129,7 +131,7 @@ class ucp_profile $messenger->template($template_file, $user->data['user_lang']); $messenger->replyto($config['board_contact']); - $messenger->to($email, $username); + $messenger->to($data['email'], $data['username']); $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']); @@ -137,10 +139,7 @@ class ucp_profile $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); $messenger->assign_vars(array( - 'SITENAME' => $config['sitename'], - 'USERNAME' => html_entity_decode($username), - 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), - + 'USERNAME' => htmlspecialchars_decode($username), 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey") ); @@ -148,12 +147,21 @@ class ucp_profile if ($config['require_activation'] == USER_ACTIVATION_ADMIN) { - // Grab an array of user_id's with a_user permissions + // Grab an array of user_id's with a_user permissions ... these users can activate a user $admin_ary = $auth->acl_get_list(false, 'a_user', false); + $admin_ary = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array(); + + // Also include founders + $where_sql = ' WHERE user_type = ' . USER_FOUNDER; + + if (sizeof($admin_ary)) + { + $where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary); + } $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type - FROM ' . USERS_TABLE . ' - WHERE ' . $db->sql_in_set('user_id', $admin_ary[0]['a_user']); + FROM ' . USERS_TABLE . ' ' . + $where_sql; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) @@ -164,9 +172,7 @@ class ucp_profile $messenger->im($row['user_jabber'], $row['username']); $messenger->assign_vars(array( - 'USERNAME' => html_entity_decode($username), - 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), - + 'USERNAME' => htmlspecialchars_decode($username), 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey") ); @@ -177,9 +183,10 @@ class ucp_profile $messenger->save_queue(); + user_active_flip('deactivate', $user->data['user_id'], INACTIVE_PROFILE); + $sql_ary += array( - 'user_type' => USER_INACTIVE, - 'user_actkey' => $user_actkey + 'user_actkey' => $user_actkey, ); } @@ -192,9 +199,9 @@ class ucp_profile } // Need to update config, forum, topic, posting, messages, etc. - if ($username != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange']) + if ($data['username'] != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange']) { - user_update_name($user->data['username'], $username); + user_update_name($user->data['username'], $data['username']); } meta_refresh(3, $this->u_action); @@ -207,18 +214,19 @@ class ucp_profile } $user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS'); + $pass_char_ary = array('.*' => 'PASS_TYPE_ANY', '[a-zA-Z]' => 'PASS_TYPE_CASE', '[a-zA-Z0-9]' => 'PASS_TYPE_ALPHA', '[a-zA-Z\W]' => 'PASS_TYPE_SYMBOL'); $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', - 'USERNAME' => (isset($username)) ? $username : $user->data['username'], - 'EMAIL' => (isset($email)) ? $email : $user->data['user_email'], - 'PASSWORD_CONFIRM' => (isset($password_confirm)) ? $password_confirm : '', - 'NEW_PASSWORD' => (isset($new_password)) ? $new_password : '', + 'USERNAME' => $data['username'], + 'EMAIL' => $data['email'], + 'PASSWORD_CONFIRM' => $data['password_confirm'], + 'NEW_PASSWORD' => $data['new_password'], 'CUR_PASSWORD' => '', 'L_USERNAME_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), - 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang['CHANGE_PASSWORD_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), + 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), 'S_FORCE_PASSWORD' => ($config['chg_passforce'] && $user->data['user_passchg'] < time() - $config['chg_passforce']) ? true : false, 'S_CHANGE_USERNAME' => ($config['allow_namechange'] && $auth->acl_get('u_chgname')) ? true : false, @@ -235,29 +243,35 @@ class ucp_profile $cp_data = $cp_error = array(); - if ($submit) + $data = array( + 'icq' => request_var('icq', $user->data['user_icq']), + 'aim' => request_var('aim', $user->data['user_aim']), + 'msn' => request_var('msn', $user->data['user_msnm']), + 'yim' => request_var('yim', $user->data['user_yim']), + 'jabber' => request_var('jabber', $user->data['user_jabber']), + 'website' => request_var('website', $user->data['user_website']), + 'location' => request_var('location', $user->data['user_from'], true), + 'occupation' => request_var('occupation', $user->data['user_occ'], true), + 'interests' => request_var('interests', $user->data['user_interests'], true), + 'bday_day' => 0, + 'bday_month' => 0, + 'bday_year' => 0, + ); + + utf8_normalize_nfc(array(&$data['location'], &$data['occupation'], &$data['interests'])); + + if ($user->data['user_birthday']) { - $var_ary = array( - 'icq' => (string) '', - 'aim' => (string) '', - 'msn' => (string) '', - 'yim' => (string) '', - 'jabber' => (string) '', - 'website' => (string) '', - 'location' => (string) '', - 'occupation' => (string) '', - 'interests' => (string) '', - 'bday_day' => 0, - 'bday_month' => 0, - 'bday_year' => 0, - ); + list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user->data['user_birthday']); + } - foreach ($var_ary as $var => $default) - { - $data[$var] = (in_array($var, array('location', 'occupation', 'interests'))) ? request_var($var, $default, true) : request_var($var, $default); - } + $data['bday_day'] = request_var('bday_day', $data['bday_day']); + $data['bday_month'] = request_var('bday_month', $data['bday_month']); + $data['bday_year'] = request_var('bday_year', $data['bday_year']); - $var_ary = array( + if ($submit) + { + $error = validate_data($data, array( 'icq' => array( array('string', true, 3, 15), array('match', true, '#^[0-9]+$#i')), @@ -276,11 +290,7 @@ class ucp_profile 'bday_day' => array('num', true, 1, 31), 'bday_month' => array('num', true, 1, 12), 'bday_year' => array('num', true, 1901, gmdate('Y', time())), - ); - - $error = validate_data($data, $var_ary); - extract($data); - unset($data); + )); // validate custom profile fields $cp->submit_cp_field('profile', $user->get_iso_lang_id(), $cp_data, $cp_error); @@ -293,16 +303,16 @@ class ucp_profile if (!sizeof($error)) { $sql_ary = array( - 'user_icq' => $icq, - 'user_aim' => $aim, - 'user_msnm' => $msn, - 'user_yim' => $yim, - 'user_jabber' => $jabber, - 'user_website' => $website, - 'user_from' => $location, - 'user_occ' => $occupation, - 'user_interests'=> $interests, - 'user_birthday' => sprintf('%2d-%2d-%4d', $bday_day, $bday_month, $bday_year), + 'user_icq' => $data['icq'], + 'user_aim' => $data['aim'], + 'user_msnm' => $data['msn'], + 'user_yim' => $data['yim'], + 'user_jabber' => $data['jabber'], + 'user_website' => $data['website'], + 'user_from' => $data['location'], + 'user_occ' => $data['occupation'], + 'user_interests'=> $data['interests'], + 'user_birthday' => sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']), ); $sql = 'UPDATE ' . USERS_TABLE . ' @@ -340,38 +350,26 @@ class ucp_profile $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error); } - if (!isset($bday_day)) - { - if ($user->data['user_birthday']) - { - list($bday_day, $bday_month, $bday_year) = explode('-', $user->data['user_birthday']); - } - else - { - $bday_day = $bday_month = $bday_year = 0; - } - } - - $s_birthday_day_options = '<option value="0"' . ((!$bday_day) ? ' selected="selected"' : '') . '>--</option>'; + $s_birthday_day_options = '<option value="0"' . ((!$data['bday_day']) ? ' selected="selected"' : '') . '>--</option>'; for ($i = 1; $i < 32; $i++) { - $selected = ($i == $bday_day) ? ' selected="selected"' : ''; + $selected = ($i == $data['bday_day']) ? ' selected="selected"' : ''; $s_birthday_day_options .= "<option value=\"$i\"$selected>$i</option>"; } - $s_birthday_month_options = '<option value="0"' . ((!$bday_month) ? ' selected="selected"' : '') . '>--</option>'; + $s_birthday_month_options = '<option value="0"' . ((!$data['bday_month']) ? ' selected="selected"' : '') . '>--</option>'; for ($i = 1; $i < 13; $i++) { - $selected = ($i == $bday_month) ? ' selected="selected"' : ''; + $selected = ($i == $data['bday_month']) ? ' selected="selected"' : ''; $s_birthday_month_options .= "<option value=\"$i\"$selected>$i</option>"; } $s_birthday_year_options = ''; $now = getdate(); - $s_birthday_year_options = '<option value="0"' . ((!$bday_year) ? ' selected="selected"' : '') . '>--</option>'; + $s_birthday_year_options = '<option value="0"' . ((!$data['bday_year']) ? ' selected="selected"' : '') . '>--</option>'; for ($i = $now['year'] - 100; $i < $now['year']; $i++) { - $selected = ($i == $bday_year) ? ' selected="selected"' : ''; + $selected = ($i == $data['bday_year']) ? ' selected="selected"' : ''; $s_birthday_year_options .= "<option value=\"$i\"$selected>$i</option>"; } unset($now); @@ -379,15 +377,15 @@ class ucp_profile $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', - 'ICQ' => (isset($icq)) ? $icq : $user->data['user_icq'], - 'YIM' => (isset($yim)) ? $yim : $user->data['user_yim'], - 'AIM' => (isset($aim)) ? $aim : $user->data['user_aim'], - 'MSN' => (isset($msn)) ? $msn : $user->data['user_msnm'], - 'JABBER' => (isset($jabber)) ? $jabber : $user->data['user_jabber'], - 'WEBSITE' => (isset($website)) ? $website : $user->data['user_website'], - 'LOCATION' => (isset($location)) ? $location : $user->data['user_from'], - 'OCCUPATION'=> (isset($occupation)) ? $occupation : $user->data['user_occ'], - 'INTERESTS' => (isset($interests)) ? $interests : $user->data['user_interests'], + 'ICQ' => $data['icq'], + 'YIM' => $data['yim'], + 'AIM' => $data['aim'], + 'MSN' => $data['msn'], + 'JABBER' => $data['jabber'], + 'WEBSITE' => $data['website'], + 'LOCATION' => $data['location'], + 'OCCUPATION'=> $data['occupation'], + 'INTERESTS' => $data['interests'], 'S_BIRTHDAY_DAY_OPTIONS' => $s_birthday_day_options, 'S_BIRTHDAY_MONTH_OPTIONS' => $s_birthday_month_options, @@ -416,6 +414,8 @@ class ucp_profile $enable_urls = request_var('enable_urls', true); $signature = request_var('signature', (string) $user->data['user_sig'], true); + utf8_normalize_nfc(&$signature); + if ($submit || $preview) { include($phpbb_root_path . 'includes/message_parser.'.$phpEx); @@ -425,7 +425,7 @@ class ucp_profile $message_parser = new parse_message($signature); // Allowing Quote BBCode - $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, true, 'sig'); + $message_parser->parse($enable_bbcode, ($config['allow_sig_links']) ? $enable_urls : false, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig'); if (sizeof($message_parser->warn_msg)) { @@ -473,17 +473,19 @@ class ucp_profile 'S_SMILIES_CHECKED' => (!$enable_smilies) ? 'checked="checked"' : '', 'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? 'checked="checked"' : '', - 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '" onclick="target=\'_phpbbcode\';">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '" onclick="target=\'_phpbbcode\';">', '</a>'), + 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'), 'SMILIES_STATUS' => ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], 'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], 'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], + 'URL_STATUS' => ($config['allow_sig_links']) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'], 'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']), 'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'], 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'], 'S_BBCODE_IMG' => ($config['allow_sig_img']) ? true : false, - 'S_BBCODE_FLASH' => ($config['allow_sig_flash']) ? true : false) + 'S_BBCODE_FLASH' => ($config['allow_sig_flash']) ? true : false, + 'S_LINKS_ALLOWED' => ($config['allow_sig_links']) ? true : false) ); // Build custom bbcodes array @@ -504,26 +506,19 @@ class ucp_profile if ($submit) { - $var_ary = array( - 'uploadurl' => (string) '', - 'remotelink' => (string) '', - 'width' => (string) '', - 'height' => (string) '', + $data = array( + 'uploadurl' => request_var('uploadurl', ''), + 'remotelink' => request_var('remotelink', ''), + 'width' => request_var('width', ''), + 'height' => request_var('height', ''), ); - foreach ($var_ary as $var => $default) - { - $data[$var] = request_var($var, $default); - } - - $var_ary = array( + $error = validate_data($data, array( 'uploadurl' => array('string', true, 5, 255), 'remotelink' => array('string', true, 5, 255), 'width' => array('string', true, 1, 3), 'height' => array('string', true, 1, 3), - ); - - $error = validate_data($data, $var_ary); + )); if (!sizeof($error)) { @@ -585,11 +580,7 @@ class ucp_profile // Delete old avatar if present if ($user->data['user_avatar'] && $filename != $user->data['user_avatar'] && $user->data['user_avatar_type'] != AVATAR_GALLERY) { - // Check if the users avatar is actually a group avatar - if (strpos($user->data['user_avatar'], 'g' . $user->data['group_id'] . '_') !== 0 && strpos($user->data['user_avatar'], $user->data['user_id'] . '_') === 0) - { - avatar_delete($user->data['user_avatar']); - } + avatar_delete('user', $user->data); } } @@ -598,9 +589,6 @@ class ucp_profile trigger_error($message); } - extract($data); - unset($data); - // Replace "error" strings with their real, localised form $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error); } @@ -644,8 +632,8 @@ class ucp_profile $template->assign_vars(array( 'AVATAR' => $avatar_img, 'AVATAR_SIZE' => $config['avatar_filesize'], - 'WIDTH' => (isset($width)) ? $width : $user->data['user_avatar_width'], - 'HEIGHT' => (isset($height)) ? $height : $user->data['user_avatar_height'], + 'WIDTH' => (isset($data['width'])) ? $data['width'] : $user->data['user_avatar_width'], + 'HEIGHT' => (isset($data['height'])) ? $data['height'] : $user->data['user_avatar_height'], 'S_UPLOAD_AVATAR_FILE' => $can_upload, 'S_UPLOAD_AVATAR_URL' => $can_upload, diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 01b92125ac..1e8ff69733 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -37,21 +37,35 @@ class ucp_register if ($change_lang) { - $submit = false; - $lang = $change_lang; - $user->lang_name = $lang = $change_lang; - $user->lang_path = $phpbb_root_path . 'language/' . $lang . '/'; - $user->lang = array(); - $user->add_lang(array('common', 'ucp')); + $change_lang = basename($change_lang); + + if (file_exists($phpbb_root_path . 'language/' . $change_lang . '/')) + { + $submit = false; + + $user->lang_name = $lang = $change_lang; + $user->lang_path = $phpbb_root_path . 'language/' . $lang . '/'; + $user->lang = array(); + $user->add_lang(array('common', 'ucp')); + + // Setting back agreed to let the user view the agreement in his/her language + $agreed = (empty($_GET['change_lang'])) ? 0 : $agreed; + } + else + { + $change_lang = ''; + } } $cp = new custom_profile(); - $error = $data = $cp_data = $cp_error = array(); + $error = $cp_data = $cp_error = array(); // if (!$agreed) { + $add_lang = ($change_lang) ? '&change_lang=' . urlencode($change_lang) : ''; + if ($coppa === false && $config['coppa_enable']) { $now = getdate(); @@ -62,11 +76,12 @@ class ucp_register 'L_COPPA_NO' => sprintf($user->lang['UCP_COPPA_BEFORE'], $coppa_birthday), 'L_COPPA_YES' => sprintf($user->lang['UCP_COPPA_ON_AFTER'], $coppa_birthday), - 'U_COPPA_NO' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=0'), - 'U_COPPA_YES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=1'), + 'U_COPPA_NO' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=0' . $add_lang), + 'U_COPPA_YES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=1' . $add_lang), 'S_SHOW_COPPA' => true, - 'S_REGISTER_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register')) + 'S_HIDDEN_FIELDS' => ($confirm_id) ? '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />' : '', + 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_lang)) ); } else @@ -76,7 +91,8 @@ class ucp_register 'S_SHOW_COPPA' => false, 'S_REGISTRATION' => true, - 'S_REGISTER_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register')) + 'S_HIDDEN_FIELDS' => ($confirm_id) ? '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />' : '', + 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_lang)) ); } @@ -84,40 +100,38 @@ class ucp_register return; } - $var_ary = array( - 'username' => (string) '', - 'password_confirm' => (string) '', - 'new_password' => (string) '', - 'cur_password' => (string) '', - 'email' => (string) '', - 'email_confirm' => (string) '', - 'confirm_code' => (string) '', - 'lang' => (string) $config['default_lang'], - 'tz' => (float) $config['board_timezone'], - ); + // Try to manually determine the timezone + $timezone = date('Z') / 3600; + $is_dst = date('I'); + $timezone = ($is_dst) ? $timezone - 1 : $timezone; - // If we change the language inline, we do not want to display errors, but pre-fill already filled out values - if ($change_lang) + if (!isset($user->lang['tz_zones'][(string) $timezone])) { - foreach ($var_ary as $var => $default) - { - $$var = request_var($var, $default, true); - } + $timezone = $config['board_timezone']; } + $data = array( + 'username' => request_var('username', '', true), + 'password_confirm' => request_var('password_confirm', '', true), + 'new_password' => request_var('new_password', '', true), + 'cur_password' => request_var('cur_password', '', true), + 'email' => request_var('email', ''), + 'email_confirm' => request_var('email_confirm', ''), + 'confirm_code' => request_var('confirm_code', ''), + 'lang' => request_var('lang', $user->lang_name), + 'tz' => request_var('tz', (float) $timezone), + ); + // Check and initialize some variables if needed if ($submit) { - foreach ($var_ary as $var => $default) - { - $data[$var] = request_var($var, $default, true); - } - - $var_ary = array( + $error = validate_data($data, array( 'username' => array( array('string', false, $config['min_name_chars'], $config['max_name_chars']), array('username')), - 'new_password' => array('string', false, $config['min_pass_chars'], $config['max_pass_chars']), + 'new_password' => array( + array('string', false, $config['min_pass_chars'], $config['max_pass_chars']), + array('password')), 'password_confirm' => array('string', false, $config['min_pass_chars'], $config['max_pass_chars']), 'email' => array( array('string', false, 6, 60), @@ -126,15 +140,20 @@ class ucp_register 'confirm_code' => array('string', !$config['enable_confirm'], 5, 8), 'tz' => array('num', false, -14, 14), 'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'), - ); - - $error = validate_data($data, $var_ary); - extract($data); - unset($data); + )); // Replace "error" strings with their real, localised form $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error); + // DNSBL check + if ($config['check_dnsbl']) + { + if (($dnsbl = $user->check_dnsbl()) !== false) + { + $error[] = sprintf($user->lang['IP_BLACKLISTED'], $user->ip, $dnsbl[1]); + } + } + // validate custom profile fields $cp->submit_cp_field('register', $user->get_iso_lang_id(), $cp_data, $error); @@ -160,7 +179,7 @@ class ucp_register if ($row) { - if (strcasecmp($row['code'], $confirm_code) === 0) + if (strcasecmp($row['code'], $data['confirm_code']) === 0) { $sql = 'DELETE FROM ' . CONFIRM_TABLE . " WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "' @@ -184,12 +203,12 @@ class ucp_register if (!sizeof($error)) { - if ($new_password != $password_confirm) + if ($data['new_password'] != $data['password_confirm']) { $error[] = $user->lang['NEW_PASSWORD_ERROR']; } - if ($email != $email_confirm) + if ($data['email'] != $data['email_confirm']) { $error[] = $user->lang['NEW_EMAIL_ERROR']; } @@ -200,9 +219,7 @@ class ucp_register $server_url = generate_board_url(); // Which group by default? - $group_reg = ($coppa) ? 'REGISTERED_COPPA' : 'REGISTERED'; - $group_inactive = ($coppa) ? 'INACTIVE_COPPA' : 'INACTIVE'; - $group_name = ($config['require_activation'] == USER_ACTIVATION_NONE || !$config['email_enable']) ? $group_reg : $group_inactive; + $group_name = ($coppa) ? 'REGISTERED_COPPA' : 'REGISTERED'; $sql = 'SELECT group_id FROM ' . GROUPS_TABLE . " @@ -227,25 +244,33 @@ class ucp_register $key_len = 54 - (strlen($server_url)); $key_len = ($key_len < 6) ? 6 : $key_len; $user_actkey = substr($user_actkey, 0, $key_len); + $user_type = USER_INACTIVE; + $user_inactive_reason = INACTIVE_REGISTER; + $user_inactive_time = time(); } else { $user_type = USER_NORMAL; $user_actkey = ''; + $user_inactive_reason = 0; + $user_inactive_time = 0; } $user_row = array( - 'username' => $username, - 'user_password' => md5($new_password), - 'user_email' => $email, - 'group_id' => (int) $group_id, - 'user_timezone' => (float) $tz, - 'user_lang' => $lang, - 'user_type' => $user_type, - 'user_actkey' => $user_actkey, - 'user_ip' => $user->ip, - 'user_regdate' => time(), + 'username' => $data['username'], + 'user_password' => md5($data['new_password']), + 'user_email' => $data['email'], + 'group_id' => (int) $group_id, + 'user_timezone' => (float) $data['tz'], + 'user_dst' => $is_dst, + 'user_lang' => $data['lang'], + 'user_type' => $user_type, + 'user_actkey' => $user_actkey, + 'user_ip' => $user->ip, + 'user_regdate' => time(), + 'user_inactive_reason' => $user_inactive_reason, + 'user_inactive_time' => $user_inactive_time, ); // Register user... @@ -284,10 +309,10 @@ class ucp_register $messenger = new messenger(false); - $messenger->template($email_template, $lang); + $messenger->template($email_template, $data['lang']); $messenger->replyto($config['board_contact']); - $messenger->to($email, $username); + $messenger->to($data['email'], $data['username']); $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']); @@ -295,12 +320,9 @@ class ucp_register $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); $messenger->assign_vars(array( - 'SITENAME' => $config['sitename'], - 'WELCOME_MSG' => sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']), - 'USERNAME' => html_entity_decode($username), - 'PASSWORD' => html_entity_decode($password_confirm), - 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), - + 'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])), + 'USERNAME' => htmlspecialchars_decode($data['username']), + 'PASSWORD' => htmlspecialchars_decode($data['new_password']), 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey") ); @@ -309,8 +331,7 @@ class ucp_register $messenger->assign_vars(array( 'FAX_INFO' => $config['coppa_fax'], 'MAIL_INFO' => $config['coppa_mail'], - 'EMAIL_ADDRESS' => $email, - 'SITENAME' => $config['sitename']) + 'EMAIL_ADDRESS' => $data['email']) ); } @@ -320,10 +341,19 @@ class ucp_register { // Grab an array of user_id's with a_user permissions ... these users can activate a user $admin_ary = $auth->acl_get_list(false, 'a_user', false); + $admin_ary = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array(); + + // Also include founders + $where_sql = ' WHERE user_type = ' . USER_FOUNDER; + + if (sizeof($admin_ary)) + { + $where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary); + } $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type - FROM ' . USERS_TABLE . ' - WHERE ' . $db->sql_in_set('user_id', $admin_ary[0]['a_user']); + FROM ' . USERS_TABLE . ' ' . + $where_sql; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) @@ -334,9 +364,7 @@ class ucp_register $messenger->im($row['user_jabber'], $row['username']); $messenger->assign_vars(array( - 'USERNAME' => html_entity_decode($username), - 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), - + 'USERNAME' => htmlspecialchars_decode($data['username']), 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey") ); @@ -345,7 +373,6 @@ class ucp_register $db->sql_freeresult($result); } } - unset($data); $message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>'); trigger_error($message); @@ -379,10 +406,13 @@ class ucp_register } while ($row = $db->sql_fetchrow($result)); - $sql = 'DELETE FROM ' . CONFIRM_TABLE . ' - WHERE ' . $db->sql_in_set('session_id', $sql_in, true) . ' - AND confirm_type = ' . CONFIRM_REG; - $db->sql_query($sql); + if (sizeof($sql_in)) + { + $sql = 'DELETE FROM ' . CONFIRM_TABLE . ' + WHERE ' . $db->sql_in_set('session_id', $sql_in, true) . ' + AND confirm_type = ' . CONFIRM_REG; + $db->sql_query($sql); + } } $db->sql_freeresult($result); @@ -433,27 +463,25 @@ class ucp_register } $user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS'); - - $lang = (isset($lang)) ? $lang : $config['default_lang']; - $tz = (isset($tz)) ? $tz : $config['board_timezone']; + $pass_char_ary = array('.*' => 'PASS_TYPE_ANY', '[a-zA-Z]' => 'PASS_TYPE_CASE', '[a-zA-Z0-9]' => 'PASS_TYPE_ALPHA', '[a-zA-Z\W]' => 'PASS_TYPE_SYMBOL'); // $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', - 'USERNAME' => (isset($username)) ? $username : '', - 'PASSWORD' => (isset($new_password)) ? $new_password : '', - 'PASSWORD_CONFIRM' => (isset($password_confirm)) ? $password_confirm : '', - 'EMAIL' => (isset($email)) ? $email : '', - 'EMAIL_CONFIRM' => (isset($email_confirm)) ? $email_confirm : '', + 'USERNAME' => $data['username'], + 'PASSWORD' => $data['new_password'], + '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:' . htmlentities($config['board_contact']) . '">', '</a>'), + '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[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), - 'L_NEW_PASSWORD_EXPLAIN' => sprintf($user->lang['NEW_PASSWORD_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), + 'L_NEW_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), - 'S_LANG_OPTIONS' => language_select($lang), - 'S_TZ_OPTIONS' => tz_select($tz), + 'S_LANG_OPTIONS' => language_select($data['lang']), + 'S_TZ_OPTIONS' => tz_select($data['tz']), 'S_CONFIRM_CODE' => ($config['enable_confirm']) ? true : false, 'S_COPPA' => $coppa, 'S_HIDDEN_FIELDS' => $s_hidden_fields, diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php index 11edb54b95..7ce82093ca 100644 --- a/phpBB/includes/ucp/ucp_remind.php +++ b/phpBB/includes/ucp/ucp_remind.php @@ -22,7 +22,7 @@ class ucp_remind global $config, $phpbb_root_path, $phpEx; global $db, $user, $auth, $template; - $username = request_var('username', ''); + $username = request_var('username', '', true); $email = request_var('email', ''); $submit = (isset($_POST['submit'])) ? true : false; @@ -31,7 +31,7 @@ class ucp_remind $sql = 'SELECT user_id, username, user_email, user_jabber, user_notify_type, user_type, user_lang FROM ' . USERS_TABLE . " WHERE user_email = '" . $db->sql_escape($email) . "' - AND LOWER(username) = '" . $db->sql_escape(strtolower($username)) . "'"; + AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; $result = $db->sql_query($sql); $user_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -69,11 +69,8 @@ class ucp_remind $messenger->im($user_row['user_jabber'], $user_row['username']); $messenger->assign_vars(array( - 'SITENAME' => $config['sitename'], - 'USERNAME' => html_entity_decode($user_row['username']), - 'PASSWORD' => html_entity_decode($user_password), - 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), - + 'USERNAME' => htmlspecialchars_decode($user_row['username']), + 'PASSWORD' => htmlspecialchars_decode($user_password), 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k=$user_actkey") ); diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php index 84ce3fe9b7..62e796bc4b 100644 --- a/phpBB/includes/ucp/ucp_resend.php +++ b/phpBB/includes/ucp/ucp_resend.php @@ -22,7 +22,7 @@ class ucp_resend global $config, $phpbb_root_path, $phpEx; global $db, $user, $auth, $template; - $username = request_var('username', ''); + $username = request_var('username', '', true); $email = request_var('email', ''); $submit = (isset($_POST['submit'])) ? true : false; @@ -31,7 +31,7 @@ class ucp_resend $sql = 'SELECT user_id, group_id, username, user_email, user_type, user_lang, user_actkey FROM ' . USERS_TABLE . " WHERE user_email = '" . $db->sql_escape($email) . "' - AND LOWER(username) = '" . $db->sql_escape(strtolower($username)) . "'"; + AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; $result = $db->sql_query($sql); $user_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -46,7 +46,7 @@ class ucp_resend trigger_error('ACCOUNT_ALREADY_ACTIVATED'); } - // Determine coppa status on group (INACTIVE(_COPPA)) + // Determine coppa status on group (REGISTERED(_COPPA)) $sql = 'SELECT group_name, group_type FROM ' . GROUPS_TABLE . ' WHERE group_id = ' . $user_row['group_id']; @@ -59,7 +59,7 @@ class ucp_resend trigger_error('NO_GROUP'); } - $coppa = ($row['group_name'] == 'INACTIVE_COPPA' && $row['group_type'] == GROUP_SPECIAL) ? true : false; + $coppa = ($row['group_name'] == 'REGISTERED_COPPA' && $row['group_type'] == GROUP_SPECIAL) ? true : false; include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $messenger = new messenger(false); @@ -77,11 +77,8 @@ class ucp_resend $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); $messenger->assign_vars(array( - 'SITENAME' => $config['sitename'], - 'WELCOME_MSG' => sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']), - 'USERNAME' => html_entity_decode($user_row['username']), - 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), - + 'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])), + 'USERNAME' => htmlspecialchars_decode($user_row['username']), 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}") ); @@ -90,8 +87,7 @@ class ucp_resend $messenger->assign_vars(array( 'FAX_INFO' => $config['coppa_fax'], 'MAIL_INFO' => $config['coppa_mail'], - 'EMAIL_ADDRESS' => $user_row['user_email'], - 'SITENAME' => $config['sitename']) + 'EMAIL_ADDRESS' => $user_row['user_email']) ); } @@ -116,9 +112,7 @@ class ucp_resend $messenger->im($row['user_jabber'], $row['username']); $messenger->assign_vars(array( - 'USERNAME' => html_entity_decode($user_row['username']), - 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), - + 'USERNAME' => htmlspecialchars_decode($user_row['username']), 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}") ); diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index 2cf6edcac4..2548037b10 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -20,7 +20,7 @@ class ucp_zebra { global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; - $submit = (isset($_POST['submit']) || isset($_GET['add'])) ? true : false; + $submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false; $s_hidden_fields = ''; $l_mode = strtoupper($mode); @@ -32,17 +32,17 @@ class ucp_zebra $var_ary = array( 'usernames' => array(0), - 'add' => '', + 'add' => '', ); foreach ($var_ary as $var => $default) { - $data[$var] = request_var($var, $default); + $data[$var] = request_var($var, $default, true); } if ($data['add']) { - $data['add'] = array_map('trim', array_map('strtolower', explode("\n", $data['add']))); + $data['add'] = array_map('trim', array_map('utf8_clean_string', explode("\n", $data['add']))); // Do these name/s exist on a list already? If so, ignore ... we could be // 'nice' and automatically handle names added to one list present on @@ -59,11 +59,11 @@ class ucp_zebra { if ($row['friend']) { - $friends[] = strtolower($row['username']); + $friends[] = utf8_clean_string($row['username']); } else { - $foes[] = strtolower($row['username']); + $foes[] = utf8_clean_string($row['username']); } } $db->sql_freeresult($result); @@ -88,7 +88,7 @@ class ucp_zebra // remove the user himself from the username array $n = sizeof($data['add']); - $data['add'] = array_diff($data['add'], array(strtolower($user->data['username']))); + $data['add'] = array_diff($data['add'], array(utf8_clean_string($user->data['username']))); if (sizeof($data['add']) < $n) { @@ -101,7 +101,7 @@ class ucp_zebra { $sql = 'SELECT user_id, user_type FROM ' . USERS_TABLE . ' - WHERE ' . $db->sql_in_set('LOWER(username)', $data['add']) . ' + WHERE ' . $db->sql_in_set('username_clean', $data['add']) . ' AND user_type <> ' . USER_INACTIVE; $result = $db->sql_query($sql); @@ -159,24 +159,7 @@ class ucp_zebra ); } - if (sizeof($sql_ary)) - { - switch (SQL_LAYER) - { - case 'mysql': - case 'mysql4': - case 'mysqli': - $db->sql_query('INSERT INTO ' . ZEBRA_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); - break; - - default: - foreach ($sql_ary as $ary) - { - $db->sql_query('INSERT INTO ' . ZEBRA_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); - } - break; - } - } + $db->sql_multi_insert(ZEBRA_TABLE, $sql_ary); $updated = true; } @@ -197,6 +180,8 @@ class ucp_zebra 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 --git a/phpBB/includes/utf/data/case_fold_c.php b/phpBB/includes/utf/data/case_fold_c.php new file mode 100644 index 0000000000..00de1ba349 --- /dev/null +++ b/phpBB/includes/utf/data/case_fold_c.php @@ -0,0 +1 @@ +<?php return array('A'=>'a','B'=>'b','C'=>'c','D'=>'d','E'=>'e','F'=>'f','G'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','M'=>'m','N'=>'n','O'=>'o','P'=>'p','Q'=>'q','R'=>'r','S'=>'s','T'=>'t','U'=>'u','V'=>'v','W'=>'w','X'=>'x','Y'=>'y','Z'=>'z','µ'=>'μ','À'=>'à ','Ã'=>'á','Â'=>'â','Ã'=>'ã','Ä'=>'ä','Ã…'=>'Ã¥','Æ'=>'æ','Ç'=>'ç','È'=>'è','É'=>'é','Ê'=>'ê','Ë'=>'ë','ÃŒ'=>'ì','Ã'=>'Ã','ÃŽ'=>'î','Ã'=>'ï','Ã'=>'ð','Ñ'=>'ñ','Ã’'=>'ò','Ó'=>'ó','Ô'=>'ô','Õ'=>'õ','Ö'=>'ö','Ø'=>'ø','Ù'=>'ù','Ú'=>'ú','Û'=>'û','Ü'=>'ü','Ã'=>'ý','Þ'=>'þ','Ä€'=>'Ä','Ä‚'=>'ă','Ä„'=>'Ä…','Ć'=>'ć','Ĉ'=>'ĉ','ÄŠ'=>'Ä‹','ÄŒ'=>'Ä','ÄŽ'=>'Ä','Ä'=>'Ä‘','Ä’'=>'Ä“','Ä”'=>'Ä•','Ä–'=>'Ä—','Ę'=>'Ä™','Äš'=>'Ä›','Äœ'=>'Ä','Äž'=>'ÄŸ','Ä '=>'Ä¡','Ä¢'=>'Ä£','Ĥ'=>'Ä¥','Ħ'=>'ħ','Ĩ'=>'Ä©','Ī'=>'Ä«','Ĭ'=>'Ä','Ä®'=>'į','IJ'=>'ij','Ä´'=>'ĵ','Ķ'=>'Ä·','Ĺ'=>'ĺ','Ä»'=>'ļ','Ľ'=>'ľ','Ä¿'=>'Å€','Å'=>'Å‚','Ń'=>'Å„','Å…'=>'ņ','Ň'=>'ň','ÅŠ'=>'Å‹','ÅŒ'=>'Å','ÅŽ'=>'Å','Å'=>'Å‘','Å’'=>'Å“','Å”'=>'Å•','Å–'=>'Å—','Ř'=>'Å™','Åš'=>'Å›','Åœ'=>'Å','Åž'=>'ÅŸ','Å '=>'Å¡','Å¢'=>'Å£','Ť'=>'Å¥','Ŧ'=>'ŧ','Ũ'=>'Å©','Ū'=>'Å«','Ŭ'=>'Å','Å®'=>'ů','Ű'=>'ű','Ų'=>'ų','Å´'=>'ŵ','Ŷ'=>'Å·','Ÿ'=>'ÿ','Ź'=>'ź','Å»'=>'ż','Ž'=>'ž','Å¿'=>'s','Æ'=>'É“','Æ‚'=>'ƃ','Æ„'=>'Æ…','Ɔ'=>'É”','Ƈ'=>'ƈ','Ɖ'=>'É–','ÆŠ'=>'É—','Æ‹'=>'ÆŒ','ÆŽ'=>'Ç','Æ'=>'É™','Æ'=>'É›','Æ‘'=>'Æ’','Æ“'=>'É ','Æ”'=>'É£','Æ–'=>'É©','Æ—'=>'ɨ','Ƙ'=>'Æ™','Æœ'=>'ɯ','Æ'=>'ɲ','ÆŸ'=>'ɵ','Æ '=>'Æ¡','Æ¢'=>'Æ£','Ƥ'=>'Æ¥','Ʀ'=>'Ê€','Ƨ'=>'ƨ','Æ©'=>'ʃ','Ƭ'=>'Æ','Æ®'=>'ʈ','Ư'=>'ư','Ʊ'=>'ÊŠ','Ʋ'=>'Ê‹','Ƴ'=>'Æ´','Ƶ'=>'ƶ','Æ·'=>'Ê’','Ƹ'=>'ƹ','Ƽ'=>'ƽ','Ç„'=>'dž','Ç…'=>'dž','LJ'=>'lj','Lj'=>'lj','ÇŠ'=>'ÇŒ','Ç‹'=>'ÇŒ','Ç'=>'ÇŽ','Ç'=>'Ç','Ç‘'=>'Ç’','Ç“'=>'Ç”','Ç•'=>'Ç–','Ç—'=>'ǘ','Ç™'=>'Çš','Ç›'=>'Çœ','Çž'=>'ÇŸ','Ç '=>'Ç¡','Ç¢'=>'Ç£','Ǥ'=>'Ç¥','Ǧ'=>'ǧ','Ǩ'=>'Ç©','Ǫ'=>'Ç«','Ǭ'=>'Ç','Ç®'=>'ǯ','DZ'=>'dz','Dz'=>'dz','Ç´'=>'ǵ','Ƕ'=>'Æ•','Ç·'=>'Æ¿','Ǹ'=>'ǹ','Ǻ'=>'Ç»','Ǽ'=>'ǽ','Ǿ'=>'Ç¿','È€'=>'È','È‚'=>'ȃ','È„'=>'È…','Ȇ'=>'ȇ','Ȉ'=>'ȉ','ÈŠ'=>'È‹','ÈŒ'=>'È','ÈŽ'=>'È','È'=>'È‘','È’'=>'È“','È”'=>'È•','È–'=>'È—','Ș'=>'È™','Èš'=>'È›','Èœ'=>'È','Èž'=>'ÈŸ','È '=>'Æž','È¢'=>'È£','Ȥ'=>'È¥','Ȧ'=>'ȧ','Ȩ'=>'È©','Ȫ'=>'È«','Ȭ'=>'È','È®'=>'ȯ','Ȱ'=>'ȱ','Ȳ'=>'ȳ','Ⱥ'=>'â±¥','È»'=>'ȼ','Ƚ'=>'Æš','Ⱦ'=>'ⱦ','É'=>'É‚','Ƀ'=>'Æ€','É„'=>'ʉ','É…'=>'ÊŒ','Ɇ'=>'ɇ','Ɉ'=>'ɉ','ÉŠ'=>'É‹','ÉŒ'=>'É','ÉŽ'=>'É','Í…'=>'ι','Ά'=>'ά','Έ'=>'Î','Ή'=>'ή','Ί'=>'ί','ÎŒ'=>'ÏŒ','ÎŽ'=>'Ï','Î'=>'ÏŽ','Α'=>'α','Î’'=>'β','Γ'=>'γ','Δ'=>'δ','Ε'=>'ε','Ζ'=>'ζ','Η'=>'η','Θ'=>'θ','Ι'=>'ι','Κ'=>'κ','Λ'=>'λ','Μ'=>'μ','Î'=>'ν','Ξ'=>'ξ','Ο'=>'ο','Î '=>'Ï€','Ρ'=>'Ï','Σ'=>'σ','Τ'=>'Ï„','Î¥'=>'Ï…','Φ'=>'φ','Χ'=>'χ','Ψ'=>'ψ','Ω'=>'ω','Ϊ'=>'ÏŠ','Ϋ'=>'Ï‹','Ï‚'=>'σ','Ï'=>'β','Ï‘'=>'θ','Ï•'=>'φ','Ï–'=>'Ï€','Ϙ'=>'Ï™','Ïš'=>'Ï›','Ïœ'=>'Ï','Ïž'=>'ÏŸ','Ï '=>'Ï¡','Ï¢'=>'Ï£','Ϥ'=>'Ï¥','Ϧ'=>'ϧ','Ϩ'=>'Ï©','Ϫ'=>'Ï«','Ϭ'=>'Ï','Ï®'=>'ϯ','ϰ'=>'κ','ϱ'=>'Ï','Ï´'=>'θ','ϵ'=>'ε','Ï·'=>'ϸ','Ϲ'=>'ϲ','Ϻ'=>'Ï»','Ͻ'=>'Í»','Ͼ'=>'ͼ','Ï¿'=>'ͽ','Ѐ'=>'Ñ','Ð'=>'Ñ‘','Ђ'=>'Ñ’','Ѓ'=>'Ñ“','Є'=>'Ñ”','Ð…'=>'Ñ•','І'=>'Ñ–','Ї'=>'Ñ—','Ј'=>'ј','Љ'=>'Ñ™','Њ'=>'Ñš','Ћ'=>'Ñ›','ÐŒ'=>'Ñœ','Ð'=>'Ñ','ÐŽ'=>'Ñž','Ð'=>'ÑŸ','Ð'=>'а','Б'=>'б','Ð’'=>'в','Г'=>'г','Д'=>'д','Е'=>'е','Ж'=>'ж','З'=>'з','И'=>'и','Й'=>'й','К'=>'к','Л'=>'л','М'=>'м','Ð'=>'н','О'=>'о','П'=>'п','Ð '=>'Ñ€','С'=>'Ñ','Т'=>'Ñ‚','У'=>'у','Ф'=>'Ñ„','Ð¥'=>'Ñ…','Ц'=>'ц','Ч'=>'ч','Ш'=>'ш','Щ'=>'щ','Ъ'=>'ÑŠ','Ы'=>'Ñ‹','Ь'=>'ÑŒ','Ð'=>'Ñ','Ю'=>'ÑŽ','Я'=>'Ñ','Ñ '=>'Ñ¡','Ñ¢'=>'Ñ£','Ѥ'=>'Ñ¥','Ѧ'=>'ѧ','Ѩ'=>'Ñ©','Ѫ'=>'Ñ«','Ѭ'=>'Ñ','Ñ®'=>'ѯ','Ѱ'=>'ѱ','Ѳ'=>'ѳ','Ñ´'=>'ѵ','Ѷ'=>'Ñ·','Ѹ'=>'ѹ','Ѻ'=>'Ñ»','Ѽ'=>'ѽ','Ѿ'=>'Ñ¿','Ò€'=>'Ò','ÒŠ'=>'Ò‹','ÒŒ'=>'Ò','ÒŽ'=>'Ò','Ò'=>'Ò‘','Ò’'=>'Ò“','Ò”'=>'Ò•','Ò–'=>'Ò—','Ò˜'=>'Ò™','Òš'=>'Ò›','Òœ'=>'Ò','Òž'=>'ÒŸ','Ò '=>'Ò¡','Ò¢'=>'Ò£','Ò¤'=>'Ò¥','Ò¦'=>'Ò§','Ò¨'=>'Ò©','Òª'=>'Ò«','Ò¬'=>'Ò','Ò®'=>'Ò¯','Ò°'=>'Ò±','Ò²'=>'Ò³','Ò´'=>'Òµ','Ò¶'=>'Ò·','Ò¸'=>'Ò¹','Òº'=>'Ò»','Ò¼'=>'Ò½','Ò¾'=>'Ò¿','Ó€'=>'Ó','Ó'=>'Ó‚','Óƒ'=>'Ó„','Ó…'=>'Ó†','Ó‡'=>'Óˆ','Ó‰'=>'ÓŠ','Ó‹'=>'ÓŒ','Ó'=>'ÓŽ','Ó'=>'Ó‘','Ó’'=>'Ó“','Ó”'=>'Ó•','Ó–'=>'Ó—','Ó˜'=>'Ó™','Óš'=>'Ó›','Óœ'=>'Ó','Óž'=>'ÓŸ','Ó '=>'Ó¡','Ó¢'=>'Ó£','Ó¤'=>'Ó¥','Ó¦'=>'Ó§','Ó¨'=>'Ó©','Óª'=>'Ó«','Ó¬'=>'Ó','Ó®'=>'Ó¯','Ó°'=>'Ó±','Ó²'=>'Ó³','Ó´'=>'Óµ','Ó¶'=>'Ó·','Ó¸'=>'Ó¹','Óº'=>'Ó»','Ó¼'=>'Ó½','Ó¾'=>'Ó¿','Ô€'=>'Ô','Ô‚'=>'Ôƒ','Ô„'=>'Ô…','Ô†'=>'Ô‡','Ôˆ'=>'Ô‰','ÔŠ'=>'Ô‹','ÔŒ'=>'Ô','ÔŽ'=>'Ô','Ô'=>'Ô‘','Ô’'=>'Ô“','Ô±'=>'Õ¡','Ô²'=>'Õ¢','Ô³'=>'Õ£','Ô´'=>'Õ¤','Ôµ'=>'Õ¥','Ô¶'=>'Õ¦','Ô·'=>'Õ§','Ô¸'=>'Õ¨','Ô¹'=>'Õ©','Ôº'=>'Õª','Ô»'=>'Õ«','Ô¼'=>'Õ¬','Ô½'=>'Õ','Ô¾'=>'Õ®','Ô¿'=>'Õ¯','Õ€'=>'Õ°','Õ'=>'Õ±','Õ‚'=>'Õ²','Õƒ'=>'Õ³','Õ„'=>'Õ´','Õ…'=>'Õµ','Õ†'=>'Õ¶','Õ‡'=>'Õ·','Õˆ'=>'Õ¸','Õ‰'=>'Õ¹','ÕŠ'=>'Õº','Õ‹'=>'Õ»','ÕŒ'=>'Õ¼','Õ'=>'Õ½','ÕŽ'=>'Õ¾','Õ'=>'Õ¿','Õ'=>'Ö€','Õ‘'=>'Ö','Õ’'=>'Ö‚','Õ“'=>'Öƒ','Õ”'=>'Ö„','Õ•'=>'Ö…','Õ–'=>'Ö†','á‚ '=>'â´€','á‚¡'=>'â´','á‚¢'=>'â´‚','á‚£'=>'â´ƒ','Ⴄ'=>'â´„','á‚¥'=>'â´…','Ⴆ'=>'â´†','á‚§'=>'â´‡','Ⴈ'=>'â´ˆ','á‚©'=>'â´‰','Ⴊ'=>'â´Š','á‚«'=>'â´‹','Ⴌ'=>'â´Œ','á‚'=>'â´','á‚®'=>'â´Ž','Ⴏ'=>'â´','á‚°'=>'â´','Ⴑ'=>'â´‘','Ⴒ'=>'â´’','Ⴓ'=>'â´“','á‚´'=>'â´”','Ⴕ'=>'â´•','á‚¶'=>'â´–','á‚·'=>'â´—','Ⴘ'=>'â´˜','Ⴙ'=>'â´™','Ⴚ'=>'â´š','á‚»'=>'â´›','Ⴜ'=>'â´œ','Ⴝ'=>'â´','Ⴞ'=>'â´ž','á‚¿'=>'â´Ÿ','Ⴠ'=>'â´ ','áƒ'=>'â´¡','Ⴢ'=>'â´¢','Ⴣ'=>'â´£','Ⴤ'=>'â´¤','Ⴥ'=>'â´¥','Ḁ'=>'á¸','Ḃ'=>'ḃ','Ḅ'=>'ḅ','Ḇ'=>'ḇ','Ḉ'=>'ḉ','Ḋ'=>'ḋ','Ḍ'=>'á¸','Ḏ'=>'á¸','á¸'=>'ḑ','Ḓ'=>'ḓ','Ḕ'=>'ḕ','Ḗ'=>'ḗ','Ḙ'=>'ḙ','Ḛ'=>'ḛ','Ḝ'=>'á¸','Ḟ'=>'ḟ','Ḡ'=>'ḡ','Ḣ'=>'ḣ','Ḥ'=>'ḥ','Ḧ'=>'ḧ','Ḩ'=>'ḩ','Ḫ'=>'ḫ','Ḭ'=>'á¸','Ḯ'=>'ḯ','Ḱ'=>'ḱ','Ḳ'=>'ḳ','Ḵ'=>'ḵ','Ḷ'=>'ḷ','Ḹ'=>'ḹ','Ḻ'=>'ḻ','Ḽ'=>'ḽ','Ḿ'=>'ḿ','á¹€'=>'á¹','Ṃ'=>'ṃ','Ṅ'=>'á¹…','Ṇ'=>'ṇ','Ṉ'=>'ṉ','Ṋ'=>'ṋ','Ṍ'=>'á¹','Ṏ'=>'á¹','á¹'=>'ṑ','á¹’'=>'ṓ','á¹”'=>'ṕ','á¹–'=>'á¹—','Ṙ'=>'á¹™','Ṛ'=>'á¹›','Ṝ'=>'á¹','Ṟ'=>'ṟ','á¹ '=>'ṡ','á¹¢'=>'á¹£','Ṥ'=>'á¹¥','Ṧ'=>'á¹§','Ṩ'=>'ṩ','Ṫ'=>'ṫ','Ṭ'=>'á¹','á¹®'=>'ṯ','á¹°'=>'á¹±','á¹²'=>'á¹³','á¹´'=>'á¹µ','á¹¶'=>'á¹·','Ṹ'=>'á¹¹','Ṻ'=>'á¹»','á¹¼'=>'á¹½','á¹¾'=>'ṿ','Ẁ'=>'áº','Ẃ'=>'ẃ','Ẅ'=>'ẅ','Ẇ'=>'ẇ','Ẉ'=>'ẉ','Ẋ'=>'ẋ','Ẍ'=>'áº','Ẏ'=>'áº','áº'=>'ẑ','Ẓ'=>'ẓ','Ẕ'=>'ẕ','ẛ'=>'ṡ','Ạ'=>'ạ','Ả'=>'ả','Ấ'=>'ấ','Ầ'=>'ầ','Ẩ'=>'ẩ','Ẫ'=>'ẫ','Ậ'=>'áº','Ắ'=>'ắ','Ằ'=>'ằ','Ẳ'=>'ẳ','Ẵ'=>'ẵ','Ặ'=>'ặ','Ẹ'=>'ẹ','Ẻ'=>'ẻ','Ẽ'=>'ẽ','Ế'=>'ế','Ề'=>'á»','Ể'=>'ể','Ễ'=>'á»…','Ệ'=>'ệ','Ỉ'=>'ỉ','Ị'=>'ị','Ọ'=>'á»','Ỏ'=>'á»','á»'=>'ố','á»’'=>'ồ','á»”'=>'ổ','á»–'=>'á»—','Ộ'=>'á»™','Ớ'=>'á»›','Ờ'=>'á»','Ở'=>'ở','á» '=>'ỡ','Ợ'=>'ợ','Ụ'=>'ụ','Ủ'=>'á»§','Ứ'=>'ứ','Ừ'=>'ừ','Ử'=>'á»','á»®'=>'ữ','á»°'=>'á»±','Ỳ'=>'ỳ','á»´'=>'ỵ','á»¶'=>'á»·','Ỹ'=>'ỹ','Ἀ'=>'á¼€','Ἁ'=>'á¼','Ἂ'=>'ἂ','Ἃ'=>'ἃ','Ἄ'=>'ἄ','á¼'=>'á¼…','Ἆ'=>'ἆ','á¼'=>'ἇ','Ἐ'=>'á¼','á¼™'=>'ἑ','Ἒ'=>'á¼’','á¼›'=>'ἓ','Ἔ'=>'á¼”','á¼'=>'ἕ','Ἠ'=>'á¼ ','Ἡ'=>'ἡ','Ἢ'=>'á¼¢','Ἣ'=>'á¼£','Ἤ'=>'ἤ','á¼'=>'á¼¥','á¼®'=>'ἦ','Ἧ'=>'á¼§','Ἰ'=>'á¼°','á¼¹'=>'á¼±','Ἲ'=>'á¼²','á¼»'=>'á¼³','á¼¼'=>'á¼´','á¼½'=>'á¼µ','á¼¾'=>'á¼¶','Ἷ'=>'á¼·','Ὀ'=>'á½€','Ὁ'=>'á½','Ὂ'=>'ὂ','Ὃ'=>'ὃ','Ὄ'=>'ὄ','á½'=>'á½…','á½™'=>'ὑ','á½›'=>'ὓ','á½'=>'ὕ','Ὗ'=>'á½—','Ὠ'=>'á½ ','Ὡ'=>'ὡ','Ὢ'=>'á½¢','Ὣ'=>'á½£','Ὤ'=>'ὤ','á½'=>'á½¥','á½®'=>'ὦ','Ὧ'=>'á½§','Ᾰ'=>'á¾°','á¾¹'=>'á¾±','Ὰ'=>'á½°','á¾»'=>'á½±','á¾¾'=>'ι','Ὲ'=>'á½²','Έ'=>'á½³','Ὴ'=>'á½´','á¿‹'=>'á½µ','Ῐ'=>'á¿','á¿™'=>'á¿‘','Ὶ'=>'á½¶','á¿›'=>'á½·','Ῠ'=>'á¿ ','á¿©'=>'á¿¡','Ὺ'=>'ὺ','á¿«'=>'á½»','Ῥ'=>'á¿¥','Ὸ'=>'ὸ','Ό'=>'á½¹','Ὼ'=>'á½¼','á¿»'=>'á½½','Ω'=>'ω','K'=>'k','â„«'=>'Ã¥','Ⅎ'=>'â…Ž','â… '=>'â…°','â…¡'=>'â…±','â…¢'=>'â…²','â…£'=>'â…³','â…¤'=>'â…´','â…¥'=>'â…µ','â…¦'=>'â…¶','â…§'=>'â…·','â…¨'=>'â…¸','â…©'=>'â…¹','â…ª'=>'â…º','â…«'=>'â…»','â…¬'=>'â…¼','â…'=>'â…½','â…®'=>'â…¾','â…¯'=>'â…¿','Ↄ'=>'ↄ','â’¶'=>'â“','â’·'=>'â“‘','â’¸'=>'â“’','â’¹'=>'â““','â’º'=>'â“”','â’»'=>'â“•','â’¼'=>'â“–','â’½'=>'â“—','â’¾'=>'ⓘ','â’¿'=>'â“™','â“€'=>'ⓚ','â“'=>'â“›','â“‚'=>'ⓜ','Ⓝ'=>'â“','â“„'=>'ⓞ','â“…'=>'ⓟ','Ⓠ'=>'â“ ','Ⓡ'=>'â“¡','Ⓢ'=>'â“¢','Ⓣ'=>'â“£','Ⓤ'=>'ⓤ','â“‹'=>'â“¥','Ⓦ'=>'ⓦ','â“'=>'â“§','Ⓨ'=>'ⓨ','â“'=>'â“©','â°€'=>'â°°','â°'=>'â°±','â°‚'=>'â°²','â°ƒ'=>'â°³','â°„'=>'â°´','â°…'=>'â°µ','â°†'=>'â°¶','â°‡'=>'â°·','â°ˆ'=>'â°¸','â°‰'=>'â°¹','â°Š'=>'â°º','â°‹'=>'â°»','â°Œ'=>'â°¼','â°'=>'â°½','â°Ž'=>'â°¾','â°'=>'â°¿','â°'=>'â±€','â°‘'=>'â±','â°’'=>'ⱂ','â°“'=>'ⱃ','â°”'=>'ⱄ','â°•'=>'â±…','â°–'=>'ⱆ','â°—'=>'ⱇ','â°˜'=>'ⱈ','â°™'=>'ⱉ','â°š'=>'ⱊ','â°›'=>'ⱋ','â°œ'=>'ⱌ','â°'=>'â±','â°ž'=>'ⱎ','â°Ÿ'=>'â±','â° '=>'â±','â°¡'=>'ⱑ','â°¢'=>'â±’','â°£'=>'ⱓ','â°¤'=>'â±”','â°¥'=>'ⱕ','â°¦'=>'â±–','â°§'=>'â±—','â°¨'=>'ⱘ','â°©'=>'â±™','â°ª'=>'ⱚ','â°«'=>'â±›','â°¬'=>'ⱜ','â°'=>'â±','â°®'=>'ⱞ','â± '=>'ⱡ','â±¢'=>'É«','â±£'=>'áµ½','Ɽ'=>'ɽ','â±§'=>'ⱨ','Ⱪ'=>'ⱪ','Ⱬ'=>'ⱬ','â±µ'=>'â±¶','â²€'=>'â²','Ⲃ'=>'ⲃ','Ⲅ'=>'â²…','Ⲇ'=>'ⲇ','Ⲉ'=>'ⲉ','Ⲋ'=>'ⲋ','Ⲍ'=>'â²','Ⲏ'=>'â²','â²'=>'ⲑ','â²’'=>'ⲓ','â²”'=>'ⲕ','â²–'=>'â²—','Ⲙ'=>'â²™','Ⲛ'=>'â²›','Ⲝ'=>'â²','Ⲟ'=>'ⲟ','â² '=>'ⲡ','â²¢'=>'â²£','Ⲥ'=>'â²¥','Ⲧ'=>'â²§','Ⲩ'=>'ⲩ','Ⲫ'=>'ⲫ','Ⲭ'=>'â²','â²®'=>'ⲯ','â²°'=>'â²±','â²²'=>'â²³','â²´'=>'â²µ','â²¶'=>'â²·','Ⲹ'=>'â²¹','Ⲻ'=>'â²»','â²¼'=>'â²½','â²¾'=>'ⲿ','â³€'=>'â³','Ⳃ'=>'ⳃ','Ⳅ'=>'â³…','Ⳇ'=>'ⳇ','Ⳉ'=>'ⳉ','Ⳋ'=>'ⳋ','Ⳍ'=>'â³','Ⳏ'=>'â³','â³'=>'ⳑ','â³’'=>'ⳓ','â³”'=>'ⳕ','â³–'=>'â³—','Ⳙ'=>'â³™','Ⳛ'=>'â³›','Ⳝ'=>'â³','Ⳟ'=>'ⳟ','â³ '=>'ⳡ','â³¢'=>'â³£','A'=>'ï½','ï¼¢'=>'b','ï¼£'=>'c','D'=>'d','ï¼¥'=>'ï½…','F'=>'f','ï¼§'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','ï¼'=>'ï½','ï¼®'=>'n','O'=>'ï½','ï¼°'=>'ï½','ï¼±'=>'q','ï¼²'=>'ï½’','ï¼³'=>'s','ï¼´'=>'ï½”','ï¼µ'=>'u','ï¼¶'=>'ï½–','ï¼·'=>'ï½—','X'=>'x','ï¼¹'=>'ï½™','Z'=>'z','ð€'=>'ð¨','ð'=>'ð©','ð‚'=>'ðª','ðƒ'=>'ð«','ð„'=>'ð¬','ð…'=>'ð','ð†'=>'ð®','ð‡'=>'ð¯','ðˆ'=>'ð°','ð‰'=>'ð±','ðŠ'=>'ð²','ð‹'=>'ð³','ðŒ'=>'ð´','ð'=>'ðµ','ðŽ'=>'ð¶','ð'=>'ð·','ð'=>'ð¸','ð‘'=>'ð¹','ð’'=>'ðº','ð“'=>'ð»','ð”'=>'ð¼','ð•'=>'ð½','ð–'=>'ð¾','ð—'=>'ð¿','ð˜'=>'ð‘€','ð™'=>'ð‘','ðš'=>'ð‘‚','ð›'=>'ð‘ƒ','ðœ'=>'ð‘„','ð'=>'ð‘…','ðž'=>'ð‘†','ðŸ'=>'ð‘‡','ð '=>'ð‘ˆ','ð¡'=>'ð‘‰','ð¢'=>'ð‘Š','ð£'=>'ð‘‹','ð¤'=>'ð‘Œ','ð¥'=>'ð‘','ð¦'=>'ð‘Ž','ð§'=>'ð‘');
\ No newline at end of file diff --git a/phpBB/includes/utf/data/case_fold_f.php b/phpBB/includes/utf/data/case_fold_f.php new file mode 100644 index 0000000000..7e2ffb25ec --- /dev/null +++ b/phpBB/includes/utf/data/case_fold_f.php @@ -0,0 +1 @@ +<?php return array('ß'=>'ss','İ'=>'i̇','ʼn'=>'ʼn','ǰ'=>'jÌŒ','Î'=>'ϊÌ','ΰ'=>'ϋÌ','Ö‡'=>'Õ¥Ö‚','ẖ'=>'ẖ','ẗ'=>'ẗ','ẘ'=>'wÌŠ','ẙ'=>'yÌŠ','ẚ'=>'aʾ','á½'=>'Ï…Ì“','á½’'=>'ὒ','á½”'=>'Ï…Ì“Ì','á½–'=>'ὖ','á¾€'=>'ἀι','á¾'=>'á¼Î¹','ᾂ'=>'ἂι','ᾃ'=>'ἃι','ᾄ'=>'ἄι','á¾…'=>'ἅι','ᾆ'=>'ἆι','ᾇ'=>'ἇι','ᾈ'=>'ἀι','ᾉ'=>'á¼Î¹','ᾊ'=>'ἂι','ᾋ'=>'ἃι','ᾌ'=>'ἄι','á¾'=>'ἅι','ᾎ'=>'ἆι','á¾'=>'ἇι','á¾'=>'ἠι','ᾑ'=>'ἡι','á¾’'=>'ἢι','ᾓ'=>'ἣι','á¾”'=>'ἤι','ᾕ'=>'ἥι','á¾–'=>'ἦι','á¾—'=>'ἧι','ᾘ'=>'ἠι','á¾™'=>'ἡι','ᾚ'=>'ἢι','á¾›'=>'ἣι','ᾜ'=>'ἤι','á¾'=>'ἥι','ᾞ'=>'ἦι','ᾟ'=>'ἧι','á¾ '=>'ὠι','ᾡ'=>'ὡι','á¾¢'=>'ὢι','á¾£'=>'ὣι','ᾤ'=>'ὤι','á¾¥'=>'ὥι','ᾦ'=>'ὦι','á¾§'=>'ὧι','ᾨ'=>'ὠι','ᾩ'=>'ὡι','ᾪ'=>'ὢι','ᾫ'=>'ὣι','ᾬ'=>'ὤι','á¾'=>'ὥι','á¾®'=>'ὦι','ᾯ'=>'ὧι','á¾²'=>'ὰι','á¾³'=>'αι','á¾´'=>'άι','á¾¶'=>'ᾶ','á¾·'=>'ᾶι','á¾¼'=>'αι','á¿‚'=>'ὴι','ῃ'=>'ηι','á¿„'=>'ήι','ῆ'=>'ῆ','ῇ'=>'ῆι','ῌ'=>'ηι','á¿’'=>'ῒ','á¿“'=>'ϊÌ','á¿–'=>'ῖ','á¿—'=>'ῗ','á¿¢'=>'ῢ','á¿£'=>'ϋÌ','ῤ'=>'ÏÌ“','ῦ'=>'Ï…Í‚','á¿§'=>'ῧ','ῲ'=>'ὼι','ῳ'=>'ωι','á¿´'=>'ώι','á¿¶'=>'ῶ','á¿·'=>'ῶι','ῼ'=>'ωι','ff'=>'ff','ï¬'=>'fi','fl'=>'fl','ffi'=>'ffi','ffl'=>'ffl','ſt'=>'st','st'=>'st','ﬓ'=>'Õ´Õ¶','ﬔ'=>'Õ´Õ¥','ﬕ'=>'Õ´Õ«','ﬖ'=>'Õ¾Õ¶','ﬗ'=>'Õ´Õ');
\ No newline at end of file diff --git a/phpBB/includes/utf/data/case_fold_s.php b/phpBB/includes/utf/data/case_fold_s.php new file mode 100644 index 0000000000..5f09ffa1dd --- /dev/null +++ b/phpBB/includes/utf/data/case_fold_s.php @@ -0,0 +1 @@ +<?php return array('ᾈ'=>'á¾€','ᾉ'=>'á¾','ᾊ'=>'ᾂ','ᾋ'=>'ᾃ','ᾌ'=>'ᾄ','á¾'=>'á¾…','ᾎ'=>'ᾆ','á¾'=>'ᾇ','ᾘ'=>'á¾','á¾™'=>'ᾑ','ᾚ'=>'á¾’','á¾›'=>'ᾓ','ᾜ'=>'á¾”','á¾'=>'ᾕ','ᾞ'=>'á¾–','ᾟ'=>'á¾—','ᾨ'=>'á¾ ','ᾩ'=>'ᾡ','ᾪ'=>'á¾¢','ᾫ'=>'á¾£','ᾬ'=>'ᾤ','á¾'=>'á¾¥','á¾®'=>'ᾦ','ᾯ'=>'á¾§','á¾¼'=>'á¾³','ῌ'=>'ῃ','ῼ'=>'ῳ');
\ No newline at end of file diff --git a/phpBB/includes/utf/utf_normalizer.php b/phpBB/includes/utf/utf_normalizer.php index 0b567fad6b..0d1d74539a 100644 --- a/phpBB/includes/utf/utf_normalizer.php +++ b/phpBB/includes/utf/utf_normalizer.php @@ -27,148 +27,20 @@ define('UTF8_CJK_LAST', "\xE9\xBE\xBB"); define('UTF8_CJK_B_FIRST', "\xF0\xA0\x80\x80"); define('UTF8_CJK_B_LAST', "\xF0\xAA\x9B\x96"); - -if (function_exists('utf8_normalize')) -{ - -//////////////////////////////////////////////////////////////////////////////// -// Wrapper for the utfnormal extension, ICU wrapper // -//////////////////////////////////////////////////////////////////////////////// - -define('UNORM_NONE', 1); -define('UNORM_NFD', 2); -define('UNORM_NFKD', 3); -define('UNORM_NFC', 4); -define('UNORM_NFKC', 5); -define('UNORM_FCD', 6); -define('UNORM_DEFAULT', UNORM_NFC); - -/** -* utf_normalizer class for the utfnormal extension -* -* @ignore -*/ -class utf_normalizer -{ - function cleanup($str) - { - /** - * The string below is the list of all autorized characters, sorted by - * frequency in latin text - */ - $pos = strspn( - $str, - "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x0D" - ); - - if (!isset($str[$pos])) - { - /** - * ASCII strings with no special chars return immediately - */ - return $str; - } - - /** - * Check if there is potentially a U+FFFE or U+FFFF char (UTF sequence - * 0xEFBFBE or 0xEFBFBF) and replace them - * - * Note: we start searching at position $pos - */ - if (is_int(strpos($str, "\xEF\xBF", $pos))) - { - $str = str_replace( - array("\xEF\xBF\xBE", "\xEF\xBF\xBF"), - array(UTF8_REPLACEMENT, UTF8_REPLACEMENT), - $str - ); - } - - /** - * Replace any byte in the range 0x00..0x1F, except for \r, \n and \t - * - * We replace those characters with a 0xFF byte, which is illegal in - * UTF-8 and will in turn be replaced with a Unicode replacement char - */ - $str = strtr( - $str, - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F", - "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" - ); - - /** - * As per the original implementation, "the UnicodeString constructor fails - * if the string ends with a head byte". Therefore, if the string ends with - * a leading byte we replace it with 0xFF, which is illegal too and will be - * replaced with a Unicode replacement character - */ - if (substr($str, -1) >= "\xC0") - { - $str[strlen($str) - 1] = "\xFF"; - } - - return utf8_normalize($str, UNORM_NFC); - } - - function nfc($str) - { - return utf8_normalize($str, UNORM_NFC); - } - - function nfkc($str) - { - return utf8_normalize($str, UNORM_NFKC); - } - - function nfd($str) - { - return utf8_normalize($str, UNORM_NFD); - } - - function nfkd($str) - { - return utf8_normalize($str, UNORM_NFKD); - } -} - -//////////////////////////////////////////////////////////////////////////////// -// End of the ICU wrapper // -//////////////////////////////////////////////////////////////////////////////// - - -} -else -{ - - -//////////////////////////////////////////////////////////////////////////////// -// This block will NOT be loaded if the utfnormal extension is // -//////////////////////////////////////////////////////////////////////////////// - -/** -* Unset global variables -*/ +// Unset global variables unset($GLOBALS['utf_jamo_index'], $GLOBALS['utf_jamo_type'], $GLOBALS['utf_nfc_qc'], $GLOBALS['utf_combining_class'], $GLOBALS['utf_canonical_comp'], $GLOBALS['utf_canonical_decomp'], $GLOBALS['utf_nfkc_qc'], $GLOBALS['utf_compatibility_decomp']); -/** -* NFC_QC and NFKC_QC values -*/ +// NFC_QC and NFKC_QC values define('UNICODE_QC_MAYBE', 0); define('UNICODE_QC_NO', 1); -/** -* Contains all the ASCII characters appearing in UTF-8, sorted by frequency -*/ +// Contains all the ASCII characters appearing in UTF-8, sorted by frequency define('UTF8_ASCII_RANGE', "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"); -/** -* Contains all the tail bytes that can appear in the composition of a UTF-8 char -*/ +// Contains all the tail bytes that can appear in the composition of a UTF-8 char define('UTF8_TRAILING_BYTES', "\xA9\xA0\xA8\x80\xAA\x99\xA7\xBB\xAB\x89\x94\x82\xB4\xA2\xAE\x83\xB0\xB9\xB8\x93\xAF\xBC\xB3\x81\xA4\xB2\x9C\xA1\xB5\xBE\xBD\xBA\x98\xAD\xB1\x84\x95\xA6\xB6\x88\x8D\x90\xB7\xBF\x92\x85\xA5\x97\x8C\x86\xA3\x8E\x9F\x8F\x87\x91\x9D\xAC\x9E\x8B\x96\x9B\x8A\x9A"); -/** -* Constants used by the Hangul [de]composition algorithms -*/ +// Constants used by the Hangul [de]composition algorithms define('UNICODE_HANGUL_SBASE', 0xAC00); define('UNICODE_HANGUL_LBASE', 0x1100); define('UNICODE_HANGUL_VBASE', 0x1161); @@ -185,7 +57,7 @@ define('UNICODE_JAMO_T', 2); /** * Unicode normalization routines * -* @package phpBB3 +* @package phpBB3 */ class utf_normalizer { @@ -200,37 +72,25 @@ class utf_normalizer */ function cleanup($str) { - /** - * The string below is the list of all autorized characters, sorted by - * frequency in latin text - */ + // The string below is the list of all autorized characters, sorted by frequency in latin text $pos = strspn($str, "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x0D"); $len = strlen($str); if ($pos == $len) { - /** - * ASCII strings with no special chars return immediately - */ + // ASCII strings with no special chars return immediately return $str; } - /** - * Note: we do not check for $GLOBALS['utf_canonical_decomp']. It is assumed - * they are always loaded together - */ + // Note: we do not check for $GLOBALS['utf_canonical_decomp']. It is assumed they are always loaded together if (!isset($GLOBALS['utf_nfc_qc'])) { global $phpbb_root_path, $phpEx; include($phpbb_root_path . 'includes/utf/data/utf_nfc_qc.' . $phpEx); } - /** - * Replace any byte in the range 0x00..0x1F, except for \r, \n and \t - * - * We replace those characters with a 0xFF byte, which is illegal in - * UTF-8 and will in turn be replaced with a UTF replacement char - */ + // Replace any byte in the range 0x00..0x1F, except for \r, \n and \t + // We replace those characters with a 0xFF byte, which is illegal in UTF-8 and will in turn be replaced with a UTF replacement char return utf_normalizer::recompose( strtr( $str, @@ -254,9 +114,7 @@ class utf_normalizer if ($pos == $len) { - /** - * ASCII strings return immediately - */ + // ASCII strings return immediately return $str; } @@ -282,9 +140,7 @@ class utf_normalizer if ($pos == $len) { - /** - * ASCII strings return immediately - */ + // ASCII strings return immediately return $str; } @@ -293,6 +149,7 @@ class utf_normalizer global $phpbb_root_path, $phpEx; include($phpbb_root_path . 'includes/utf/data/utf_nfkc_qc.' . $phpEx); } + if (!isset($GLOBALS['utf_canonical_comp'])) { global $phpbb_root_path, $phpEx; @@ -315,9 +172,7 @@ class utf_normalizer if ($pos == $len) { - /** - * ASCII strings return immediately - */ + // ASCII strings return immediately return $str; } @@ -343,9 +198,7 @@ class utf_normalizer if ($pos == $len) { - /** - * ASCII strings return immediately - */ + // ASCII strings return immediately return $str; } @@ -359,10 +212,6 @@ class utf_normalizer } - //////////////////////////////////////////////////////////////////////////// - // Internal functions // - //////////////////////////////////////////////////////////////////////////// - /** * Recompose a UTF string * @@ -379,18 +228,14 @@ class utf_normalizer { global $utf_combining_class, $utf_canonical_comp, $utf_jamo_type, $utf_jamo_index; - /** - * Load some commonly-used tables - */ + // Load some commonly-used tables if (!isset($utf_jamo_index, $utf_jamo_type, $utf_combining_class)) { global $phpbb_root_path; include($phpbb_root_path . 'includes/utf/data/utf_normalizer_common.php'); } - /** - * Buffer the last ASCII char before the UTF-8 stuff if applicable - */ + // Buffer the last ASCII char before the UTF-8 stuff if applicable $tmp = ''; $i = $tmp_pos = $last_cc = 0; @@ -403,96 +248,66 @@ class utf_normalizer $buffer = array(); } - /** - * UTF char length array - * - * This array is used to determine the length of a UTF character. Be $c the - * result of ($str[$pos] & "\xF0") --where $str is the string we're operating - * on and $pos the position of the cursor--, if $utf_len_mask[$c] does not - * exist, the byte is an ASCII char. Otherwise, if $utf_len_mask[$c] is greater - * than 0, we have a the leading byte of a multibyte character whose length is - * $utf_len_mask[$c] and if it is equal to 0, the byte is a trailing byte. - */ + // UTF char length array + // This array is used to determine the length of a UTF character. + // Be $c the result of ($str[$pos] & "\xF0") --where $str is the string we're operating on and $pos + // the position of the cursor--, if $utf_len_mask[$c] does not exist, the byte is an ASCII char. + // Otherwise, if $utf_len_mask[$c] is greater than 0, we have a the leading byte of a multibyte character + // whose length is $utf_len_mask[$c] and if it is equal to 0, the byte is a trailing byte. $utf_len_mask = array( - /** - * Leading bytes masks - */ + // Leading bytes masks "\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4, - - /** - * Trailing bytes masks - */ + // Trailing bytes masks "\x80" => 0, "\x90" => 0, "\xA0" => 0, "\xB0" => 0 ); $extra_check = array( - "\xED"=>1, "\xEF"=>1, "\xC0"=>1, "\xC1"=>1, "\xE0"=>1, "\xF0"=>1, - "\xF4"=>1, "\xF5"=>1, "\xF6"=>1, "\xF7"=>1, "\xF8"=>1, "\xF9"=>1, - "\xFA"=>1, "\xFB"=>1, "\xFC"=>1, "\xFD"=>1, "\xFE"=>1, "\xFF"=>1 + "\xED" => 1, "\xEF" => 1, "\xC0" => 1, "\xC1" => 1, "\xE0" => 1, "\xF0" => 1, + "\xF4" => 1, "\xF5" => 1, "\xF6" => 1, "\xF7" => 1, "\xF8" => 1, "\xF9" => 1, + "\xFA" => 1, "\xFB" => 1, "\xFC" => 1, "\xFD" => 1, "\xFE" => 1, "\xFF" => 1 ); $utf_validation_mask = array( - 2 => "\xE0\xC0", - 3 => "\xF0\xC0\xC0", - 4 => "\xF8\xC0\xC0\xC0" + 2 => "\xE0\xC0", + 3 => "\xF0\xC0\xC0", + 4 => "\xF8\xC0\xC0\xC0" ); $utf_validation_check = array( - 2 => "\xC0\x80", - 3 => "\xE0\x80\x80", - 4 => "\xF0\x80\x80\x80" + 2 => "\xC0\x80", + 3 => "\xE0\x80\x80", + 4 => "\xF0\x80\x80\x80" ); - //////////////////////////////////////////////////////////////////////// - // Main loop // - //////////////////////////////////////////////////////////////////////// - + // Main loop do { - //////////////////////////////////////////////////////////////////// - // STEP 0: Capture the current char and buffer it // - //////////////////////////////////////////////////////////////////// - + // STEP 0: Capture the current char and buffer it $c = $str[$pos]; $c_mask = $c & "\xF0"; if (isset($utf_len_mask[$c_mask])) { - /** - * Byte at $pos is either a leading byte or a missplaced trailing byte - */ + // Byte at $pos is either a leading byte or a missplaced trailing byte if ($utf_len = $utf_len_mask[$c_mask]) { - /** - * Capture the char - */ + // Capture the char $buffer[++$i & 7] = $utf_char = substr($str, $pos, $utf_len); - /** - * Let's find out if a thorough check is needed - */ + // Let's find out if a thorough check is needed if (isset($qc[$utf_char])) { - /** - * If the UTF char is in the qc array then it may not be in normal - * form. We do nothing here, the actual processing is below this - * "if" block - */ + // If the UTF char is in the qc array then it may not be in normal form. We do nothing here, the actual processing is below this "if" block } - elseif (isset($utf_combining_class[$utf_char])) + else if (isset($utf_combining_class[$utf_char])) { if ($utf_combining_class[$utf_char] < $last_cc) { - /** - * A combining character that is NOT canonically ordered - */ + // A combining character that is NOT canonically ordered } else { - /** - * A combining character that IS canonically ordered, skip - * to the next char - */ + // A combining character that IS canonically ordered, skip to the next char $last_cc = $utf_combining_class[$utf_char]; $pos += $utf_len; @@ -501,34 +316,26 @@ class utf_normalizer } else { - /** - * At this point, $utf_char holds a UTF char that we know - * is not a NF[K]C_QC and is not a combining character. It can - * be a singleton, a canonical composite, a replacement char or - * an even an ill-formed bunch of bytes. Let's find out - */ + // At this point, $utf_char holds a UTF char that we know is not a NF[K]C_QC and is not a combining character. + // It can be a singleton, a canonical composite, a replacement char or an even an ill-formed bunch of bytes. Let's find out $last_cc = 0; - /** - * Check that we have the correct number of trailing bytes - */ + // Check that we have the correct number of trailing bytes if (($utf_char & $utf_validation_mask[$utf_len]) != $utf_validation_check[$utf_len]) { - /** - * Current char isn't well-formed or legal: either one or - * several trailing bytes are missing, or the Unicode char - * has been encoded in a five- or six- byte sequence - */ + // Current char isn't well-formed or legal: either one or several trailing bytes are missing, or the Unicode char + // has been encoded in a five- or six- byte sequence if ($utf_char[0] >= "\xF8") { if ($utf_char[0] < "\xF8") { $trailing_bytes = 3; } - elseif ($utf_char[0] < "\xFC") + else if ($utf_char[0] < "\xFC") { $trailing_bytes = 4; } + if ($utf_char[0] > "\xFD") { $trailing_bytes = 0; @@ -552,101 +359,80 @@ class utf_normalizer if (isset($extra_check[$c])) { - switch($c) + switch ($c) { - /** - * Note: 0xED is quite common in Korean - */ + // Note: 0xED is quite common in Korean case "\xED": if ($utf_char >= "\xED\xA0\x80") { - /** - * Surrogates (U+D800..U+DFFF) are not allowed in UTF-8 - * (UTF sequence 0xEDA080..0xEDBFBF) - */ + // Surrogates (U+D800..U+DFFF) are not allowed in UTF-8 (UTF sequence 0xEDA080..0xEDBFBF) $tmp .= substr($str, $tmp_pos, $pos - $tmp_pos) . UTF8_REPLACEMENT; $pos += $utf_len; $tmp_pos = $pos; continue 2; } - break; + break; - /** - * Note: 0xEF is quite common in Japanese - */ + // Note: 0xEF is quite common in Japanese case "\xEF": if ($utf_char == "\xEF\xBF\xBE" || $utf_char == "\xEF\xBF\xBF") { - /** - * U+FFFE and U+FFFF are explicitly disallowed - * (UTF sequence 0xEFBFBE..0xEFBFBF) - */ + // U+FFFE and U+FFFF are explicitly disallowed (UTF sequence 0xEFBFBE..0xEFBFBF) $tmp .= substr($str, $tmp_pos, $pos - $tmp_pos) . UTF8_REPLACEMENT; $pos += $utf_len; $tmp_pos = $pos; continue 2; } - break; + break; case "\xC0": case "\xC1": if ($utf_char <= "\xC1\xBF") { - /** - * Overlong sequence: Unicode char U+0000..U+007F encoded as a - * double-byte UTF char - */ + // Overlong sequence: Unicode char U+0000..U+007F encoded as a double-byte UTF char $tmp .= substr($str, $tmp_pos, $pos - $tmp_pos) . UTF8_REPLACEMENT; $pos += $utf_len; $tmp_pos = $pos; continue 2; } - break; + break; case "\xE0": if ($utf_char <= "\xE0\x9F\xBF") { - /** - * Unicode char U+0000..U+07FF encoded in 3 bytes - */ + // Unicode char U+0000..U+07FF encoded in 3 bytes $tmp .= substr($str, $tmp_pos, $pos - $tmp_pos) . UTF8_REPLACEMENT; $pos += $utf_len; $tmp_pos = $pos; continue 2; } - break; + break; case "\xF0": if ($utf_char <= "\xF0\x8F\xBF\xBF") { - /** - * Unicode char U+0000..U+FFFF encoded in 4 bytes - */ + // Unicode char U+0000..U+FFFF encoded in 4 bytes $tmp .= substr($str, $tmp_pos, $pos - $tmp_pos) . UTF8_REPLACEMENT; $pos += $utf_len; $tmp_pos = $pos; continue 2; } - break; + break; default: - /** - * Five- and six- byte sequences do not need being checked for here anymore - */ + // Five- and six- byte sequences do not need being checked for here anymore if ($utf_char > UTF8_MAX) { - /** - * Out of the Unicode range - */ + // Out of the Unicode range if ($utf_char[0] < "\xF8") { $trailing_bytes = 3; } - elseif ($utf_char[0] < "\xFC") + else if ($utf_char[0] < "\xFC") { $trailing_bytes = 4; } - elseif ($utf_char[0] > "\xFD") + else if ($utf_char[0] > "\xFD") { $trailing_bytes = 0; } @@ -660,23 +446,19 @@ class utf_normalizer $tmp_pos = $pos; continue 2; } + break; } } - /** - * The char is a valid starter, move the cursor and go on - */ + // The char is a valid starter, move the cursor and go on $pos += $utf_len; continue; } } else { - /** - * A trailing byte came out of nowhere, we will advance the cursor - * and treat the this byte and all following trailing bytes as if - * each of them was a Unicode replacement char - */ + // A trailing byte came out of nowhere, we will advance the cursor and treat the this byte and all following trailing bytes as if + // each of them was a Unicode replacement char $spn = strspn($str, UTF8_TRAILING_BYTES, $pos); $tmp .= substr($str, $tmp_pos, $pos - $tmp_pos) . str_repeat(UTF8_REPLACEMENT, $spn); @@ -686,26 +468,20 @@ class utf_normalizer } - //////////////////////////////////////////////////////////////////// - // STEP 1: Decompose current char // - //////////////////////////////////////////////////////////////////// - - /** - * We have found a character that is either: - * - in the NFC_QC/NFKC_QC list - * - a non-starter char that is not canonically ordered - * - * We are going to capture the shortest UTF sequence that satisfies - * these two conditions: - * - * 1 - If the sequence does not start at the begginning of the string, - * it must begin with a starter, and that starter must not have the - * NF[K]C_QC property equal to "MAYBE" - * - * 2 - If the sequence does not end at the end of the string, it must end - * with a non-starter and be immediately followed by a starter that - * is not on the QC list - */ + // STEP 1: Decompose current char + + // We have found a character that is either: + // - in the NFC_QC/NFKC_QC list + // - a non-starter char that is not canonically ordered + // + // We are going to capture the shortest UTF sequence that satisfies these two conditions: + // + // 1 - If the sequence does not start at the begginning of the string, it must begin with a starter, + // and that starter must not have the NF[K]C_QC property equal to "MAYBE" + // + // 2 - If the sequence does not end at the end of the string, it must end with a non-starter and be + // immediately followed by a starter that is not on the QC list + // $utf_seq = array(); $last_cc = 0; $lpos = $pos; @@ -715,6 +491,7 @@ class utf_normalizer { $_pos = 0; $_len = strlen($decomp_map[$utf_char]); + do { $_utf_len =& $utf_len_mask[$decomp_map[$utf_char][$_pos] & "\xF0"]; @@ -730,59 +507,46 @@ class utf_normalizer ++$_pos; } } - while($_pos < $_len); + while ($_pos < $_len); } else { - /** - * The char is not decomposable - */ + // The char is not decomposable $utf_seq = array($utf_char); } - //////////////////////////////////////////////////////////////// - // STEP 2: Capture the starter // - //////////////////////////////////////////////////////////////// + // STEP 2: Capture the starter - /** - * Check out the combining class of the first character of the UTF sequence - */ + // Check out the combining class of the first character of the UTF sequence $k = 0; if (isset($utf_combining_class[$utf_seq[0]]) || $qc[$utf_char] == UNICODE_QC_MAYBE) { - /** - * Not a starter, inspect previous characters - * - * The last 8 characters are kept in a buffer so that we don't have - * to capture them everytime. This is enough for all real-life strings - * but even if it wasn't, we can capture characters in backward mode, - * although it is slower than this method. - * - * In the following loop, $j starts at the previous buffered character - * ($i - 1, because current character is at offset $i) and process them - * in backward mode until we find a starter. - * - * $k is the index on each UTF character inside of our UTF sequence. - * At this time, $utf_seq contains one or more characters numbered 0 to - * n. $k starts at 0 and for each char we prepend we pre-decrement it - * and for numbering - */ + // Not a starter, inspect previous characters + // The last 8 characters are kept in a buffer so that we don't have to capture them everytime. + // This is enough for all real-life strings but even if it wasn't, we can capture characters in backward mode, + // although it is slower than this method. + // + // In the following loop, $j starts at the previous buffered character ($i - 1, because current character is + // at offset $i) and process them in backward mode until we find a starter. + // + // $k is the index on each UTF character inside of our UTF sequence. At this time, $utf_seq contains one or more + // characters numbered 0 to n. $k starts at 0 and for each char we prepend we pre-decrement it and for numbering $starter_found = 0; $j_min = max(1, $i - 7); - for($j = $i - 1; $j >= $j_min && $lpos > $tmp_pos; --$j) + + for ($j = $i - 1; $j >= $j_min && $lpos > $tmp_pos; --$j) { $utf_char = $buffer[$j & 7]; $lpos -= strlen($utf_char); if (isset($decomp_map[$utf_char])) { - /** - * The char is a composite, decompose for storage - */ + // The char is a composite, decompose for storage $decomp_seq = array(); $_pos = 0; $_len = strlen($decomp_map[$utf_char]); + do { $c = $decomp_map[$utf_char][$_pos]; @@ -799,18 +563,15 @@ class utf_normalizer ++$_pos; } } - while($_pos < $_len); + while ($_pos < $_len); - /** - * Prepend the UTF sequence with our decomposed sequence - */ + // Prepend the UTF sequence with our decomposed sequence if (isset($decomp_seq[1])) { - /** - * The char expanded into several chars - */ - $decomp_cnt = count($decomp_seq); - foreach($decomp_seq as $decomp_i => $decomp_char) + // The char expanded into several chars + $decomp_cnt = sizeof($decomp_seq); + + foreach ($decomp_seq as $decomp_i => $decomp_char) { $utf_seq[$k + $decomp_i - $decomp_cnt] = $decomp_char; } @@ -818,9 +579,7 @@ class utf_normalizer } else { - /** - * Decomposed to a single char, easier to prepend - */ + // Decomposed to a single char, easier to prepend $utf_seq[--$k] = $decomp_seq[0]; } } @@ -831,9 +590,7 @@ class utf_normalizer if (!isset($utf_combining_class[$utf_seq[$k]])) { - /** - * We have found our starter - */ + // We have found our starter $starter_found = 1; break; } @@ -841,39 +598,28 @@ class utf_normalizer if (!$starter_found && $lpos > $tmp_pos) { - /** - * The starter was not found in the buffer, let's rewind some more - */ + // The starter was not found in the buffer, let's rewind some more do { - /** - * $utf_len_mask contains the masks of both leading bytes and - * trailing bytes. If $utf_en > 0 then it's a leading byte, - * otherwise it's a trailing byte. - */ + // $utf_len_mask contains the masks of both leading bytes and trailing bytes. If $utf_en > 0 then it's a leading byte, otherwise it's a trailing byte. $c = $str[--$lpos]; $c_mask = $c & "\xF0"; if (isset($utf_len_mask[$c_mask])) { - /** - * UTF byte - */ + // UTF byte if ($utf_len = $utf_len_mask[$c_mask]) { - /** - * UTF *leading* byte - */ + // UTF *leading* byte $utf_char = substr($str, $lpos, $utf_len); if (isset($decomp_map[$utf_char])) { - /** - * Decompose the character - */ + // Decompose the character $decomp_seq = array(); $_pos = 0; $_len = strlen($decomp_map[$utf_char]); + do { $c = $decomp_map[$utf_char][$_pos]; @@ -890,18 +636,14 @@ class utf_normalizer ++$_pos; } } - while($_pos < $_len); + while ($_pos < $_len); - /** - * Prepend the UTF sequence with our decomposed sequence - */ + // Prepend the UTF sequence with our decomposed sequence if (isset($decomp_seq[1])) { - /** - * The char expanded into several chars - */ - $decomp_cnt = count($decomp_seq); - foreach($decomp_seq as $decomp_i => $utf_char) + // The char expanded into several chars + $decomp_cnt = sizeof($decomp_seq); + foreach ($decomp_seq as $decomp_i => $utf_char) { $utf_seq[$k + $decomp_i - $decomp_cnt] = $utf_char; } @@ -909,9 +651,7 @@ class utf_normalizer } else { - /** - * Decomposed to a single char, easier to prepend - */ + // Decomposed to a single char, easier to prepend $utf_seq[--$k] = $decomp_seq[0]; } } @@ -923,22 +663,18 @@ class utf_normalizer } else { - /** - * ASCII char - */ + // ASCII char $utf_seq[--$k] = $c; } } - while($lpos > $tmp_pos); + while ($lpos > $tmp_pos); } } - //////////////////////////////////////////////////////////////// - // STEP 3: Capture following combining modifiers // - //////////////////////////////////////////////////////////////// + // STEP 3: Capture following combining modifiers - while($pos < $len) + while ($pos < $len) { $c_mask = $str[$pos] & "\xF0"; @@ -950,29 +686,21 @@ class utf_normalizer } else { - /** - * A trailing byte came out of nowhere - * - * Trailing bytes are replaced with Unicode replacement chars, - * we will just ignore it for now, break out of the loop - * as if it was a starter (replacement chars ARE starters) - * and let the next loop replace it - */ + // A trailing byte came out of nowhere + // Trailing bytes are replaced with Unicode replacement chars, we will just ignore it for now, break out of the loop + // as if it was a starter (replacement chars ARE starters) and let the next loop replace it break; } if (isset($utf_combining_class[$utf_char]) || isset($qc[$utf_char])) { - /** - * Combining character, add it to the sequence and move the cursor - */ + // Combining character, add it to the sequence and move the cursor if (isset($decomp_map[$utf_char])) { - /** - * Decompose the character - */ + // Decompose the character $_pos = 0; $_len = strlen($decomp_map[$utf_char]); + do { $c = $decomp_map[$utf_char][$_pos]; @@ -989,7 +717,7 @@ class utf_normalizer ++$_pos; } } - while($_pos < $_len); + while ($_pos < $_len); } else { @@ -1000,54 +728,38 @@ class utf_normalizer } else { - /** - * Combining class 0 and no QC, break out of the loop - * - * Note: we do not know if that character is valid. If - * it's not, the next iteration will replace it - */ + // Combining class 0 and no QC, break out of the loop + // Note: we do not know if that character is valid. If it's not, the next iteration will replace it break; } } else { - /** - * ASCII chars are starters - */ + // ASCII chars are starters break; } } - //////////////////////////////////////////////////////////////// - // STEP 4: Sort and combine // - //////////////////////////////////////////////////////////////// + // STEP 4: Sort and combine + + // Here we sort... + $k_max = $k + sizeof($utf_seq); - /** - * Here we sort... - */ - $k_max = $k + count($utf_seq); if (!$k && $k_max == 1) { - /** - * There is only one char in the UTF sequence, add it then - * jump to the next iteration of main loop - * - * Note: the two commented lines below can be enabled under PHP5 - * for a very small performance gain in most cases - */ -// if (substr_compare($str, $utf_seq[0], $lpos, $pos - $lpos)) -// { + // There is only one char in the UTF sequence, add it then jump to the next iteration of main loop + // Note: the two commented lines below can be enabled under PHP5 for a very small performance gain in most cases +// if (substr_compare($str, $utf_seq[0], $lpos, $pos - $lpos)) +// { $tmp .= substr($str, $tmp_pos, $lpos - $tmp_pos) . $utf_seq[0]; $tmp_pos = $pos; -// } +// } continue; } - /** - * ...there we combine - */ + // ...there we combine if (isset($utf_combining_class[$utf_seq[$k]])) { $starter = $nf_seq = ''; @@ -1059,11 +771,8 @@ class utf_normalizer } $utf_sort = array(); - /** - * We add an empty char at the end of the UTF char sequence. - * It will act as a starter and trigger the sort/combine routine - * at the end of the string without altering it - */ + // We add an empty char at the end of the UTF char sequence. It will act as a starter and trigger the sort/combine routine + // at the end of the string without altering it $utf_seq[] = ''; do @@ -1078,45 +787,27 @@ class utf_normalizer { if (empty($utf_sort)) { - /** - * No combining characters... check for a composite - * of the two starters - */ + // No combining characters... check for a composite of the two starters if (isset($utf_canonical_comp[$starter . $utf_char])) { - /** - * Good ol' composite character - */ + // Good ol' composite character $starter = $utf_canonical_comp[$starter . $utf_char]; } - elseif (isset($utf_jamo_type[$utf_char])) + else if (isset($utf_jamo_type[$utf_char])) { - /** - * Current char is a composable jamo - */ - if (isset($utf_jamo_type[$starter]) - && $utf_jamo_type[$starter] == UNICODE_JAMO_L - && $utf_jamo_type[$utf_char] == UNICODE_JAMO_V) + // Current char is a composable jamo + if (isset($utf_jamo_type[$starter]) && $utf_jamo_type[$starter] == UNICODE_JAMO_L && $utf_jamo_type[$utf_char] == UNICODE_JAMO_V) { - /** - * We have a L jamo followed by a V jamo, we are going - * to prefetch the next char to see if it's a T jamo - */ + // We have a L jamo followed by a V jamo, we are going to prefetch the next char to see if it's a T jamo if (isset($utf_jamo_type[$utf_seq[$k]]) && $utf_jamo_type[$utf_seq[$k]] == UNICODE_JAMO_T) { - /** - * L+V+T jamos, combine to a LVT Hangul syllable - * ($k is incremented) - */ + // L+V+T jamos, combine to a LVT Hangul syllable ($k is incremented) $cp = $utf_jamo_index[$starter] + $utf_jamo_index[$utf_char] + $utf_jamo_index[$utf_seq[$k]]; - ++$k; } else { - /** - * L+V jamos, combine to a LV Hangul syllable - */ + // L+V jamos, combine to a LV Hangul syllable $cp = $utf_jamo_index[$starter] + $utf_jamo_index[$utf_char]; } @@ -1124,19 +815,14 @@ class utf_normalizer } else { - /** - * Non-composable jamo, just add it to the sequence - */ + // Non-composable jamo, just add it to the sequence $nf_seq .= $starter; $starter = $utf_char; } } else { - /** - * No composite, just add the first starter to the sequence - * then continue with the other one - */ + // No composite, just add the first starter to the sequence then continue with the other one $nf_seq .= $starter; $starter = $utf_char; } @@ -1145,44 +831,33 @@ class utf_normalizer { ksort($utf_sort); - /** - * For each class of combining characters - */ - foreach($utf_sort as $cc => $utf_chars) + // For each class of combining characters + foreach ($utf_sort as $cc => $utf_chars) { $j = 0; do { - /** - * Look for a composite - */ + // Look for a composite if (isset($utf_canonical_comp[$starter . $utf_chars[$j]])) { - /** - * Found a composite, replace the starter - */ + // Found a composite, replace the starter $starter = $utf_canonical_comp[$starter . $utf_chars[$j]]; unset($utf_sort[$cc][$j]); } else { - /** - * No composite, all following characters in that - * class are blocked - */ + // No composite, all following characters in that class are blocked break; } } - while(isset($utf_sort[$cc][++$j])); + while (isset($utf_sort[$cc][++$j])); } - /** - * Add the starter to the normalized sequence, followed by - * non-starters in canonical order - */ + // Add the starter to the normalized sequence, followed by non-starters in canonical order $nf_seq .= $starter; - foreach($utf_sort as $utf_chars) + + foreach ($utf_sort as $utf_chars) { if (!empty($utf_chars)) { @@ -1190,31 +865,25 @@ class utf_normalizer } } - /** - * Reset the array and go on - */ + // Reset the array and go on $utf_sort = array(); $starter = $utf_char; } } } - while($k <= $k_max); + while ($k <= $k_max); $tmp .= substr($str, $tmp_pos, $lpos - $tmp_pos) . $nf_seq; $tmp_pos = $pos; } else { - /** - * Only a ASCII char can make the program get here - * - * First we skip the current byte with ++$pos, then we quickly - * skip following ASCII chars with strspn(). - * - * The first two "if"'s here can be removed, with the consequences - * of being faster on latin text (lots of ASCII) and slower on - * multi-byte text (where the only ASCII chars are spaces and punctuation) - */ + // Only a ASCII char can make the program get here + // + // First we skip the current byte with ++$pos, then we quickly skip following ASCII chars with strspn(). + // + // The first two "if"'s here can be removed, with the consequences of being faster on latin text (lots of ASCII) and slower on + // multi-byte text (where the only ASCII chars are spaces and punctuation) if (++$pos != $len) { if ($str[$pos] < "\x80") @@ -1229,37 +898,25 @@ class utf_normalizer } } } - while($pos < $len); + while ($pos < $len); - /** - * Now is time to return the string - */ + // Now is time to return the string if ($tmp_pos) { - /** - * If the $tmp_pos cursor is not at the beggining of the string then at least - * one character was not in normal form. Replace $str with the fixed version - */ + // If the $tmp_pos cursor is not at the beggining of the string then at least one character was not in normal form. Replace $str with the fixed version if ($tmp_pos == $len) { - /** - * The $tmp_pos cursor is at the end of $str, therefore $tmp holds the - * whole $str - */ + // The $tmp_pos cursor is at the end of $str, therefore $tmp holds the whole $str return $tmp; } else { - /** - * The rightmost chunk of $str has not been appended to $tmp yet - */ + // The rightmost chunk of $str has not been appended to $tmp yet return $tmp . substr($str, $tmp_pos); } } - /** - * The string was already in normal form - */ + // The string was already in normal form return $str; } @@ -1278,56 +935,42 @@ class utf_normalizer { global $utf_combining_class, $utf_canonical_decomp, $phpbb_root_path; - /** - * Load some commonly-used tables - */ + // Load some commonly-used tables if (!isset($utf_combining_class)) { include($phpbb_root_path . 'includes/utf/data/utf_normalizer_common.php'); } - /** - * UTF char length array - */ + // UTF char length array $utf_len_mask = array( - /** - * Leading bytes masks - */ + // Leading bytes masks "\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4, - - /** - * Trailing bytes masks - */ + // Trailing bytes masks "\x80" => 0, "\x90" => 0, "\xA0" => 0, "\xB0" => 0 ); - /** - * Some extra checks are triggered on the first byte of a UTF sequence - */ + // Some extra checks are triggered on the first byte of a UTF sequence $extra_check = array( - "\xED"=>1, "\xEF"=>1, "\xC0"=>1, "\xC1"=>1, "\xE0"=>1, "\xF0"=>1, - "\xF4"=>1, "\xF5"=>1, "\xF6"=>1, "\xF7"=>1, "\xF8"=>1, "\xF9"=>1, - "\xFA"=>1, "\xFB"=>1, "\xFC"=>1, "\xFD"=>1, "\xFE"=>1, "\xFF"=>1 + "\xED" => 1, "\xEF" => 1, "\xC0" => 1, "\xC1" => 1, "\xE0" => 1, "\xF0" => 1, + "\xF4" => 1, "\xF5" => 1, "\xF6" => 1, "\xF7" => 1, "\xF8" => 1, "\xF9" => 1, + "\xFA" => 1, "\xFB" => 1, "\xFC" => 1, "\xFD" => 1, "\xFE" => 1, "\xFF" => 1 ); - /** - * These masks are used to check if a UTF sequence is well formed. - * Here are the only 3 lengths we acknowledge: - * - 2-byte: 110? ???? 10?? ???? - * - 3-byte: 1110 ???? 10?? ???? 10?? ???? - * - 4-byte: 1111 0??? 10?? ???? 10?? ???? 10?? ???? - * - * Note that 5- and 6- byte sequences are automatically discarded - */ + // These masks are used to check if a UTF sequence is well formed. Here are the only 3 lengths we acknowledge: + // - 2-byte: 110? ???? 10?? ???? + // - 3-byte: 1110 ???? 10?? ???? 10?? ???? + // - 4-byte: 1111 0??? 10?? ???? 10?? ???? 10?? ???? + // Note that 5- and 6- byte sequences are automatically discarded $utf_validation_mask = array( - 2 => "\xE0\xC0", - 3 => "\xF0\xC0\xC0", - 4 => "\xF8\xC0\xC0\xC0" + 2 => "\xE0\xC0", + 3 => "\xF0\xC0\xC0", + 4 => "\xF8\xC0\xC0\xC0" ); + $utf_validation_check = array( - 2 => "\xC0\x80", - 3 => "\xE0\x80\x80", - 4 => "\xF0\x80\x80\x80" + 2 => "\xC0\x80", + 3 => "\xE0\x80\x80", + 4 => "\xF0\x80\x80\x80" ); $tmp = ''; @@ -1336,43 +979,31 @@ class utf_normalizer $utf_sort = array(); - //////////////////////////////////////////////////////////////////////// - // Main loop // - //////////////////////////////////////////////////////////////////////// - + // Main loop do { - //////////////////////////////////////////////////////////////////// - // STEP 0: Capture the current char // - //////////////////////////////////////////////////////////////////// + // STEP 0: Capture the current char $cur_mask = $str[$pos] & "\xF0"; if (isset($utf_len_mask[$cur_mask])) { if ($utf_len = $utf_len_mask[$cur_mask]) { - /** - * Multibyte char - */ + // Multibyte char $utf_char = substr($str, $pos, $utf_len); $pos += $utf_len; } else { - /** - * A trailing byte came out of nowhere, we will treat it and all - * following trailing bytes as if each of them was a Unicode - * replacement char and we will advance the cursor - */ + // A trailing byte came out of nowhere, we will treat it and all following trailing bytes as if each of them was a Unicode + // replacement char and we will advance the cursor $spn = strspn($str, UTF8_TRAILING_BYTES, $pos); if ($dump) { $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos); - /** - * Dump combiners - */ + // Dump combiners if (!empty($utf_sort)) { if ($sort) @@ -1404,21 +1035,15 @@ class utf_normalizer } - //////////////////////////////////////////////////////////////////// - // STEP 1: Decide what to do with current char // - //////////////////////////////////////////////////////////////////// + // STEP 1: Decide what to do with current char - /** - * Now, in that order: - * - check if that character is decomposable - * - check if that character is a non-starter - * - check if that character requires extra checks to be performed - */ + // Now, in that order: + // - check if that character is decomposable + // - check if that character is a non-starter + // - check if that character requires extra checks to be performed if (isset($decomp_map[$utf_char])) { - /** - * Decompose the char - */ + // Decompose the char $_pos = 0; $_len = strlen($decomp_map[$utf_char]); @@ -1434,16 +1059,12 @@ class utf_normalizer if (isset($utf_combining_class[$_utf_char])) { - /** - * The character decomposed to a non-starter, buffer it for sorting - */ + // The character decomposed to a non-starter, buffer it for sorting $utf_sort[$utf_combining_class[$_utf_char]][] = $_utf_char; if ($utf_combining_class[$_utf_char] < $last_cc) { - /** - * Not canonically ordered, will require sorting - */ + // Not canonically ordered, will require sorting $sort = $dump = 1; } else @@ -1454,17 +1075,12 @@ class utf_normalizer } else { - /** - * This character decomposition contains a starter, - * dump the buffer and continue - */ + // This character decomposition contains a starter, dump the buffer and continue if ($dump) { $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos); - /** - * Dump combiners - */ + // Dump combiners if (!empty($utf_sort)) { if ($sort) @@ -1472,7 +1088,7 @@ class utf_normalizer ksort($utf_sort); } - foreach($utf_sort as $utf_chars) + foreach ($utf_sort as $utf_chars) { $tmp .= implode('', $utf_chars); } @@ -1493,18 +1109,14 @@ class utf_normalizer } else { - /** - * This character decomposition contains an ASCII char, - * which is a starter. Dump the buffer and continue - */ + // This character decomposition contains an ASCII char, which is a starter. Dump the buffer and continue ++$_pos; + if ($dump) { $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos); - /** - * Dump combiners - */ + // Dump combiners if (!empty($utf_sort)) { if ($sort) @@ -1512,7 +1124,7 @@ class utf_normalizer ksort($utf_sort); } - foreach($utf_sort as $utf_chars) + foreach ($utf_sort as $utf_chars) { $tmp .= implode('', $utf_chars); } @@ -1531,18 +1143,14 @@ class utf_normalizer $last_cc = 0; } } - while($_pos < $_len); + while ($_pos < $_len); } - elseif (isset($utf_combining_class[$utf_char])) + else if (isset($utf_combining_class[$utf_char])) { - /** - * Combining character - */ + // Combining character if ($utf_combining_class[$utf_char] < $last_cc) { - /** - * Not in canonical order - */ + // Not in canonical order $sort = $dump = 1; } else @@ -1554,24 +1162,15 @@ class utf_normalizer } else { - /** - * Non-decomposable starter, check out if it's a Hangul syllable - */ + // Non-decomposable starter, check out if it's a Hangul syllable if ($utf_char < UTF8_HANGUL_FIRST || $utf_char > UTF8_HANGUL_LAST) { - /** - * Nope, regular UTF char, check that we have the correct number of trailing bytes - */ + // Nope, regular UTF char, check that we have the correct number of trailing bytes if (($utf_char & $utf_validation_mask[$utf_len]) != $utf_validation_check[$utf_len]) { - /** - * Current char isn't well-formed or legal: either one or - * several trailing bytes are missing, or the Unicode char - * has been encoded in a five- or six- byte sequence. - * - * Move the cursor back to its original position then advance - * it to the position it should really be at - */ + // Current char isn't well-formed or legal: either one or several trailing bytes are missing, or the Unicode char + // has been encoded in a five- or six- byte sequence. + // Move the cursor back to its original position then advance it to the position it should really be at $pos -= $utf_len; $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos); @@ -1579,20 +1178,16 @@ class utf_normalizer { ksort($utf_sort); - foreach($utf_sort as $utf_chars) + foreach ($utf_sort as $utf_chars) { $tmp .= implode('', $utf_chars); } $utf_sort = array(); } - /** - * Add a replacement char then another replacement char for - * every trailing byte. - * - * @todo I'm not entirely sure that's how we're supposed to - * mark invalidated byte sequences, check this - */ + // Add a replacement char then another replacement char for every trailing byte. + // + // @todo I'm not entirely sure that's how we're supposed to mark invalidated byte sequences, check this $spn = strspn($str, UTF8_TRAILING_BYTES, ++$pos); $tmp .= str_repeat(UTF8_REPLACEMENT, $spn + 1); @@ -1605,25 +1200,20 @@ class utf_normalizer if (isset($extra_check[$utf_char[0]])) { - switch($utf_char[0]) + switch ($utf_char[0]) { - /** - * Note: 0xED is quite common in Korean - */ + // Note: 0xED is quite common in Korean case "\xED": if ($utf_char >= "\xED\xA0\x80") { - /** - * Surrogates (U+D800..U+DFFF) are not allowed in UTF-8 - * (UTF sequence 0xEDA080..0xEDBFBF) - */ + // Surrogates (U+D800..U+DFFF) are not allowed in UTF-8 (UTF sequence 0xEDA080..0xEDBFBF) $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos); if (!empty($utf_sort)) { ksort($utf_sort); - foreach($utf_sort as $utf_chars) + foreach ($utf_sort as $utf_chars) { $tmp .= implode('', $utf_chars); } @@ -1636,25 +1226,20 @@ class utf_normalizer $tmp_pos = $starter_pos = $pos; continue 2; } - break; + break; - /** - * Note: 0xEF is quite common in Japanese - */ + // Note: 0xEF is quite common in Japanese case "\xEF": if ($utf_char == "\xEF\xBF\xBE" || $utf_char == "\xEF\xBF\xBF") { - /** - * U+FFFE and U+FFFF are explicitly disallowed - * (UTF sequence 0xEFBFBE..0xEFBFBF) - */ + // U+FFFE and U+FFFF are explicitly disallowed (UTF sequence 0xEFBFBE..0xEFBFBF) $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos); if (!empty($utf_sort)) { ksort($utf_sort); - foreach($utf_sort as $utf_chars) + foreach ($utf_sort as $utf_chars) { $tmp .= implode('', $utf_chars); } @@ -1667,23 +1252,20 @@ class utf_normalizer $tmp_pos = $starter_pos = $pos; continue 2; } - break; + break; case "\xC0": case "\xC1": if ($utf_char <= "\xC1\xBF") { - /** - * Overlong sequence: Unicode char U+0000..U+007F encoded as a - * double-byte UTF char - */ + // Overlong sequence: Unicode char U+0000..U+007F encoded as a double-byte UTF char $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos); if (!empty($utf_sort)) { ksort($utf_sort); - foreach($utf_sort as $utf_chars) + foreach ($utf_sort as $utf_chars) { $tmp .= implode('', $utf_chars); } @@ -1696,21 +1278,19 @@ class utf_normalizer $tmp_pos = $starter_pos = $pos; continue 2; } - break; + break; case "\xE0": if ($utf_char <= "\xE0\x9F\xBF") { - /** - * Unicode char U+0000..U+07FF encoded in 3 bytes - */ + // Unicode char U+0000..U+07FF encoded in 3 bytes $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos); if (!empty($utf_sort)) { ksort($utf_sort); - foreach($utf_sort as $utf_chars) + foreach ($utf_sort as $utf_chars) { $tmp .= implode('', $utf_chars); } @@ -1723,21 +1303,19 @@ class utf_normalizer $tmp_pos = $starter_pos = $pos; continue 2; } - break; + break; case "\xF0": if ($utf_char <= "\xF0\x8F\xBF\xBF") { - /** - * Unicode char U+0000..U+FFFF encoded in 4 bytes - */ + // Unicode char U+0000..U+FFFF encoded in 4 bytes $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos); if (!empty($utf_sort)) { ksort($utf_sort); - foreach($utf_sort as $utf_chars) + foreach ($utf_sort as $utf_chars) { $tmp .= implode('', $utf_chars); } @@ -1750,21 +1328,19 @@ class utf_normalizer $tmp_pos = $starter_pos = $pos; continue 2; } - break; + break; default: if ($utf_char > UTF8_MAX) { - /** - * Out of the Unicode range - */ + // Out of the Unicode range $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos); if (!empty($utf_sort)) { ksort($utf_sort); - foreach($utf_sort as $utf_chars) + foreach ($utf_sort as $utf_chars) { $tmp .= implode('', $utf_chars); } @@ -1777,25 +1353,18 @@ class utf_normalizer $tmp_pos = $starter_pos = $pos; continue 2; } + break; } } } else { - /** - * Hangul syllable - */ + // Hangul syllable $idx = (((ord($utf_char[0]) & 0x0F) << 12) | ((ord($utf_char[1]) & 0x3F) << 6) | (ord($utf_char[2]) & 0x3F)) - UNICODE_HANGUL_SBASE; - /** - * LIndex can only range from 0 to 18, therefore it cannot influence - * the first two bytes of the L Jamo, which allows us to hardcode - * them (based on LBase). - * - * The same goes for VIndex, but for TIndex there's a catch: the value - * of the third byte could exceed 0xBF and we would have to increment - * the second byte - */ + // LIndex can only range from 0 to 18, therefore it cannot influence the first two bytes of the L Jamo, which allows us to hardcode them (based on LBase). + // + // The same goes for VIndex, but for TIndex there's a catch: the value of the third byte could exceed 0xBF and we would have to increment the second byte if ($tIndex = $idx % UNICODE_HANGUL_TCOUNT) { if ($tIndex < 25) @@ -1817,24 +1386,16 @@ class utf_normalizer $utf_char[2] = chr(0x80 + (int) ($idx / UNICODE_HANGUL_NCOUNT)); $utf_char[5] = chr(0xA1 + (int) (($idx % UNICODE_HANGUL_NCOUNT) / UNICODE_HANGUL_TCOUNT)); - - /** - * Just like other decompositions, the resulting Jamos must - * be dumped to the tmp string - */ + // Just like other decompositions, the resulting Jamos must be dumped to the tmp string $dump = 1; } - /** - * Do we need to dump stuff to the tmp string? - */ + // Do we need to dump stuff to the tmp string? if ($dump) { $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos); - /** - * Dump combiners - */ + // Dump combiners if (!empty($utf_sort)) { if ($sort) @@ -1842,7 +1403,7 @@ class utf_normalizer ksort($utf_sort); } - foreach($utf_sort as $utf_chars) + foreach ($utf_sort as $utf_chars) { $tmp .= implode('', $utf_chars); } @@ -1860,16 +1421,12 @@ class utf_normalizer } else { - /** - * ASCII char, which happens to be a starter (as any other ASCII char) - */ + // ASCII char, which happens to be a starter (as any other ASCII char) if ($dump) { $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos); - /** - * Dump combiners - */ + // Dump combiners if (!empty($utf_sort)) { if ($sort) @@ -1877,7 +1434,7 @@ class utf_normalizer ksort($utf_sort); } - foreach($utf_sort as $utf_chars) + foreach ($utf_sort as $utf_chars) { $tmp .= implode('', $utf_chars); } @@ -1899,18 +1456,14 @@ class utf_normalizer $starter_pos = $pos; } } - while($pos < $len); + while ($pos < $len); - /** - * Now is time to return the string - */ + // Now is time to return the string if ($dump) { $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos); - /** - * Dump combiners - */ + // Dump combiners if (!empty($utf_sort)) { if ($sort) @@ -1918,7 +1471,7 @@ class utf_normalizer ksort($utf_sort); } - foreach($utf_sort as $utf_chars) + foreach ($utf_sort as $utf_chars) { $tmp .= implode('', $utf_chars); } @@ -1927,34 +1480,24 @@ class utf_normalizer return $tmp; } - elseif ($tmp_pos) + else if ($tmp_pos) { - /** - * If the $tmp_pos cursor was moved then at least one character was not in - * normal form. Replace $str with the fixed version - */ + // If the $tmp_pos cursor was moved then at least one character was not in normal form. Replace $str with the fixed version if ($tmp_pos == $len) { - /** - * The $tmp_pos cursor is at the end of $str, therefore $tmp holds - * the whole $str - */ + // The $tmp_pos cursor is at the end of $str, therefore $tmp holds the whole $str return $tmp; } else { - /** - * The rightmost chunk of $str has not been appended to $tmp yet - */ + // The rightmost chunk of $str has not been appended to $tmp yet return $tmp . substr($str, $tmp_pos); } } - /** - * The string was already in normal form - */ + // The string was already in normal form return $str; } } -}
\ No newline at end of file +?>
\ No newline at end of file diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index b3c3c5ed5e..b91fd51c20 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -3,42 +3,700 @@ * * @package phpBB3 * @version $Id$ -* @copyright (c) 2005 phpBB Group +* @copyright (c) 2006 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * +* @todo make sure the replacements are called correctly +* already done: strtolower, strtoupper, ucfirst, str_split, strrpos, strlen (hopefully!), strpos, substr +* remaining: clean_username, htmlentities (no longer needed for internal data?), htmlspecialchars (using charset) +* strspn, chr, ord */ /** +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * UTF-8 tools * * Whenever possible, these functions will try to use PHP's built-in functions or * extensions, otherwise they will default to custom routines. * -* If we go with UTF-8 in 3.2, we will also need a Unicode-aware replacement -* to strtolower() -* * @package phpBB3 */ +if (!extension_loaded('xml')) +{ + /** + * Implementation of PHP's native utf8_encode for people without XML support + * This function exploits some nice things that ISO-8859-1 and UTF-8 have in common + * + * @param string $str ISO-8859-1 encoded data + * @return string UTF-8 encoded data + */ + function utf8_encode($str) + { + $out = ''; + for ($i = 0, $len = strlen($str); $i < $len; $i++) + { + $letter = $str[$i]; + $num = ord($letter); + if ($num < 0x80) + { + $out .= $letter; + } + else if ($num < 0xC0) + { + $out .= "\xC2" . $letter; + } + else + { + $out .= "\xC3" . chr($num - 64); + } + } + return $out; + } + + /** + * Implementation of PHP's native utf8_decode for people without XML support + * + * @param string $string UTF-8 encoded data + * @return string ISO-8859-1 encoded data + */ + function utf8_decode($str) + { + $pos = 0; + $len = strlen($str); + $ret = ''; + + while ($pos < $len) + { + $ord = ord($str[$pos]) & 0xF0; + if ($ord === 0xC0 || $ord === 0xD0) + { + $charval = ((ord($str[$pos]) & 0x1F) << 6) | (ord($str[$pos + 1]) & 0x3F); + $pos += 2; + $ret .= (($charval < 256) ? chr($charval) : '?'); + } + else if ($ord === 0xE0) + { + $ret .= '?'; + $pos += 3; + } + else if ($ord === 0xF0) + { + $ret .= '?'; + $pos += 4; + } + else + { + $ret .= $str[$pos]; + ++$pos; + } + } + return $ret; + } +} + +// mbstring is old and has it's functions around for older versions of PHP. +// if mbstring is not loaded, we go into native mode. +if (extension_loaded('mbstring')) +{ + /** + * UTF-8 aware alternative to strrpos + * Find position of last occurrence of a char in a string + * + * Notes: + * - offset for mb_strrpos was added in 5.2.0, we emulate if it is lower + */ + if (version_compare(phpversion(), '5.2.0', '>=')) + { + /** + * UTF-8 aware alternative to strrpos + * @ignore + */ + function utf8_strrpos($str, $needle, $offset = null) + { + // Emulate behaviour of strrpos rather than raising warning + if (empty($str)) + { + return false; + } + + return mb_strrpos($str, $search); + } + } + else + { + /** + * UTF-8 aware alternative to strrpos + * @ignore + */ + function utf8_strrpos($str, $needle, $offset = null) + { + // offset for mb_strrpos was added in 5.2.0 + if ($offset === false) + { + // Emulate behaviour of strrpos rather than raising warning + if (empty($str)) + { + return false; + } + + return mb_strrpos($str, $search); + } + else + { + if (!is_int($offset)) + { + trigger_error('utf8_strrpos expects parameter 3 to be long', E_USER_WARNING); + return false; + } + + $str = mb_substr($str, $offset); + + if (false !== ($pos = mb_strrpos($str, $search))) + { + return $pos + $offset; + } + + return false; + } + } + } + + /** + * UTF-8 aware alternative to strpos + * @ignore + */ + function utf8_strpos($str, $needle, $offset = null) + { + if ($offset === false) + { + return mb_strpos($str, $needle); + } + else + { + return mb_strpos($str, $needle, $offset); + } + } + + /** + * UTF-8 aware alternative to strtolower + * @ignore + */ + function utf8_strtolower($str) + { + return mb_strtolower($str); + } + + /** + * UTF-8 aware alternative to strtoupper + * @ignore + */ + function utf8_strtoupper($str) + { + return mb_strtoupper($str); + } + + /** + * UTF-8 aware alternative to substr + * @ignore + */ + function utf8_substr($str, $offset, $length = null) + { + if ($length === false) + { + return mb_substr($str, $offset); + } + else + { + return mb_substr($str, $offset, $length); + } + } + + /** + * Return the length (in characters) of a UTF-8 string + * @ignore + */ + function utf8_strlen($text) + { + return mb_strlen($text, 'utf-8'); + } +} +else +{ + /** + * UTF-8 aware alternative to strrpos + * Find position of last occurrence of a char in a string + * + * @author Harry Fuecks + * @param string haystack + * @param string needle + * @param integer (optional) offset (from left) + * @return mixed integer position or FALSE on failure + */ + function utf8_strrpos($str, $needle, $offset = null) + { + 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 + array_pop($ar); + $str = join($needle, $ar); + + return utf8_strlen($str); + } + return false; + } + else + { + if (!is_int($offset)) + { + trigger_error('utf8_strrpos expects parameter 3 to be long', E_USER_WARNING); + return false; + } + + $str = utf8_substr($str, $offset); + + if (false !== ($pos = utf8_strrpos($str, $needle))) + { + return $pos + $offset; + } + + return false; + } + } + + /** + * UTF-8 aware alternative to strpos + * Find position of first occurrence of a string + * + * @author Harry Fuecks + * @param string haystack + * @param string needle + * @param integer offset in characters (from left) + * @return mixed integer position or FALSE on failure + */ + function utf8_strpos($str, $needle, $offset = null) + { + if (is_null($offset)) + { + $ar = explode($needle, $str); + if (sizeof($ar) > 1) + { + return utf8_strlen($ar[0]); + } + return false; + } + else + { + if (!is_int($offset)) + { + trigger_error('utf8_strpos: Offset must be an integer', E_USER_ERROR); + return false; + } + + $str = utf8_substr($str, $offset); + + if (false !== ($pos = utf8_strpos($str, $needle))) + { + return $pos + $offset; + } + + return false; + } + } + + $UTF8_UPPER_TO_LOWER = array( + "\x41" => "\x61", "\x42" => "\x62", "\x43" => "\x63", "\x44" => "\x64", + "\x45" => "\x65", "\x46" => "\x66", "\x47" => "\x67", "\x48" => "\x68", + "\x49" => "\x69", "\x4A" => "\x6A", "\x4B" => "\x6B", "\x4C" => "\x6C", + "\x4D" => "\x6D", "\x4E" => "\x6E", "\x4F" => "\x6F", "\x50" => "\x70", + "\x51" => "\x71", "\x52" => "\x72", "\x53" => "\x73", "\x54" => "\x74", + "\x55" => "\x75", "\x56" => "\x76", "\x57" => "\x77", "\x58" => "\x78", + "\x59" => "\x79", "\x5A" => "\x7A", "\xC3\x80" => "\xC3\xA0", "\xC3\x81" => "\xC3\xA1", + "\xC3\x82" => "\xC3\xA2", "\xC3\x83" => "\xC3\xA3", "\xC3\x84" => "\xC3\xA4", "\xC3\x85" => "\xC3\xA5", + "\xC3\x86" => "\xC3\xA6", "\xC3\x87" => "\xC3\xA7", "\xC3\x88" => "\xC3\xA8", "\xC3\x89" => "\xC3\xA9", + "\xC3\x8A" => "\xC3\xAA", "\xC3\x8B" => "\xC3\xAB", "\xC3\x8C" => "\xC3\xAC", "\xC3\x8D" => "\xC3\xAD", + "\xC3\x8E" => "\xC3\xAE", "\xC3\x8F" => "\xC3\xAF", "\xC3\x90" => "\xC3\xB0", "\xC3\x91" => "\xC3\xB1", + "\xC3\x92" => "\xC3\xB2", "\xC3\x93" => "\xC3\xB3", "\xC3\x94" => "\xC3\xB4", "\xC3\x95" => "\xC3\xB5", + "\xC3\x96" => "\xC3\xB6", "\xC3\x98" => "\xC3\xB8", "\xC3\x99" => "\xC3\xB9", "\xC3\x9A" => "\xC3\xBA", + "\xC3\x9B" => "\xC3\xBB", "\xC3\x9C" => "\xC3\xBC", "\xC3\x9D" => "\xC3\xBD", "\xC3\x9E" => "\xC3\xBE", + "\xC4\x80" => "\xC4\x81", "\xC4\x82" => "\xC4\x83", "\xC4\x84" => "\xC4\x85", "\xC4\x86" => "\xC4\x87", + "\xC4\x88" => "\xC4\x89", "\xC4\x8A" => "\xC4\x8B", "\xC4\x8C" => "\xC4\x8D", "\xC4\x8E" => "\xC4\x8F", + "\xC4\x90" => "\xC4\x91", "\xC4\x92" => "\xC4\x93", "\xC4\x96" => "\xC4\x97", "\xC4\x98" => "\xC4\x99", + "\xC4\x9A" => "\xC4\x9B", "\xC4\x9C" => "\xC4\x9D", "\xC4\x9E" => "\xC4\x9F", "\xC4\xA0" => "\xC4\xA1", + "\xC4\xA2" => "\xC4\xA3", "\xC4\xA4" => "\xC4\xA5", "\xC4\xA6" => "\xC4\xA7", "\xC4\xA8" => "\xC4\xA9", + "\xC4\xAA" => "\xC4\xAB", "\xC4\xAE" => "\xC4\xAF", "\xC4\xB4" => "\xC4\xB5", "\xC4\xB6" => "\xC4\xB7", + "\xC4\xB9" => "\xC4\xBA", "\xC4\xBB" => "\xC4\xBC", "\xC4\xBD" => "\xC4\xBE", "\xC5\x81" => "\xC5\x82", + "\xC5\x83" => "\xC5\x84", "\xC5\x85" => "\xC5\x86", "\xC5\x87" => "\xC5\x88", "\xC5\x8A" => "\xC5\x8B", + "\xC5\x8C" => "\xC5\x8D", "\xC5\x90" => "\xC5\x91", "\xC5\x94" => "\xC5\x95", "\xC5\x96" => "\xC5\x97", + "\xC5\x98" => "\xC5\x99", "\xC5\x9A" => "\xC5\x9B", "\xC5\x9C" => "\xC5\x9D", "\xC5\x9E" => "\xC5\x9F", + "\xC5\xA0" => "\xC5\xA1", "\xC5\xA2" => "\xC5\xA3", "\xC5\xA4" => "\xC5\xA5", "\xC5\xA6" => "\xC5\xA7", + "\xC5\xA8" => "\xC5\xA9", "\xC5\xAA" => "\xC5\xAB", "\xC5\xAC" => "\xC5\xAD", "\xC5\xAE" => "\xC5\xAF", + "\xC5\xB0" => "\xC5\xB1", "\xC5\xB2" => "\xC5\xB3", "\xC5\xB4" => "\xC5\xB5", "\xC5\xB6" => "\xC5\xB7", + "\xC5\xB8" => "\xC3\xBF", "\xC5\xB9" => "\xC5\xBA", "\xC5\xBB" => "\xC5\xBC", "\xC5\xBD" => "\xC5\xBE", + "\xC6\xA0" => "\xC6\xA1", "\xC6\xAF" => "\xC6\xB0", "\xC8\x98" => "\xC8\x99", "\xC8\x9A" => "\xC8\x9B", + "\xCE\x86" => "\xCE\xAC", "\xCE\x88" => "\xCE\xAD", "\xCE\x89" => "\xCE\xAE", "\xCE\x8A" => "\xCE\xAF", + "\xCE\x8C" => "\xCF\x8C", "\xCE\x8E" => "\xCF\x8D", "\xCE\x8F" => "\xCF\x8E", "\xCE\x91" => "\xCE\xB1", + "\xCE\x92" => "\xCE\xB2", "\xCE\x93" => "\xCE\xB3", "\xCE\x94" => "\xCE\xB4", "\xCE\x95" => "\xCE\xB5", + "\xCE\x96" => "\xCE\xB6", "\xCE\x97" => "\xCE\xB7", "\xCE\x98" => "\xCE\xB8", "\xCE\x99" => "\xCE\xB9", + "\xCE\x9A" => "\xCE\xBA", "\xCE\x9B" => "\xCE\xBB", "\xCE\x9C" => "\xCE\xBC", "\xCE\x9D" => "\xCE\xBD", + "\xCE\x9E" => "\xCE\xBE", "\xCE\x9F" => "\xCE\xBF", "\xCE\xA0" => "\xCF\x80", "\xCE\xA1" => "\xCF\x81", + "\xCE\xA3" => "\xCF\x83", "\xCE\xA4" => "\xCF\x84", "\xCE\xA5" => "\xCF\x85", "\xCE\xA6" => "\xCF\x86", + "\xCE\xA7" => "\xCF\x87", "\xCE\xA8" => "\xCF\x88", "\xCE\xA9" => "\xCF\x89", "\xCE\xAA" => "\xCF\x8A", + "\xCE\xAB" => "\xCF\x8B", "\xD0\x81" => "\xD1\x91", "\xD0\x82" => "\xD1\x92", "\xD0\x83" => "\xD1\x93", + "\xD0\x84" => "\xD1\x94", "\xD0\x85" => "\xD1\x95", "\xD0\x86" => "\xD1\x96", "\xD0\x87" => "\xD1\x97", + "\xD0\x88" => "\xD1\x98", "\xD0\x89" => "\xD1\x99", "\xD0\x8A" => "\xD1\x9A", "\xD0\x8B" => "\xD1\x9B", + "\xD0\x8C" => "\xD1\x9C", "\xD0\x8E" => "\xD1\x9E", "\xD0\x8F" => "\xD1\x9F", "\xD0\x90" => "\xD0\xB0", + "\xD0\x91" => "\xD0\xB1", "\xD0\x92" => "\xD0\xB2", "\xD0\x93" => "\xD0\xB3", "\xD0\x94" => "\xD0\xB4", + "\xD0\x95" => "\xD0\xB5", "\xD0\x96" => "\xD0\xB6", "\xD0\x97" => "\xD0\xB7", "\xD0\x98" => "\xD0\xB8", + "\xD0\x99" => "\xD0\xB9", "\xD0\x9A" => "\xD0\xBA", "\xD0\x9B" => "\xD0\xBB", "\xD0\x9C" => "\xD0\xBC", + "\xD0\x9D" => "\xD0\xBD", "\xD0\x9E" => "\xD0\xBE", "\xD0\x9F" => "\xD0\xBF", "\xD0\xA0" => "\xD1\x80", + "\xD0\xA1" => "\xD1\x81", "\xD0\xA2" => "\xD1\x82", "\xD0\xA3" => "\xD1\x83", "\xD0\xA4" => "\xD1\x84", + "\xD0\xA5" => "\xD1\x85", "\xD0\xA6" => "\xD1\x86", "\xD0\xA7" => "\xD1\x87", "\xD0\xA8" => "\xD1\x88", + "\xD0\xA9" => "\xD1\x89", "\xD0\xAA" => "\xD1\x8A", "\xD0\xAB" => "\xD1\x8B", "\xD0\xAC" => "\xD1\x8C", + "\xD0\xAD" => "\xD1\x8D", "\xD0\xAE" => "\xD1\x8E", "\xD0\xAF" => "\xD1\x8F", "\xD2\x90" => "\xD2\x91", + "\xE1\xB8\x82" => "\xE1\xB8\x83", "\xE1\xB8\x8A" => "\xE1\xB8\x8B", "\xE1\xB8\x9E" => "\xE1\xB8\x9F", "\xE1\xB9\x80" => "\xE1\xB9\x81", + "\xE1\xB9\x96" => "\xE1\xB9\x97", "\xE1\xB9\xA0" => "\xE1\xB9\xA1", "\xE1\xB9\xAA" => "\xE1\xB9\xAB", "\xE1\xBA\x80" => "\xE1\xBA\x81", + "\xE1\xBA\x82" => "\xE1\xBA\x83", "\xE1\xBA\x84" => "\xE1\xBA\x85", "\xE1\xBB\xB2" => "\xE1\xBB\xB3" + ); + + $UTF8_LOWER_TO_UPPER = array( + "\x61" => "\x41", "\x62" => "\x42", "\x63" => "\x43", "\x64" => "\x44", + "\x65" => "\x45", "\x66" => "\x46", "\x67" => "\x47", "\x68" => "\x48", + "\x69" => "\x49", "\x6A" => "\x4A", "\x6B" => "\x4B", "\x6C" => "\x4C", + "\x6D" => "\x4D", "\x6E" => "\x4E", "\x6F" => "\x4F", "\x70" => "\x50", + "\x71" => "\x51", "\x72" => "\x52", "\x73" => "\x53", "\x74" => "\x54", + "\x75" => "\x55", "\x76" => "\x56", "\x77" => "\x57", "\x78" => "\x58", + "\x79" => "\x59", "\x7A" => "\x5A", "\xC3\xA0" => "\xC3\x80", "\xC3\xA1" => "\xC3\x81", + "\xC3\xA2" => "\xC3\x82", "\xC3\xA3" => "\xC3\x83", "\xC3\xA4" => "\xC3\x84", "\xC3\xA5" => "\xC3\x85", + "\xC3\xA6" => "\xC3\x86", "\xC3\xA7" => "\xC3\x87", "\xC3\xA8" => "\xC3\x88", "\xC3\xA9" => "\xC3\x89", + "\xC3\xAA" => "\xC3\x8A", "\xC3\xAB" => "\xC3\x8B", "\xC3\xAC" => "\xC3\x8C", "\xC3\xAD" => "\xC3\x8D", + "\xC3\xAE" => "\xC3\x8E", "\xC3\xAF" => "\xC3\x8F", "\xC3\xB0" => "\xC3\x90", "\xC3\xB1" => "\xC3\x91", + "\xC3\xB2" => "\xC3\x92", "\xC3\xB3" => "\xC3\x93", "\xC3\xB4" => "\xC3\x94", "\xC3\xB5" => "\xC3\x95", + "\xC3\xB6" => "\xC3\x96", "\xC3\xB8" => "\xC3\x98", "\xC3\xB9" => "\xC3\x99", "\xC3\xBA" => "\xC3\x9A", + "\xC3\xBB" => "\xC3\x9B", "\xC3\xBC" => "\xC3\x9C", "\xC3\xBD" => "\xC3\x9D", "\xC3\xBE" => "\xC3\x9E", + "\xC3\xBF" => "\xC5\xB8", "\xC4\x81" => "\xC4\x80", "\xC4\x83" => "\xC4\x82", "\xC4\x85" => "\xC4\x84", + "\xC4\x87" => "\xC4\x86", "\xC4\x89" => "\xC4\x88", "\xC4\x8B" => "\xC4\x8A", "\xC4\x8D" => "\xC4\x8C", + "\xC4\x8F" => "\xC4\x8E", "\xC4\x91" => "\xC4\x90", "\xC4\x93" => "\xC4\x92", "\xC4\x97" => "\xC4\x96", + "\xC4\x99" => "\xC4\x98", "\xC4\x9B" => "\xC4\x9A", "\xC4\x9D" => "\xC4\x9C", "\xC4\x9F" => "\xC4\x9E", + "\xC4\xA1" => "\xC4\xA0", "\xC4\xA3" => "\xC4\xA2", "\xC4\xA5" => "\xC4\xA4", "\xC4\xA7" => "\xC4\xA6", + "\xC4\xA9" => "\xC4\xA8", "\xC4\xAB" => "\xC4\xAA", "\xC4\xAF" => "\xC4\xAE", "\xC4\xB5" => "\xC4\xB4", + "\xC4\xB7" => "\xC4\xB6", "\xC4\xBA" => "\xC4\xB9", "\xC4\xBC" => "\xC4\xBB", "\xC4\xBE" => "\xC4\xBD", + "\xC5\x82" => "\xC5\x81", "\xC5\x84" => "\xC5\x83", "\xC5\x86" => "\xC5\x85", "\xC5\x88" => "\xC5\x87", + "\xC5\x8B" => "\xC5\x8A", "\xC5\x8D" => "\xC5\x8C", "\xC5\x91" => "\xC5\x90", "\xC5\x95" => "\xC5\x94", + "\xC5\x97" => "\xC5\x96", "\xC5\x99" => "\xC5\x98", "\xC5\x9B" => "\xC5\x9A", "\xC5\x9D" => "\xC5\x9C", + "\xC5\x9F" => "\xC5\x9E", "\xC5\xA1" => "\xC5\xA0", "\xC5\xA3" => "\xC5\xA2", "\xC5\xA5" => "\xC5\xA4", + "\xC5\xA7" => "\xC5\xA6", "\xC5\xA9" => "\xC5\xA8", "\xC5\xAB" => "\xC5\xAA", "\xC5\xAD" => "\xC5\xAC", + "\xC5\xAF" => "\xC5\xAE", "\xC5\xB1" => "\xC5\xB0", "\xC5\xB3" => "\xC5\xB2", "\xC5\xB5" => "\xC5\xB4", + "\xC5\xB7" => "\xC5\xB6", "\xC5\xBA" => "\xC5\xB9", "\xC5\xBC" => "\xC5\xBB", "\xC5\xBE" => "\xC5\xBD", + "\xC6\xA1" => "\xC6\xA0", "\xC6\xB0" => "\xC6\xAF", "\xC8\x99" => "\xC8\x98", "\xC8\x9B" => "\xC8\x9A", + "\xCE\xAC" => "\xCE\x86", "\xCE\xAD" => "\xCE\x88", "\xCE\xAE" => "\xCE\x89", "\xCE\xAF" => "\xCE\x8A", + "\xCE\xB1" => "\xCE\x91", "\xCE\xB2" => "\xCE\x92", "\xCE\xB3" => "\xCE\x93", "\xCE\xB4" => "\xCE\x94", + "\xCE\xB5" => "\xCE\x95", "\xCE\xB6" => "\xCE\x96", "\xCE\xB7" => "\xCE\x97", "\xCE\xB8" => "\xCE\x98", + "\xCE\xB9" => "\xCE\x99", "\xCE\xBA" => "\xCE\x9A", "\xCE\xBB" => "\xCE\x9B", "\xCE\xBC" => "\xCE\x9C", + "\xCE\xBD" => "\xCE\x9D", "\xCE\xBE" => "\xCE\x9E", "\xCE\xBF" => "\xCE\x9F", "\xCF\x80" => "\xCE\xA0", + "\xCF\x81" => "\xCE\xA1", "\xCF\x83" => "\xCE\xA3", "\xCF\x84" => "\xCE\xA4", "\xCF\x85" => "\xCE\xA5", + "\xCF\x86" => "\xCE\xA6", "\xCF\x87" => "\xCE\xA7", "\xCF\x88" => "\xCE\xA8", "\xCF\x89" => "\xCE\xA9", + "\xCF\x8A" => "\xCE\xAA", "\xCF\x8B" => "\xCE\xAB", "\xCF\x8C" => "\xCE\x8C", "\xCF\x8D" => "\xCE\x8E", + "\xCF\x8E" => "\xCE\x8F", "\xD0\xB0" => "\xD0\x90", "\xD0\xB1" => "\xD0\x91", "\xD0\xB2" => "\xD0\x92", + "\xD0\xB3" => "\xD0\x93", "\xD0\xB4" => "\xD0\x94", "\xD0\xB5" => "\xD0\x95", "\xD0\xB6" => "\xD0\x96", + "\xD0\xB7" => "\xD0\x97", "\xD0\xB8" => "\xD0\x98", "\xD0\xB9" => "\xD0\x99", "\xD0\xBA" => "\xD0\x9A", + "\xD0\xBB" => "\xD0\x9B", "\xD0\xBC" => "\xD0\x9C", "\xD0\xBD" => "\xD0\x9D", "\xD0\xBE" => "\xD0\x9E", + "\xD0\xBF" => "\xD0\x9F", "\xD1\x80" => "\xD0\xA0", "\xD1\x81" => "\xD0\xA1", "\xD1\x82" => "\xD0\xA2", + "\xD1\x83" => "\xD0\xA3", "\xD1\x84" => "\xD0\xA4", "\xD1\x85" => "\xD0\xA5", "\xD1\x86" => "\xD0\xA6", + "\xD1\x87" => "\xD0\xA7", "\xD1\x88" => "\xD0\xA8", "\xD1\x89" => "\xD0\xA9", "\xD1\x8A" => "\xD0\xAA", + "\xD1\x8B" => "\xD0\xAB", "\xD1\x8C" => "\xD0\xAC", "\xD1\x8D" => "\xD0\xAD", "\xD1\x8E" => "\xD0\xAE", + "\xD1\x8F" => "\xD0\xAF", "\xD1\x91" => "\xD0\x81", "\xD1\x92" => "\xD0\x82", "\xD1\x93" => "\xD0\x83", + "\xD1\x94" => "\xD0\x84", "\xD1\x95" => "\xD0\x85", "\xD1\x96" => "\xD0\x86", "\xD1\x97" => "\xD0\x87", + "\xD1\x98" => "\xD0\x88", "\xD1\x99" => "\xD0\x89", "\xD1\x9A" => "\xD0\x8A", "\xD1\x9B" => "\xD0\x8B", + "\xD1\x9C" => "\xD0\x8C", "\xD1\x9E" => "\xD0\x8E", "\xD1\x9F" => "\xD0\x8F", "\xD2\x91" => "\xD2\x90", + "\xE1\xB8\x83" => "\xE1\xB8\x82", "\xE1\xB8\x8B" => "\xE1\xB8\x8A", "\xE1\xB8\x9F" => "\xE1\xB8\x9E", "\xE1\xB9\x81" => "\xE1\xB9\x80", + "\xE1\xB9\x97" => "\xE1\xB9\x96", "\xE1\xB9\xA1" => "\xE1\xB9\xA0", "\xE1\xB9\xAB" => "\xE1\xB9\xAA", "\xE1\xBA\x81" => "\xE1\xBA\x80", + "\xE1\xBA\x83" => "\xE1\xBA\x82", "\xE1\xBA\x85" => "\xE1\xBA\x84", "\xE1\xBB\xB3" => "\xE1\xBB\xB2" + ); + + /** + * UTF-8 aware alternative to strtolower + * Make a string lowercase + * Note: The concept of a characters "case" only exists is some alphabets + * such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does + * not exist in the Chinese alphabet, for example. See Unicode Standard + * Annex #21: Case Mappings + * + * @param string + * @return string string in lowercase + */ + function utf8_strtolower($string) + { + global $UTF8_UPPER_TO_LOWER; + + return strtr($string, $UTF8_UPPER_TO_LOWER); + } + + /** + * UTF-8 aware alternative to strtoupper + * Make a string uppercase + * Note: The concept of a characters "case" only exists is some alphabets + * such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does + * not exist in the Chinese alphabet, for example. See Unicode Standard + * Annex #21: Case Mappings + * + * @param string + * @return string string in uppercase + */ + function utf8_strtoupper($string) + { + global $UTF8_LOWER_TO_UPPER; + + return strtr($string, $UTF8_LOWER_TO_UPPER); + } + + /** + * UTF-8 aware alternative to substr + * Return part of a string given character offset (and optionally length) + * + * Note arguments: comparied to substr - if offset or length are + * not integers, this version will not complain but rather massages them + * into an integer. + * + * Note on returned values: substr documentation states false can be + * returned in some cases (e.g. offset > string length) + * mb_substr never returns false, it will return an empty string instead. + * This adopts the mb_substr approach + * + * Note on implementation: PCRE only supports repetitions of less than + * 65536, in order to accept up to MAXINT values for offset and length, + * we'll repeat a group of 65535 characters when needed. + * + * Note on implementation: calculating the number of characters in the + * string is a relatively expensive operation, so we only carry it out when + * necessary. It isn't necessary for +ve offsets and no specified length + * + * @author Chris Smith<chris@jalakai.co.uk> + * @param string + * @param integer number of UTF-8 characters offset (from left) + * @param integer (optional) length in UTF-8 characters from offset + * @return mixed string or FALSE if failure + */ + function utf8_substr($str, $offset, $length = NULL) + { + // generates E_NOTICE + // for PHP4 objects, but not PHP5 objects + $str = (string) $str; + $offset = (int) $offset; + if (!is_null($length)) + { + $length = (int) $length; + } + + // handle trivial cases + if ($length === 0 || ($offset < 0 && $length < 0 && $length < $offset)) + { + return ''; + } + + // normalise negative offsets (we could use a tail + // anchored pattern, but they are horribly slow!) + if ($offset < 0) + { + // see notes + $strlen = utf8_strlen($str); + $offset = $strlen + $offset; + if ($offset < 0) + { + $offset = 0; + } + } + + $op = ''; + $lp = ''; + + // establish a pattern for offset, a + // non-captured group equal in length to offset + if ($offset > 0) + { + $ox = (int) ($offset / 65535); + $oy = $offset % 65535; + + if ($ox) + { + $op = '(?:.{65535}){' . $ox . '}'; + } + + $op = '^(?:' . $op . '.{' . $oy . '})'; + } + else + { + // offset == 0; just anchor the pattern + $op = '^'; + } + + // establish a pattern for length + if (is_null($length)) + { + // the rest of the string + $lp = '(.*)$'; + } + else + { + if (!isset($strlen)) + { + // see notes + $strlen = utf8_strlen($str); + } + + // another trivial case + if ($offset > $strlen) + { + return ''; + } + + if ($length > 0) + { + // reduce any length that would + // go passed the end of the string + $length = min($strlen - $offset, $length); + + $lx = (int) ($length / 65535); + $ly = $length % 65535; + + // negative length requires a captured group + // of length characters + if ($lx) + { + $lp = '(?:.{65535}){' . $lx . '}'; + } + $lp = '(' . $lp . '.{'. $ly . '})'; + } + else if ($length < 0) + { + if ($length < ($offset - $strlen)) + { + return ''; + } + + $lx = (int)((-$length) / 65535); + $ly = (-$length) % 65535; + + // negative length requires ... capture everything + // except a group of -length characters + // anchored at the tail-end of the string + if ($lx) + { + $lp = '(?:.{65535}){' . $lx . '}'; + } + $lp = '(.*)(?:' . $lp . '.{' . $ly . '})$'; + } + } + + if (!preg_match('#' . $op . $lp . '#us', $str, $match)) + { + return ''; + } + + return $match[1]; + } + + /** + * Return the length (in characters) of a UTF-8 string + * + * @param string $text UTF-8 string + * @return integer Length (in chars) of given string + */ + function utf8_strlen($text) + { + // Since utf8_decode is replacing multibyte characters to ? strlen works fine + return strlen(utf8_decode($text)); + } +} + /** -* Return the length (in characters) of a UTF-8 string -* -* @param string $text UTF-8 string -* @return integer Length (in chars) of given string +* UTF-8 aware alternative to str_split +* Convert a string to an array +* +* @author Harry Fuecks +* @param string UTF-8 encoded +* @param int number to characters to split string by +* @return string characters in string reverses */ -function utf8_strlen($text) +function utf8_str_split($str, $split_len = 1) { - if (function_exists('iconv_strlen')) + if (!preg_match('/^[0-9]+$/', $split_len) || $split_len < 1) { - return iconv_strlen($text, 'utf-8'); + return false; } - if (function_exists('mb_strlen')) + $len = utf8_strlen($str); + if ($len <= $split_len) { - return mb_strlen($text, 'utf-8'); + return array($str); + } + + preg_match_all('/.{' . $split_len . '}|[^\x00]{1,' . $split_len . '}$/us', $str, $ar); + return $ar[0]; +} + +/** +* UTF-8 aware alternative to strcspn +* Find length of initial segment not matching mask +* +* @author Harry Fuecks +* @param string +* @return int +*/ +function utf8_strspn($str, $mask, $start = null, $length = null) +{ + $mask = preg_replace('!([\\\\\\-\\]\\[/^])!', '\\\${1}', $mask); + + if ($start !== null || $length !== null) + { + $str = utf8_substr($str, $start, $length); } - return strlen(utf8_decode($text)); + preg_match('/^[' . $mask . ']+/u', $str, $matches); + + if (isset($matches[0])) + { + return utf8_strlen($matches[0]); + } + + return 0; +} + +/** +* UTF-8 aware alternative to ucfirst +* Make a string's first character uppercase +* +* @author Harry Fuecks +* @param string +* @return string with first character as upper case (if applicable) +*/ +function utf8_ucfirst($str) +{ + switch (utf8_strlen($str)) + { + case 0: + return ''; + break; + + case 1: + return utf8_strtoupper($str); + break; + + default: + preg_match('/^(.{1})(.*)$/us', $str, $matches); + return utf8_strtoupper($matches[1]) . $matches[2]; + break; + } } /** @@ -47,7 +705,7 @@ function utf8_strlen($text) * If the encoding is not supported, the string is returned as-is * * @param string $string Original string -* @param string $encoding Original encoding +* @param string $encoding Original encoding (lowered) * @return string The string, encoded in UTF-8 */ function utf8_recode($string, $encoding) @@ -59,17 +717,13 @@ function utf8_recode($string, $encoding) return $string; } - /** - * PHP has a built-in function for encoding from iso-8859-1, let's use that - */ + // start with something simple if ($encoding == 'iso-8859-1') { return utf8_encode($string); } - /** - * First, try iconv() - */ + // First, try iconv() if (function_exists('iconv')) { $ret = @iconv($encoding, 'utf-8', $string); @@ -80,9 +734,7 @@ function utf8_recode($string, $encoding) } } - /** - * Try the mb_string extension - */ + // Try the mb_string extension if (function_exists('mb_convert_encoding')) { $ret = @mb_convert_encoding($string, 'utf-8', $encoding); @@ -93,9 +745,7 @@ function utf8_recode($string, $encoding) } } - /** - * Try the recode extension - */ + // Try the recode extension if (function_exists('recode_string')) { $ret = @recode_string($encoding . '..utf-8', $string); @@ -106,25 +756,21 @@ function utf8_recode($string, $encoding) } } - /** - * If nothing works, check if we have a custom transcoder available - */ + // If nothing works, check if we have a custom transcoder available if (!preg_match('#^[a-z0-9\\-]+$#', $encoding)) { - /** - * Make sure the encoding name is alphanumeric, we don't want it - * to be abused into loading arbitrary files - */ - trigger_error('Unknown encoding: ' . $encoding); + // Make sure the encoding name is alphanumeric, we don't want it to be abused into loading arbitrary files + trigger_error('Unknown encoding: ' . $encoding, E_USER_ERROR); } global $phpbb_root_path; + if (!file_exists($phpbb_root_path . 'includes/utf/data/')) { return $string; } - die('Finish me!! '.basename(__FILE__).' at line '.__LINE__); + die('Finish me!! ' . basename(__FILE__) . ' at line ' . __LINE__); } /** @@ -135,7 +781,7 @@ function utf8_recode($string, $encoding) */ function utf8_encode_ncr($text) { - return preg_replace_callback('#[\\xC2-\\xF4][\\x80-\\xBF]+#', 'utf8_encode_ncr_callback', $text); + return preg_replace_callback('#[\\xC2-\\xF4][\\x80-\\xBF]{1,3}#', 'utf8_encode_ncr_callback', $text); } /** @@ -148,23 +794,64 @@ function utf8_encode_ncr($text) */ function utf8_encode_ncr_callback($m) { - switch (strlen($m[0])) + return '&#' . utf8_ord($m[0]) . ';'; +} + +/** +* Enter description here... +* +* @param string $chr UTF-8 char +* @return integer UNICODE code point +*/ +function utf8_ord($chr) +{ + switch (strlen($chr)) { case 1: - return '&#' . ord($m[0]) . ';'; + return ord($chr); + break; case 2: - return '&#' . (((ord($m[0][0]) & 0x1F) << 6) | (ord($m[0][1]) & 0x3F)) . ';'; + return ((ord($chr[0]) & 0x1F) << 6) | (ord($chr[1]) & 0x3F); + break; case 3: - return '&#' . (((ord($m[0][0]) & 0x0F) << 12) | ((ord($m[0][1]) & 0x3F) << 6) | (ord($m[0][2]) & 0x3F)) . ';'; + return ((ord($chr[0]) & 0x0F) << 12) | ((ord($chr[1]) & 0x3F) << 6) | (ord($chr[2]) & 0x3F); + break; case 4: - return '&#' . (((ord($m[0][0]) & 0x07) << 18) | ((ord($m[0][1]) & 0x3F) << 12) | ((ord($m[0][2]) & 0x3F) << 6) | (ord($m[0][3]) & 0x3F)) . ';'; + return ((ord($chr[0]) & 0x07) << 18) | ((ord($chr[1]) & 0x3F) << 12) | ((ord($chr[2]) & 0x3F) << 6) | (ord($chr[3]) & 0x3F); + break; default: - return $m[0]; - } + return $chr; + } +} + +/** +* Converts an NCR to a UTF-8 char +* +* @param integer $cp UNICODE code point +* @return string UTF-8 char +*/ +function utf8_chr($cp) +{ + if ($cp > 0xFFFF) + { + return chr(0xF0 | ($cp >> 18)) . chr(0x80 | (($cp >> 12) & 0x3F)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F)); + } + else if ($cp > 0x7FF) + { + return chr(0xE0 | ($cp >> 12)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F)); + } + else if ($cp > 0x7F) + { + return chr(0xC0 | ($cp >> 6)) . chr(0x80 | ($cp & 0x3F)); + } + else + { + return chr($cp); + } } /** @@ -196,22 +883,130 @@ function utf8_decode_ncr_callback($m) { $cp = (strncasecmp($m[1], 'x', 1)) ? $m[1] : hexdec(substr($m[1], 1)); - if ($cp > 0xFFFF) + return utf8_chr($cp); +} + +/** +* Takes an array of ints representing the Unicode characters and returns +* a UTF-8 string. +* +* @param string $text text to be case folded +* @param string $option determines how we will fold the cases +* @return string case folded text +*/ +function utf8_case_fold($text, $option = 'full') +{ + static $uniarray = array(); + global $phpbb_root_path, $phpEx; + + // common is always set + if (!isset($uniarray['c'])) { - return chr(0xF0 | ($cp >> 18)) . chr(0x80 | (($cp >> 12) & 0x3F)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F)); + $uniarray['c'] = include($phpbb_root_path . 'includes/utf/data/case_fold_c.' . $phpEx); } - elseif ($cp > 0x7FF) + + // only set full if we need to + if ($option === 'full' && !isset($uniarray['f'])) { - return chr(0xE0 | ($cp >> 12)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F)); + $uniarray['f'] = include($phpbb_root_path . 'includes/utf/data/case_fold_f.' . $phpEx); } - elseif ($cp > 0x7F) + + // only set simple if we need to + if ($option !== 'full' && !isset($uniarray['s'])) { - return chr(0xC0 | ($cp >> 6)) . chr(0x80 | ($cp & 0x3F)); + $uniarray['s'] = include($phpbb_root_path . 'includes/utf/data/case_fold_s.' . $phpEx); + } + + $text = strtr($text, $uniarray['c']); + if ($option === 'full') + { + $text = strtr($text, $uniarray['f']); } else { - return chr($cp); + $text = strtr($text, $uniarray['s']); } + return $text; +} + +/** +* A wrapper function for the normalizer which takes care of including the class if required and modifies the passed strings +* to be in NFC (Normalization Form Composition). +* +* @param mixed $strings Either an array of references to strings, a reference to an array of strings or a reference to a single string +*/ +function utf8_normalize_nfc($strings) +{ + if (!is_array($strings) || (sizeof($strings) > 0)) + { + if (!class_exists('utf_normalizer')) + { + global $phpbb_root_path, $phpEx; + include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx); + } + + if (is_array($strings)) + { + foreach ($strings as $key => $string) + { + $strings[$key] = utf_normalizer::nfc($strings[$key]); + } + } + else + { + $strings = utf_normalizer::nfc($strings); + } + } +} + +/** +* This function is used to generate a "clean" version of a string. +* Clean means that it is a case insensitive form (case folding) and that it is normalized (NFC). +* Additionally a homographs of one character are transformed into one specific character (preferably ASCII +* if it is an ASCII character). +* +* Please be aware that if you change something within this function or within +* functions used here you need to rebuild/update the username_clean column in the users table. And all other +* columns that store a clean string otherwise you will break this functionality. +* +* @param $text An unclean string, mabye user input (has to be valid UTF-8!) +* @return Cleaned up version of the input string +*/ +function utf8_clean_string($text) +{ + $text = utf8_case_fold($text); + + if (!class_exists('utf_normalizer')) + { + global $phpbb_root_path, $phpEx; + include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx); + } + + $text = utf_normalizer::nfc($text); + + static $homographs = array( + // cyrllic + "\xD0\xB0" => "\x61", + "\xD0\xB5" => "\x65", + "\xD0\xBE" => "\x6F", + "\xD1\x80" => "\x70", + "\xD1\x81" => "\x63", + "\xD1\x83" => "\x79", + "\xD1\x85" => "\x78", + "\xD1\x95" => "\x73", + "\xD1\x96" => "\x69", + "\xD1\x98" => "\x6A", + "\xD2\xBB" => "\x68", + // greek + "\xCE\xB1" => "\x61", + "\xCE\xBF" => "\x6F", + // other + "\xC2\xA1" => "\x69", + ); + + $text = strtr($text, $homographs); + + return $text; } ?>
\ No newline at end of file diff --git a/phpBB/index.php b/phpBB/index.php index d1655267e4..59e51bac49 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -46,7 +46,14 @@ $result = $db->sql_query($sql); $legend = ''; while ($row = $db->sql_fetchrow($result)) { - $legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>'; + if ($row['group_name'] == 'BOTS') + { + $legend .= (($legend != '') ? ', ' : '') . '<span style="color:#' . $row['group_colour'] . '">' . $user->lang['G_BOTS'] . '</span>'; + } + else + { + $legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>'; + } } $db->sql_freeresult($result); @@ -54,7 +61,7 @@ $db->sql_freeresult($result); $birthday_list = ''; if ($config['load_birthdays']) { - $now = getdate(); + $now = getdate(time() + $user->timezone + $user->dst - (date('H', time()) - gmdate('H', time())) * 3600); $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'])) . "%' @@ -83,9 +90,9 @@ $template->assign_vars(array( 'LEGEND' => $legend, 'BIRTHDAY_LIST' => $birthday_list, - 'FORUM_IMG' => $user->img('forum_read', 'NO_NEW_POSTS'), - 'FORUM_NEW_IMG' => $user->img('forum_unread', 'NEW_POSTS'), - 'FORUM_LOCKED_IMG' => $user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'), + 'FORUM_IMG' => $user->img('forum_read', 'NO_NEW_POSTS'), + 'FORUM_NEW_IMG' => $user->img('forum_unread', 'NEW_POSTS'), + 'FORUM_LOCKED_IMG' => $user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'), 'FORUM_NEW_LOCKED_IMG' => $user->img('forum_unread_locked', 'NO_NEW_POSTS_LOCKED'), 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'), diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php new file mode 100644 index 0000000000..ee6da65633 --- /dev/null +++ b/phpBB/install/database_update.php @@ -0,0 +1,964 @@ +<?php +/** +* +* @package install +* @version $Id$ +* @copyright (c) 2006 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +$updates_to_version = '3.0.B2'; + +if (defined('IN_PHPBB') && defined('IN_INSTALL')) +{ + return; +} + +/** +*/ +define('IN_PHPBB', true); +define('IN_INSTALL', true); + +$phpbb_root_path = './../'; +$phpEx = substr(strrchr(__FILE__, '.'), 1); + +// Report all errors, except notices +//error_reporting(E_ALL ^ E_NOTICE); +error_reporting(E_ALL); + +@set_time_limit(120); + +// Include essential scripts +include($phpbb_root_path . 'config.' . $phpEx); + +if (!isset($dbms)) +{ + die("Please read: <a href='../docs/INSTALL.html'>INSTALL.html</a> before attempting to update."); +} + +// Load Extensions +if (!empty($load_extensions)) +{ + $load_extensions = explode(',', $load_extensions); + + foreach ($load_extensions as $extension) + { + @dl(trim($extension)); + } +} + +// Include files +require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx); +require($phpbb_root_path . 'includes/cache.' . $phpEx); +require($phpbb_root_path . 'includes/template.' . $phpEx); +require($phpbb_root_path . 'includes/session.' . $phpEx); +require($phpbb_root_path . 'includes/auth.' . $phpEx); +require($phpbb_root_path . 'includes/functions.' . $phpEx); +require($phpbb_root_path . 'includes/functions_admin.' . $phpEx); +require($phpbb_root_path . 'includes/constants.' . $phpEx); +require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); + +$cache = new cache(); +$db = new $sql_db(); + +// Connect to DB +$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false); + +// We do not need this any longer, unset for safety purposes +unset($dbpasswd); + +$sql = "SELECT config_value + FROM " . CONFIG_TABLE . " + WHERE config_name = 'default_lang'"; +$result = $db->sql_query($sql); +$row = $db->sql_fetchrow($result); +$db->sql_freeresult($result); + +// And finally, load the relevant language files +include($phpbb_root_path . 'language/' . $row['config_value'] . '/common.' . $phpEx); +include($phpbb_root_path . 'language/' . $row['config_value'] . '/acp/common.' . $phpEx); +include($phpbb_root_path . 'language/' . $row['config_value'] . '/install.' . $phpEx); + +// Set PHP error handler to ours +//set_error_handler('msg_handler'); + +// Define some variables for the database update + +// Database column types mapping +$dbms_type_map = array( + 'mysql_41' => array( + 'INT:' => 'int(%d)', + 'BINT' => 'bigint(20)', + 'UINT' => 'mediumint(8) UNSIGNED', + 'UINT:' => 'int(%d) UNSIGNED', + 'TINT:' => 'tinyint(%d)', + 'USINT' => 'smallint(4) UNSIGNED', + 'BOOL' => 'tinyint(1) UNSIGNED', + 'VCHAR' => 'varchar(255)', + 'VCHAR:' => 'varchar(%d)', + 'CHAR:' => 'char(%d)', + 'XSTEXT' => 'text', + 'XSTEXT_UNI'=> 'varchar(100)', + 'STEXT' => 'text', + 'STEXT_UNI' => 'varchar(255)', + 'TEXT' => 'text', + 'TEXT_UNI' => 'text', + 'MTEXT' => 'mediumtext', + 'MTEXT_UNI' => 'mediumtext', + 'TIMESTAMP' => 'int(11) UNSIGNED', + 'DECIMAL' => 'decimal(5,2)', + 'VCHAR_UNI' => 'varchar(255)', + 'VCHAR_UNI:'=> 'varchar(%d)', + 'VCHAR_CI' => 'varchar(255)', + 'VARBINARY' => 'varbinary(255)', + ), + + 'mysql_40' => array( + 'INT:' => 'int(%d)', + 'BINT' => 'bigint(20)', + 'UINT' => 'mediumint(8) UNSIGNED', + 'UINT:' => 'int(%d) UNSIGNED', + 'TINT:' => 'tinyint(%d)', + 'USINT' => 'smallint(4) UNSIGNED', + 'BOOL' => 'tinyint(1) UNSIGNED', + 'VCHAR' => 'varchar(255)', + 'VCHAR:' => 'varchar(%d)', + 'CHAR:' => 'char(%d)', + 'XSTEXT' => 'text', + 'XSTEXT_UNI'=> 'text', + 'STEXT' => 'text', + 'STEXT_UNI' => 'text', + 'TEXT' => 'text', + 'TEXT_UNI' => 'text', + 'MTEXT' => 'mediumtext', + 'MTEXT_UNI' => 'mediumtext', + 'TIMESTAMP' => 'int(11) UNSIGNED', + 'DECIMAL' => 'decimal(5,2)', + 'VCHAR_UNI' => 'text', + 'VCHAR_UNI:'=> array('varchar(%d)', 'limit' => array('mult', 3, 255, 'text')), + 'VCHAR_CI' => 'text', + 'VARBINARY' => 'varbinary(255)', + ), + + 'firebird' => array( + 'INT:' => 'INTEGER', + 'BINT' => 'DOUBLE PRECISION', + 'UINT' => 'INTEGER', + 'UINT:' => 'INTEGER', + 'TINT:' => 'INTEGER', + 'USINT' => 'INTEGER', + 'BOOL' => 'INTEGER', + 'VCHAR' => 'VARCHAR(255) CHARACTER SET NONE', + 'VCHAR:' => 'VARCHAR(%d) CHARACTER SET NONE', + 'CHAR:' => 'CHAR(%d) CHARACTER SET NONE', + 'XSTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE', + 'STEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE', + 'TEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE', + 'MTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE', + 'XSTEXT_UNI'=> 'VARCHAR(100) CHARACTER SET UTF8', + 'STEXT_UNI' => 'VARCHAR(255) CHARACTER SET UTF8', + 'TEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8', + 'MTEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8', + 'TIMESTAMP' => 'INTEGER', + 'DECIMAL' => 'DOUBLE PRECISION', + 'VCHAR_UNI' => 'VARCHAR(255) CHARACTER SET UTF8', + 'VCHAR_UNI:'=> 'VARCHAR(%d) CHARACTER SET UTF8', + 'VCHAR_CI' => 'VARCHAR(255) CHARACTER SET UTF8', + 'VARBINARY' => 'CHAR(255) CHARACTER SET NONE', + ), + + 'mssql' => array( + 'INT:' => '[int]', + 'BINT' => '[float]', + 'UINT' => '[int]', + 'UINT:' => '[int]', + 'TINT:' => '[int]', + 'USINT' => '[int]', + 'BOOL' => '[int]', + 'VCHAR' => '[varchar] (255)', + 'VCHAR:' => '[varchar] (%d)', + 'CHAR:' => '[char] (%d)', + 'XSTEXT' => '[varchar] (1000)', + 'STEXT' => '[varchar] (3000)', + 'TEXT' => '[varchar] (8000)', + 'MTEXT' => '[text]', + 'XSTEXT_UNI'=> '[varchar] (100)', + 'STEXT_UNI' => '[varchar] (255)', + 'TEXT_UNI' => '[varchar] (4000)', + 'MTEXT_UNI' => '[text]', + 'TIMESTAMP' => '[int]', + 'DECIMAL' => '[float]', + 'VCHAR_UNI' => '[varchar] (255)', + 'VCHAR_UNI:'=> '[varchar] (%d)', + 'VCHAR_CI' => '[varchar] (255)', + 'VARBINARY' => '[varchar] (255)', + ), + + 'oracle' => array( + 'INT:' => 'number(%d)', + 'BINT' => 'number(20)', + 'UINT' => 'number(8)', + 'UINT:' => 'number(%d)', + 'TINT:' => 'number(%d)', + 'USINT' => 'number(4)', + 'BOOL' => 'number(1)', + 'VCHAR' => 'varchar2(255)', + 'VCHAR:' => 'varchar2(%d)', + 'CHAR:' => 'char(%d)', + 'XSTEXT' => 'varchar2(1000)', + 'STEXT' => 'varchar2(3000)', + 'TEXT' => 'clob', + 'MTEXT' => 'clob', + 'XSTEXT_UNI'=> 'varchar2(300)', + 'STEXT_UNI' => 'varchar2(765)', + 'TEXT_UNI' => 'clob', + 'MTEXT_UNI' => 'clob', + 'TIMESTAMP' => 'number(11)', + 'DECIMAL' => 'number(5, 2)', + 'VCHAR_UNI' => 'varchar2(765)', + 'VCHAR_UNI:'=> array('varchar2(%d)', 'limit' => array('mult', 3, 765, 'clob')), + 'VCHAR_CI' => 'varchar2(255)', + 'VARBINARY' => 'raw(255)', + ), + + 'sqlite' => array( + 'INT:' => 'int(%d)', + 'BINT' => 'bigint(20)', + 'UINT' => 'INTEGER UNSIGNED', //'mediumint(8) UNSIGNED', + 'UINT:' => 'INTEGER UNSIGNED', // 'int(%d) UNSIGNED', + 'TINT:' => 'tinyint(%d)', + 'USINT' => 'INTEGER UNSIGNED', //'mediumint(4) UNSIGNED', + 'BOOL' => 'INTEGER UNSIGNED', //'tinyint(1) UNSIGNED', + 'VCHAR' => 'varchar(255)', + 'VCHAR:' => 'varchar(%d)', + 'CHAR:' => 'char(%d)', + 'XSTEXT' => 'text(65535)', + 'STEXT' => 'text(65535)', + 'TEXT' => 'text(65535)', + 'MTEXT' => 'mediumtext(16777215)', + 'XSTEXT_UNI'=> 'text(65535)', + 'STEXT_UNI' => 'text(65535)', + 'TEXT_UNI' => 'text(65535)', + 'MTEXT_UNI' => 'mediumtext(16777215)', + 'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) UNSIGNED', + 'DECIMAL' => 'decimal(5,2)', + 'VCHAR_UNI' => 'varchar(255)', + 'VCHAR_UNI:'=> 'varchar(%d)', + 'VCHAR_CI' => 'varchar(255)', + 'VARBINARY' => 'blob', + ), + + 'postgres' => array( + 'INT:' => 'INT4', + 'BINT' => 'INT8', + 'UINT' => 'INT4', // unsigned + 'UINT:' => 'INT4', // unsigned + 'USINT' => 'INT2', // unsigned + 'BOOL' => 'INT2', // unsigned + 'TINT:' => 'INT2', + 'VCHAR' => 'varchar(255)', + 'VCHAR:' => 'varchar(%d)', + 'CHAR:' => 'char(%d)', + 'XSTEXT' => 'varchar(1000)', + 'STEXT' => 'varchar(3000)', + 'TEXT' => 'varchar(8000)', + 'MTEXT' => 'TEXT', + 'XSTEXT_UNI'=> 'varchar(100)', + 'STEXT_UNI' => 'varchar(255)', + 'TEXT_UNI' => 'varchar(4000)', + 'MTEXT_UNI' => 'TEXT', + 'TIMESTAMP' => 'INT4', // unsigned + 'DECIMAL' => 'decimal(5,2)', + 'VCHAR_UNI' => 'varchar(255)', + 'VCHAR_UNI:'=> 'varchar(%d)', + 'VCHAR_CI' => 'varchar_ci', + 'VARBINARY' => 'bytea', + ), +); + +// A list of types being unsigned for better reference in some db's +$unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP'); + +// Only an example, but also commented out +$database_update_info = array( + // Changes within this version + '3.0.b3' => array( +/* + // Change the following columns... + 'change_columns' => array( + {table} => array( + {column_name} => array('USINT', 0), -> column type + ), + ), + // Add the following columns + 'add_columns' => array( + {table} => array( + {column_name} => array('USINT', 0), -> column type + ), + ), +*/ + ), + // Latest version + '3.0.0' => array(), +); + +// Determine mapping database type +switch ($db->sql_layer) +{ + case 'mysql': + $map_dbms = 'mysql_40'; + break; + + case 'mysql4': + case 'mysqli': + $map_dbms = 'mysql_41'; + break; + + case 'mssql': + case 'mssql_odbc': + $map_dbms = 'mssql'; + break; + + default: + $map_dbms = $db->sql_layer; + break; +} + +$error_ary = array(); +$errored = false; + +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $lang['DIRECTION']; ?>" lang="<?php echo $lang['USER_LANG']; ?>" xml:lang="<?php echo $lang['USER_LANG']; ?>"> +<head> + +<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> +<meta http-equiv="content-language" content="<?php echo $lang['USER_LANG']; ?>" /> +<meta http-equiv="content-style-type" content="text/css" /> +<meta http-equiv="imagetoolbar" content="no" /> + +<title><?php echo $lang['UPDATING_TO_LATEST_STABLE']; ?></title> + +<link href="../adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" /> + +</head> + +<body> +<div id="wrap"> + <div id="page-header"> </div> + + <div id="page-body"> + <div class="panel"> + <span class="corners-top"><span></span></span> + <div id="content"> + <div id="main"> + + <h1><?php echo $lang['UPDATING_TO_LATEST_STABLE']; ?></h1> + + <br /> + + <p><?php echo $lang['DATABASE_TYPE']; ?> :: <strong><?php echo $db->sql_layer; ?></strong><br /> +<?php + +$sql = "SELECT config_value + FROM " . CONFIG_TABLE . " + WHERE config_name = 'version'"; +$result = $db->sql_query($sql); +$row = $db->sql_fetchrow($result); +$db->sql_freeresult($result); + +echo $lang['PREVIOUS_VERSION'] . ' :: <strong>' . $row['config_value'] . '</strong><br />'; +echo $lang['UPDATED_VERSION'] . ' :: <strong>' . $updates_to_version . '</strong>'; + +$current_version = strtolower($row['config_value']); +$latest_version = strtolower($updates_to_version); + +// Schema updates +?> + </p><br /><br /> + + <h1><?php echo $lang['UPDATE_DATABASE_SCHEMA']; ?></h1> + + <br /> + <p><?php echo $lang['PROGRESS']; ?> :: <strong> + +<?php + +flush(); + +// We go through the schema changes from the lowest to the highest version +// We skip those versions older than the current version +$no_updates = true; +foreach ($database_update_info as $version => $schema_changes) +{ + if (version_compare($version, $current_version, '<')) + { + continue; + } + + if (!sizeof($schema_changes)) + { + continue; + } + + $no_updates = false; + + // Change columns? + if (!empty($schema_changes['change_columns'])) + { + foreach ($schema_changes['change_columns'] as $table => $columns) + { + foreach ($columns as $column_name => $column_data) + { + sql_column_change($map_dbms, $table, $column_name, $column_data); + } + } + } + + // Add columns? + if (!empty($schema_changes['add_columns'])) + { + foreach ($schema_changes['add_columns'] as $table => $columns) + { + foreach ($columns as $column_name => $column_data) + { + // Only add the column if it does not exist yet + if (!column_exists($map_dbms, $table, $column_name)) + { + sql_column_add($map_dbms, $table, $column_name, $column_data); + } + } + } + } +} + +_write_result($no_updates, $errored, $error_ary); + +// Data updates +$error_ary = array(); +$errored = $no_updates = false; + +?> + +<br /><br /> +<h1><?php echo $lang['UPDATING_DATA']; ?></h1> +<br /> +<p><?php echo $lang['PROGRESS']; ?> :: <strong> + +<?php + +flush(); + +switch ($current_version) +{ + case '3.0.b3': +/* + some code magic +*/ + // No need to change here, before no break should appear + break; + + case '3.0.0': + default: + $no_updates = true; + break; +} + +_write_result($no_updates, $errored, $error_ary); + +$error_ary = array(); +$errored = $no_updates = false; + +?> + +<br /><br /> +<h1><?php echo $lang['UPDATE_VERSION_OPTIMIZE']; ?></h1> +<br /> +<p><?php echo $lang['PROGRESS']; ?> :: <strong> + +<?php + +flush(); + + +/* update the version + +$sql = "UPDATE " . CONFIG_TABLE . " + SET config_value = '$updates_to_version' + WHERE config_name = 'version'"; +_sql($sql, $errored, $error_ary); + +// Optimize/vacuum analyze the tables where appropriate +// this should be done for each version in future along with +// the version number update +switch ($db->sql_layer) +{ + case 'mysql': + case 'mysqli': + case 'mysql4': + $sql = 'OPTIMIZE TABLE ' . $table_prefix . 'auth_access, ' . $table_prefix . 'banlist, ' . $table_prefix . 'categories, ' . $table_prefix . 'config, ' . $table_prefix . 'disallow, ' . $table_prefix . 'forum_prune, ' . $table_prefix . 'forums, ' . $table_prefix . 'groups, ' . $table_prefix . 'posts, ' . $table_prefix . 'posts_text, ' . $table_prefix . 'privmsgs, ' . $table_prefix . 'privmsgs_text, ' . $table_prefix . 'ranks, ' . $table_prefix . 'search_results, ' . $table_prefix . 'search_wordlist, ' . $table_prefix . 'search_wordmatch, ' . $table_prefix . 'sessions_keys' . $table_prefix . 'smilies, ' . $table_prefix . 'themes, ' . $table_prefix . 'themes_name, ' . $table_prefix . 'topics, ' . $table_prefix . 'topics_watch, ' . $table_prefix . 'user_group, ' . $table_prefix . 'users, ' . $table_prefix . 'vote_desc, ' . $table_prefix . 'vote_results, ' . $table_prefix . 'vote_voters, ' . $table_prefix . 'words'; + _sql($sql, $errored, $error_ary); + break; + + case 'postgresql': + _sql("VACUUM ANALYZE", $errored, $error_ary); + break; +} +*/ + +_write_result($no_updates, $errored, $error_ary); + +?> + +<br /> +<h1><?php echo $lang['UPDATE_COMPLETED']; ?></h1> + +<br /> + +<p style="color:red"><?php echo $lang['UPDATE_FILES_NOTICE']; ?></p> + +<p><?php echo $lang['COMPLETE_LOGIN_TO_BOARD']; ?></p> + +<?php + +// Now we purge the session table as well as all cache files +$cache->purge(); + +?> + + </div> + </div> + <span class="corners-bottom"><span></span></span> + </div> + </div> + + <div id="page-footer"> + Powered by phpBB © 2006 <a href="http://www.phpbb.com/">phpBB Group</a> + </div> +</div> + +</body> +</html> + +<?php + +/** +* Function for triggering an sql statement +*/ +function _sql($sql, &$errored, &$error_ary, $echo_dot = true) +{ + global $db; + + $db->sql_return_on_error(true); + + $result = $db->sql_query($sql); + + if ($db->sql_error_triggered) + { + $errored = true; + $error_ary['sql'][] = $db->sql_error_sql; + $error_ary['error_code'][] = $db->_sql_error(); + } + + $db->sql_return_on_error(false); + + if ($echo_dot) + { + echo ". \n"; + flush(); + } + + return $result; +} + +function _write_result($no_updates, $errored, $error_ary) +{ + global $lang; + + if ($no_updates) + { + echo ' ' . $lang['NO_UPDATES_REQUIRED'] . '</strong></p>'; + } + else + { + echo ' <span class="success">' . $lang['DONE'] . '</span></strong><br />' . $lang['RESULT'] . ' :: '; + + if ($errored) + { + echo ' <strong>' . $lang['SOME_QUERIES_FAILED'] . '</strong> <ul>'; + + for ($i = 0; $i < sizeof($error_ary['sql']); $i++) + { + echo '<li>' . $lang['ERROR'] . ' :: <strong>' . $error_ary['error_code'][$i]['message'] . '</strong><br />'; + echo $lang['SQL'] . ' :: <strong>' . $error_ary['sql'][$i] . '</strong><br /><br /></li>'; + } + + echo '</ul> <br /><br />' . $lang['SQL_FAILURE_EXPLAIN'] . '</p>'; + } + else + { + echo '<strong>' . $lang['NO_ERRORS'] . '</strong></p>'; + } + } +} + +/** +* Check if a specified column exist +*/ +function column_exists($dbms, $table, $column_name) +{ + global $db; + + $db->sql_return_on_error(true); + + $sql = "SELECT $column_name FROM $table"; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $error = ($db->sql_error_triggered) ? true : false; + + $db->sql_return_on_error(false); + + return (!$error) ? true : false; +} + +/** +* Function to prepare some column informations for better usage +*/ +function prepare_column_data($dbms, $column_data) +{ + global $dbms_type_map, $unsigned_types; + + // Get type + if (strpos($column_data[0], ':') !== false) + { + list($orig_column_type, $column_length) = explode(':', $column_data[0]); + + if (!is_array($dbms_type_map[$dbms][$orig_column_type . ':'])) + { + $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'], $column_length); + } + else + { + if (isset($dbms_type_map[$dbms][$orig_column_type . ':']['rule'])) + { + switch ($dbms_type_map[$dbms][$orig_column_type . ':']['rule'][0]) + { + case 'div': + $column_length /= $dbms_type_map[$dbms][$orig_column_type . ':']['rule'][1]; + $column_length = ceil($column_length); + $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'][0], $column_length); + break; + } + } + + if (isset($dbms_type_map[$dbms][$orig_column_type . ':']['limit'])) + { + switch ($dbms_type_map[$dbms][$orig_column_type . ':']['limit'][0]) + { + case 'mult': + $column_length *= $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][1]; + if ($column_length > $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][2]) + { + $column_type = $dbms_type_map[$dbms][$orig_column_type . ':']['limit'][3]; + } + else + { + $column_type = sprintf($dbms_type_map[$dbms][$orig_column_type . ':'][0], $column_length); + } + break; + } + } + } + $orig_column_type .= ':'; + } + else + { + $orig_column_type = $column_data[0]; + $column_type = $dbms_type_map[$dbms][$column_data[0]]; + } + + // Adjust default value if db-dependant specified + if (is_array($column_data[1])) + { + $column_data[1] = (isset($column_data[1][$dbms])) ? $column_data[1][$dbms] : $column_data[1]['default']; + } + + $sql = ''; + + switch ($dbms) + { + case 'firebird': + $sql .= " {$column_type} "; + + if (!is_null($column_data[1])) + { + $sql .= 'DEFAULT ' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' '; + } + + $sql .= 'NOT NULL'; + + // This is a UNICODE column and thus should be given it's fair share + if (preg_match('/^X?STEXT_UNI|VCHAR_(CI|UNI:?)/', $column_data[0])) + { + $sql .= ' COLLATE UNICODE'; + } + + break; + + case 'mssql': + $sql .= " {$column_type} "; + + if (!is_null($column_data[1])) + { + // For hexadecimal values do not use single quotes + if (strpos($column_data[1], '0x') === 0) + { + $sql .= 'DEFAULT (' . $column_data[1] . ') '; + } + else + { + $sql .= 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') '; + } + } + + $sql .= 'NOT NULL'; + break; + + case 'mysql_40': + case 'mysql_41': + $sql .= " {$column_type} "; + + // For hexadecimal values do not use single quotes + if (!is_null($column_data[1])) + { + $sql .= (strpos($column_data[1], '0x') === 0) ? "DEFAULT {$column_data[1]} " : "DEFAULT '{$column_data[1]}' "; + } + $sql .= 'NOT NULL'; + break; + + case 'oracle': + $sql .= " {$column_type} "; + $sql .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}' " : ''; + + // In Oracle empty strings ('') are treated as NULL. + // Therefore in oracle we allow NULL's for all DEFAULT '' entries + $sql .= ($column_data[1] === '') ? '' : 'NOT NULL'; + break; + + case 'postgres': + $sql .= " {$column_type} "; + + $sql .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}' " : ''; + $sql .= 'NOT NULL'; + + // Unsigned? Then add a CHECK contraint + if (in_array($orig_column_type, $unsigned_types)) + { + $sql .= " CHECK ({$column_name} >= 0)"; + } + break; + + case 'sqlite': + $sql .= ' ' . $column_type . ' NOT NULL '; + $sql .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}'" : ''; + break; + } + + return array( + 'column_type_sql' => $sql, + ); +} + +/** +* Add new column +*/ +function sql_column_add($dbms, $table_name, $column_name, $column_data) +{ + global $errored, $error_ary; + + $column_data = prepare_column_data($dbms, $column_data); + + switch ($dbms) + { + case 'firebird': + $sql = 'ALTER TABLE "' . $table_name . '" ADD "' . $column_name . '" ' . $column_data['column_type_sql']; + _sql($sql, $errored, $error_ary); + break; + + case 'mssql': + $sql = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql']; + _sql($sql, $errored, $error_ary); + break; + + case 'mysql_40': + case 'mysql_41': + $sql = 'ALTER TABLE `' . $table_name . '` ADD COLUMN `' . $column_name . '` ' . $column_data['column_type_sql']; + _sql($sql, $errored, $error_ary); + break; + + case 'oracle': + $sql = 'ALTER TABLE ' . $table_name . ' ADD ' . $column_name . ' ' . $coumn_data['column_type_sql']; + _sql($sql, $errored, $error_ary); + break; + + case 'postgres': + $sql = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type_sql']; + _sql($sql, $errored, $error_ary); + break; + + case 'sqlite': + if (version_compare(sqlite_libversion(), '3.0') == -1) + { + $sql = "SELECT sql + FROM sqlite_master + WHERE type = 'table' + AND name = '{$table_name}' + ORDER BY type DESC, name;"; + $result = _sql($sql, $errored, $error_ary); + + if (!$result) + { + break; + } + + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $db->sql_transaction('begin'); + + // Create a backup table and populate it, destroy the existing one + $db->sql_query(preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $row['sql'])); + $db->sql_query('INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name); + $db->sql_query('DROP TABLE ' . $table_name); + + preg_match('#\((.*)\)#s', $row['sql'], $matches); + + $new_table_cols = trim($matches[1]); + $old_table_cols = preg_split('/,(?=[\\sa-z])/im', $new_table_cols); + $column_list = array(); + + foreach ($old_table_cols as $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + if ($entities == 'PRIMARY') + { + continue; + } + $column_list[] = $entities[0]; + } + + $columns = implode(',', $column_list); + + $new_table_cols = $column_name . ' ' . $column_data['column_type_sql'] . ',' . $new_table_cols; + + // create a new table and fill it up. destroy the temp one + $db->sql_query('CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');'); + $db->sql_query('INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'); + $db->sql_query('DROP TABLE ' . $table_name . '_temp'); + + $db->sql_transaction('commit'); + } + else + { + $sql = 'ALTER TABLE ' . $table_name . ' ADD ' . $column_name . ' [' . $colum_data['column_type_sql'] . ']'; + _sql($sql, $errored, $error_ary); + } + break; + } +} + +/** +* Change column type (not name!) +*/ +function sql_column_change($dbms, $table_name, $column_name, $column_data) +{ + global $dbms_type_map, $db; + + $column_data = prepare_column_data($dbms, $column_data); + + switch ($dbms) + { + case 'firebird': + // Change type... + $sql = 'ALTER TABLE "' . $table_name . '" ALTER COLUMN "' . $column_name . '" TYPE ' . ' ' . $column_data['column_type_sql']; + _sql($sql, $errored, $error_ary); + break; + + case 'mssql': + $sql = 'ALTER TABLE [' . $table_name . '] ALTER COLUMN [' . $column_name . '] ' . $column_data['column_type_sql']; + _sql($sql, $errored, $error_ary); + break; + + case 'mysql_40': + case 'mysql_41': + $sql = 'ALTER TABLE `' . $table_name . '` CHANGE `' . $column_name . '` `' . $column_name . '` ' . $column_data['column_type_sql']; + _sql($sql, $errored, $error_ary); + break; + + case 'oracle': + $sql = 'ALTER TABLE ' . $table_name . ' MODIFY ' . $column_name . ' ' . $column_data['column_type_sql']; + _sql($sql, $errored, $error_ary); + break; + + case 'postgres': + $sql = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET ' . $column_data['column_type_sql']; + _sql($sql, $errored, $error_ary); + break; + + case 'sqlite': + + $sql = "SELECT sql + FROM sqlite_master + WHERE type = 'table' + AND name = '{$table_name}' + ORDER BY type DESC, name;"; + $result = _sql($sql, $errored, $error_ary); + + if (!$result) + { + break; + } + + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $db->sql_transaction('begin'); + + // Create a temp table and populate it, destroy the existing one + $db->sql_query(preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $row['sql'])); + $db->sql_query('INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name); + $db->sql_query('DROP TABLE ' . $table_name); + + preg_match('#\((.*)\)#s', $row['sql'], $matches); + + $new_table_cols = trim($matches[1]); + $old_table_cols = preg_split('/,(?=[\\sa-z])/im', $new_table_cols); + $column_list = array(); + + foreach ($old_table_cols as $key => $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + $column_list[] = $entities[0]; + if ($entities[0] == $column_name) + { + $old_table_cols[$key] = $column_name . ' ' . $column_data['column_type_sql']; + } + } + + $columns = implode(',', $column_list); + + // create a new table and fill it up. destroy the temp one + $db->sql_query('CREATE TABLE ' . $table_name . ' (' . implode(',', $old_table_cols) . ');'); + $db->sql_query('INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'); + $db->sql_query('DROP TABLE ' . $table_name . '_temp'); + + $db->sql_transaction('commit'); + + break; + } +} + +?>
\ No newline at end of file diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 9a542dc2df..eaa0ff12d4 100755 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -8,10 +8,12 @@ * */ -/** +/**#@+ +* @ignore */ define('IN_PHPBB', true); define('IN_INSTALL', true); +/**#@-*/ $phpbb_root_path = './../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); @@ -110,17 +112,18 @@ include($phpbb_root_path . 'includes/template.' . $phpEx); include($phpbb_root_path . 'includes/acm/acm_file.' . $phpEx); include($phpbb_root_path . 'includes/cache.' . $phpEx); include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); +include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); // Try and load an appropriate language if required $language = request_var('language', ''); if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language) { - $accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); + $accept_lang_ary = explode(',', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE'])); foreach ($accept_lang_ary as $accept_lang) { - // Set correct format ... guess full xx_YY form - $accept_lang = substr($accept_lang, 0, 2) . '_' . strtoupper(substr($accept_lang, 3, 2)); + // Set correct format ... guess full xx_yy form + $accept_lang = substr($accept_lang, 0, 2) . '_' . substr($accept_lang, 3, 2); if (file_exists($phpbb_root_path . 'language/' . $accept_lang)) { @@ -129,7 +132,7 @@ if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language) } else { - // No match on xx_YY so try xx + // No match on xx_yy so try xx $accept_lang = substr($accept_lang, 0, 2); if (file_exists($phpbb_root_path . 'language/' . $accept_lang)) { @@ -173,7 +176,7 @@ set_error_handler('msg_handler'); $user = new user(); $auth = new auth(); $cache = new cache(); -$template = new Template(); +$template = new template(); $template->set_custom_template('../adm/style', 'admin'); $template->assign_var('T_TEMPLATE_PATH', '../adm/style'); @@ -212,7 +215,7 @@ class module */ function create($module_type, $module_url, $selected_mod = false, $selected_submod = false) { - global $db, $config, $phpEx; + global $db, $config, $phpEx, $phpbb_root_path; $module = array(); @@ -285,10 +288,13 @@ class module $this->mode = $mode; } - /** - * @todo this could be written as $this->module = new $this->filename($this); ... no? (eval statement in install/index.php) - */ - eval("\$this->module = new $this->filename(\$this);"); + $module = $this->filename; + if (!class_exists($module)) + { + $this->error('Module not accessible', __LINE__, __FILE__); + } + $this->module = new $module($this); + if (method_exists($this->module, 'main')) { $this->module->main($this->mode, $this->sub); @@ -307,25 +313,24 @@ class module } define('HEADER_INC', true); - global $template, $lang, $stage; + global $template, $lang, $stage, $phpbb_root_path; $template->assign_vars(array( 'L_CHANGE' => $lang['CHANGE'], 'L_INSTALL_PANEL' => $lang['INSTALL_PANEL'], 'L_SELECT_LANG' => $lang['SELECT_LANG'], 'PAGE_TITLE' => $this->get_page_title(), + 'T_IMAGE_PATH' => $phpbb_root_path . 'adm/images/', 'S_CONTENT_DIRECTION' => $lang['DIRECTION'], - 'S_CONTENT_ENCODING' => $lang['ENCODING'], + 'S_CONTENT_ENCODING' => 'UTF-8', 'S_CONTENT_DIR_LEFT' => $lang['LEFT'], 'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'], + 'S_USER_LANG' => $lang['USER_LANG'], ) ); - if (!empty($lang['ENCODING'])) - { - header('Content-type: text/html; charset: ' . $lang['ENCODING']); - } + header('Content-type: text/html; charset=UTF-8'); header('Cache-Control: private, no-cache="set-cookie"'); header('Expires: 0'); header('Pragma: no-cache'); @@ -343,7 +348,7 @@ class module $template->display('body'); // Close our DB connection. - if (isset($db)) + if (!empty($db) && is_object($db)) { $db->sql_close(); } @@ -532,7 +537,7 @@ class module echo '</body>'; echo '</html>'; - if (isset($db)) + if (!empty($db) && is_object($db)) { $db->sql_close(); } @@ -658,8 +663,8 @@ class module if (file_exists($path . '/iso.txt')) { - list($displayname) = @file($path . '/iso.txt'); - $lang[$displayname] = $file; + list($displayname, $localname) = @file($path . '/iso.txt'); + $lang[$localname] = $file; } } @closedir($dir); diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index e0c90e619b..c282f867a0 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -19,6 +19,17 @@ if ( !defined('IN_INSTALL') ) if (!empty($setmodules)) { + // If phpBB is already installed we do not include this module + if (@file_exists($phpbb_root_path . 'config.' . $phpEx) && !file_exists($phpbb_root_path . 'cache/install_lock')) + { + include_once($phpbb_root_path . 'config.' . $phpEx); + + if (defined('PHPBB_INSTALLED')) + { + return; + } + } + $module[] = array( 'module_type' => 'install', 'module_title' => 'INSTALL', @@ -43,7 +54,7 @@ class install_install extends module function main($mode, $sub) { - global $lang, $template, $language; + global $lang, $template, $language, $phpbb_root_path; switch ($sub) { @@ -95,7 +106,10 @@ class install_install extends module $this->add_language($mode, $sub); $this->add_bots($mode, $sub); $this->email_admin($mode, $sub); - + + // Remove the lock file + @unlink($phpbb_root_path . 'cache/install_lock'); + break; } @@ -390,7 +404,7 @@ class install_install extends module // Obtain any submitted data foreach ($this->request_vars as $var) { - $$var = request_var($var, ''); + $$var = (in_array($var, array('admin_name', 'dbpasswd', 'admin_pass1', 'admin_pass2'))) ? request_var($var, '', true) : request_var($var, ''); } $connect_test = false; @@ -407,7 +421,7 @@ class install_install extends module } } - $dbpasswd = html_entity_decode($dbpasswd); + $dbpasswd = htmlspecialchars_decode($dbpasswd); $connect_test = $this->connect_check_db(true, $error, $dbms, $table_prefix, $dbhost, $dbuser, $dbpasswd, $dbname, $dbport); @@ -532,19 +546,21 @@ class install_install extends module // Obtain any submitted data foreach ($this->request_vars as $var) { - $$var = request_var($var, ''); + $$var = (in_array($var, array('admin_name', 'dbpasswd', 'admin_pass1', 'admin_pass2'))) ? request_var($var, '', true) : request_var($var, ''); } if ($dbms == '') { // Someone's been silly and tried calling this page direct // So we send them back to the start to do it again properly - $this->p_master->redirect("index?mode=install"); + $this->p_master->redirect("index.$phpEx?mode=install"); } $s_hidden_fields = ($img_imagick) ? '<input type="hidden" name="img_imagick" value="' . addslashes($img_imagick) . '" />' : ''; $passed = false; + $default_lang = ($default_lang !== '') ? $default_lang : $language; + if (isset($_POST['check'])) { $error = array(); @@ -561,23 +577,23 @@ class install_install extends module } // Test against the default username rules - if ($admin_name != '' && strlen($admin_name) < 3) + if ($admin_name != '' && utf8_strlen($admin_name) < 3) { $error[] = $lang['INST_ERR_USER_TOO_SHORT']; } - if ($admin_name != '' && strlen($admin_name) > 20) + if ($admin_name != '' && utf8_strlen($admin_name) > 20) { $error[] = $lang['INST_ERR_USER_TOO_LONG']; } // Test against the default password rules - if ($admin_pass1 != '' && strlen($admin_pass1) < 6) + if ($admin_pass1 != '' && utf8_strlen($admin_pass1) < 6) { $error[] = $lang['INST_ERR_PASSWORD_TOO_SHORT']; } - if ($admin_pass1 != '' && strlen($admin_pass1) > 30) + if ($admin_pass1 != '' && utf8_strlen($admin_pass1) > 30) { $error[] = $lang['INST_ERR_PASSWORD_TOO_LONG']; } @@ -587,7 +603,7 @@ class install_install extends module $error[] = $lang['INST_ERR_EMAIL_MISMATCH']; } - if ($board_email1 != '' && !preg_match('#^[a-z0-9\.\-_\+]+?@(.*?\.)*?[a-z0-9\-_]+?\.[a-z]{2,4}$#i', $board_email1)) + if ($board_email1 != '' && !preg_match('/^' . get_preg_expression('email') . '$/i', $board_email1)) { $error[] = $lang['INST_ERR_EMAIL_INVALID']; } @@ -702,14 +718,14 @@ class install_install extends module // Obtain any submitted data foreach ($this->request_vars as $var) { - $$var = request_var($var, ''); + $$var = (in_array($var, array('admin_name', 'dbpasswd', 'admin_pass1', 'admin_pass2'))) ? request_var($var, '', true) : request_var($var, ''); } if ($dbms == '') { // Someone's been silly and tried calling this page direct // So we send them back to the start to do it again properly - $this->p_master->redirect("index?mode=install"); + $this->p_master->redirect("index.$phpEx?mode=install"); } $s_hidden_fields = ($img_imagick) ? '<input type="hidden" name="img_imagick" value="' . addslashes($img_imagick) . '" />' : ''; @@ -732,13 +748,22 @@ class install_install extends module } } - $dbpasswd = html_entity_decode($dbpasswd); + // Create a lock file to indicate that there is an install in progress + $fp = @fopen($phpbb_root_path . 'cache/install_lock', 'wb'); + if ($fp === false) + { + // We were unable to create the lock file - abort + $this->p_master->error($lang['UNABLE_WRITE_LOCK'], __LINE__, __FILE__); + } + @fclose($fp); + + $dbpasswd = htmlspecialchars_decode($dbpasswd); $load_extensions = implode(',', $load_extensions); // Time to convert the data provided into a config file $config_data = "<?php\n"; $config_data .= "// phpBB 3.0.x auto-generated configuration file\n// Do not change anything in this file!\n"; - $config_data .= "\$dbms = '$dbms';\n"; + $config_data .= "\$dbms = '" . $this->available_dbms[$dbms]['DRIVER'] . "';\n"; $config_data .= "\$dbhost = '$dbhost';\n"; $config_data .= "\$dbport = '$dbport';\n"; $config_data .= "\$dbname = '$dbname';\n"; @@ -748,9 +773,9 @@ class install_install extends module // $config_data .= "\$acm_type = '" . (($acm_type) ? $acm_type : 'file') . "';\n"; $config_data .= "\$acm_type = 'file';\n"; $config_data .= "\$load_extensions = '$load_extensions';\n\n"; - $config_data .= "define('PHPBB_INSTALLED', true);\n"; - $config_data .= "define('DEBUG', true);\n"; // @todo Comment out when final - $config_data .= "define('DEBUG_EXTRA', true);\n"; // @todo Comment out when final + $config_data .= "@define('PHPBB_INSTALLED', true);\n"; + $config_data .= "@define('DEBUG', true);\n"; // @todo Comment out when final + $config_data .= "@define('DEBUG_EXTRA', true);\n"; // @todo Comment out when final $config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! // Attempt to write out the config file directly. If it works, this is the easiest way to do it ... @@ -848,14 +873,14 @@ class install_install extends module // Obtain any submitted data foreach ($this->request_vars as $var) { - $$var = request_var($var, ''); + $$var = (in_array($var, array('admin_name', 'dbpasswd', 'admin_pass1', 'admin_pass2'))) ? request_var($var, '', true) : request_var($var, ''); } if ($dbms == '') { // Someone's been silly and tried calling this page direct // So we send them back to the start to do it again properly - $this->p_master->redirect("index?mode=install"); + $this->p_master->redirect("index.$phpEx?mode=install"); } $s_hidden_fields = ($img_imagick) ? '<input type="hidden" name="img_imagick" value="' . addslashes($img_imagick) . '" />' : ''; @@ -866,7 +891,7 @@ class install_install extends module $server_port = ($server_port !== '') ? $server_port : ((!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT')); $server_protocol = ($server_protocol !== '') ? $server_protocol : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://'); $cookie_secure = ($cookie_secure !== '') ? $cookie_secure : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? true : false); - + foreach ($this->advanced_config_options as $config_key => $vars) { if (!is_array($vars) && strpos($config_key, 'legend') === false) @@ -927,41 +952,61 @@ class install_install extends module global $db, $lang, $template, $phpbb_root_path, $phpEx; $this->page_title = $lang['STAGE_CREATE_TABLE']; + $s_hidden_fields = ''; // Obtain any submitted data foreach ($this->request_vars as $var) { - $$var = request_var($var, ''); + $$var = (in_array($var, array('admin_name', 'dbpasswd', 'admin_pass1', 'admin_pass2'))) ? request_var($var, '', true) : request_var($var, ''); } if ($dbms == '') { // Someone's been silly and tried calling this page direct // So we send them back to the start to do it again properly - $this->p_master->redirect("index?mode=install"); + $this->p_master->redirect("index.$phpEx?mode=install"); } $cookie_domain = ($server_name != '') ? $server_name : (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'); + // Try to come up with the best solution for cookie domain... + if (strpos($cookie_domain, 'www.') === 0) + { + $cookie_domain = str_replace('www.', '.', $cookie_domain); + } + // If we get here and the extension isn't loaded it should be safe to just go ahead and load it if (!@extension_loaded($this->available_dbms[$dbms]['MODULE'])) { @dl($this->available_dbms[$dbms]['MODULE'] . ".$prefix"); } - $dbpasswd = html_entity_decode($dbpasswd); + $dbpasswd = htmlspecialchars_decode($dbpasswd); // Load the appropriate database class if not already loaded - include($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); + include($phpbb_root_path . 'includes/db/' . $this->available_dbms[$dbms]['DRIVER'] . '.' . $phpEx); // Instantiate the database - $sql_db = 'dbal_' . $dbms; + $sql_db = 'dbal_' . $this->available_dbms[$dbms]['DRIVER']; $db = new $sql_db(); $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false); // NOTE: trigger_error does not work here. $db->return_on_error = true; + // If mysql is chosen, we need to adjust the schema filename slightly to reflect the correct version. ;) + if ($dbms == 'mysql') + { + if (version_compare($db->mysql_version, '4.1.3', '>=')) + { + $this->available_dbms[$dbms]['SCHEMA'] .= '_41'; + } + else + { + $this->available_dbms[$dbms]['SCHEMA'] .= '_40'; + } + } + // Ok we have the db info go ahead and read in the relevant schema // and work on building the table $dbms_schema = 'schemas/' . $this->available_dbms[$dbms]['SCHEMA'] . '_schema.sql'; @@ -972,25 +1017,6 @@ class install_install extends module $sql_query = @file_get_contents($dbms_schema); - switch ($dbms) - { - case 'mysql': - case 'mysql4': - // We don't want MySQL mixing up collations - if (version_compare(mysql_get_server_info(), '4.1.2', '>=')) - { - $sql_query = preg_replace('/^\);$/m', ') DEFAULT CHARACTER SET latin1;', $sql_query); - } - - break; - - case 'mysqli': - // mysqli only works with MySQL > 4.1.3 so we'll just do a straight replace if using this DBMS - $sql_query = preg_replace('/^\);$/m', ') DEFAULT CHARACTER SET latin1;', $sql_query); - - break; - } - $sql_query = preg_replace('#phpbb_#i', $table_prefix, $sql_query); $remove_remarks($sql_query); @@ -1011,7 +1037,7 @@ class install_install extends module // Ok tables have been built, let's fill in the basic information $sql_query = file_get_contents('schemas/schema_data.sql'); - // Deal with any special comments and with MySQL < 4.1.2 + // Deal with any special comments switch ($dbms) { case 'mssql': @@ -1043,10 +1069,12 @@ class install_install extends module $current_time = time(); + $user_ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : ''; + // Set default config and post data, this applies to all DB's $sql_ary = array( 'INSERT INTO ' . $table_prefix . "config (config_name, config_value) - VALUES ('board_startdate', $current_time)", + VALUES ('board_startdate', '$current_time')", 'INSERT INTO ' . $table_prefix . "config (config_name, config_value) VALUES ('default_lang', '" . $db->sql_escape($default_lang) . "')", @@ -1128,7 +1156,7 @@ class install_install extends module WHERE config_name = 'newest_username'", 'UPDATE ' . $table_prefix . "users - SET username = '" . $db->sql_escape($admin_name) . "', user_password='" . $db->sql_escape(md5($admin_pass1)) . "', user_lang = '" . $db->sql_escape($default_lang) . "', user_email='" . $db->sql_escape($board_email1) . "', user_dateformat='" . $db->sql_escape($lang['default_dateformat']) . "', user_email_hash = '" . (int) (crc32(strtolower($board_email1)) . strlen($board_email1)) . "' + SET username = '" . $db->sql_escape($admin_name) . "', user_password='" . $db->sql_escape(md5($admin_pass1)) . "', user_ip = '" . $db->sql_escape($user_ip) . "', user_lang = '" . $db->sql_escape($default_lang) . "', user_email='" . $db->sql_escape($board_email1) . "', user_dateformat='" . $db->sql_escape($lang['default_dateformat']) . "', user_email_hash = " . (int) (crc32(strtolower($board_email1)) . strlen($board_email1)) . ", username_clean = '" . $db->sql_escape(utf8_clean_string($admin_name)) . "' WHERE username = 'Admin'", 'UPDATE ' . $table_prefix . "moderator_cache @@ -1148,7 +1176,7 @@ class install_install extends module SET user_regdate = $current_time", 'UPDATE ' . $table_prefix . "posts - SET post_time = $current_time", + SET post_time = $current_time, poster_ip = '" . $db->sql_escape($user_ip) . "'", 'UPDATE ' . $table_prefix . "topics SET topic_time = $current_time, topic_last_post_time = $current_time", @@ -1157,12 +1185,12 @@ class install_install extends module SET forum_last_post_time = $current_time", ); - // This is for people who have TTF disabled - if (!(@function_exists('imagettfbbox') && @function_exists('imagettftext'))) + // This is for people who have TTF and GD + if (@extension_loaded('gd') && function_exists('imagettfbbox') && function_exists('imagettftext')) { $sql_ary[] = 'UPDATE ' . $table_prefix . "config - SET config_value = '0' - WHERE config_name = 'policy_shape'"; + SET config_value = '1' + WHERE config_name = 'captcha_gd'"; } foreach ($sql_ary as $sql) @@ -1203,16 +1231,16 @@ class install_install extends module // Obtain any submitted data foreach ($this->request_vars as $var) { - $$var = request_var($var, ''); + $$var = (in_array($var, array('admin_name', 'dbpasswd', 'admin_pass1', 'admin_pass2'))) ? request_var($var, '', true) : request_var($var, ''); } - $dbpasswd = html_entity_decode($dbpasswd); + $dbpasswd = htmlspecialchars_decode($dbpasswd); // Load the appropriate database class if not already loaded - include($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); + include($phpbb_root_path . 'includes/db/' . $this->available_dbms[$dbms]['DRIVER'] . '.' . $phpEx); // Instantiate the database - $sql_db = 'dbal_' . $dbms; + $sql_db = 'dbal_' . $this->available_dbms[$dbms]['DRIVER']; $db = new $sql_db(); $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false); @@ -1353,7 +1381,7 @@ class install_install extends module $_module->move_module_by($row, 'move_up', 4); - // Move manage users screen module 4 up... + // Move manage users screen module 5 up... $sql = 'SELECT * FROM ' . MODULES_TABLE . " WHERE module_basename = 'users' @@ -1363,7 +1391,22 @@ class install_install extends module $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - $_module->move_module_by($row, 'move_up', 4); + $_module->move_module_by($row, 'move_up', 5); + } + + if ($module_class == 'ucp') + { + // Move attachment module 4 down... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'attachments' + AND module_class = 'ucp' + AND module_mode = 'attachments'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_down', 4); } // And now for the special ones @@ -1457,7 +1500,7 @@ class install_install extends module // Obtain any submitted data foreach ($this->request_vars as $var) { - $$var = request_var($var, ''); + $$var = (in_array($var, array('admin_name', 'dbpasswd', 'admin_pass1', 'admin_pass2'))) ? request_var($var, '', true) : request_var($var, ''); } // Fill the config array - it is needed by those functions we call @@ -1539,7 +1582,7 @@ class install_install extends module // Obtain any submitted data foreach ($this->request_vars as $var) { - $$var = request_var($var, ''); + $$var = (in_array($var, array('admin_name', 'dbpasswd', 'admin_pass1', 'admin_pass2'))) ? request_var($var, '', true) : request_var($var, ''); } // Load the basic configuration data @@ -1581,10 +1624,8 @@ class install_install extends module $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); $messenger->assign_vars(array( - 'USERNAME' => html_entity_decode($admin_name), - 'PASSWORD' => html_entity_decode($admin_pass1), - 'U_BOARD' => generate_board_url(), - 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])) + 'USERNAME' => htmlspecialchars_decode($admin_name), + 'PASSWORD' => htmlspecialchars_decode($admin_pass1)) ); $messenger->send(NOTIFY_EMAIL); @@ -1595,7 +1636,7 @@ class install_install extends module $template->assign_vars(array( 'TITLE' => $lang['INSTALL_CONGRATS'], - 'BODY' => sprintf($lang['INSTALL_CONGRATS_EXPLAIN'], '<a href="../docs/README.html" target="_blank">', '</a>'), + 'BODY' => sprintf($lang['INSTALL_CONGRATS_EXPLAIN'], '<a href="../docs/README.html">', '</a>'), 'L_SUBMIT' => $lang['INSTALL_LOGIN'], 'U_ACTION' => append_sid($phpbb_root_path . 'adm/index.' . $phpEx), )); @@ -1620,10 +1661,10 @@ class install_install extends module global $phpbb_root_path, $phpEx, $config, $lang; // Include the DB layer - include($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); + include($phpbb_root_path . 'includes/db/' . $this->available_dbms[$dbms]['DRIVER'] . '.' . $phpEx); // Instantiate it and set return on error true - $sql_db = 'dbal_' . $dbms; + $sql_db = 'dbal_' . $this->available_dbms[$dbms]['DRIVER']; $db = new $sql_db(); $db->sql_return_on_error(true); @@ -1641,32 +1682,35 @@ class install_install extends module return false; } - // Check the prefix length to ensure that index names are not too long + // Check the prefix length to ensure that index names are not too long and does not contain invalid characters switch ($dbms) { case 'mysql': - case 'mysql4': case 'mysqli': + if (strpos($table_prefix, '-') !== false) + { + $error[] = $lang['INST_ERR_PREFIX_INVALID']; + return false; + } + + // no break; + case 'postgres': $prefix_length = 36; - break; case 'mssql': case 'mssql_odbc': $prefix_length = 90; - break; - case 'oracle': case 'sqlite': $prefix_length = 200; - break; case 'firebird': + case 'oracle': $prefix_length = 6; - break; } @@ -1687,13 +1731,18 @@ class install_install extends module switch ($dbms) { case 'mysql': - case 'mysql4': case 'mysqli': - case 'sqlite': - $sql = "SHOW TABLES"; + $sql = 'SHOW TABLES'; $field = "Tables_in_{$dbname}"; break; + case 'sqlite': + $sql = 'SELECT name + FROM sqlite_master + WHERE type = "table"'; + $field = 'name'; + break; + case 'mssql': case 'mssql_odbc': $sql = "SELECT name @@ -1719,7 +1768,8 @@ class install_install extends module break; case 'oracle': - $sql = 'SELECT table_name FROM USER_TABLES'; + $sql = 'SELECT table_name + FROM USER_TABLES'; $field = 'table_name'; break; } @@ -1746,20 +1796,89 @@ class install_install extends module // Make sure that the user has selected a sensible DBAL for the DBMS actually installed switch ($dbms) { - case 'mysql4': - if (version_compare(mysql_get_server_info($db->db_connect_id), '4.0.0', '<')) + case 'mysqli': + if (version_compare(mysqli_get_server_info($db->db_connect_id), '4.1.3', '<')) { - $error[] = $lang['INST_ERR_DB_NO_MYSQL4']; + $error[] = $lang['INST_ERR_DB_NO_MYSQLI']; } - break; case 'mysqli': - if (version_compare(mysqli_get_server_info($db->db_connect_id), '4.1.3', '<')) + if (version_compare(sqlite_libversion(), '2.8.2', '<')) { - $error[] = $lang['INST_ERR_DB_NO_MYSQLI']; + $error[] = $lang['INST_ERR_DB_NO_SQLITE']; + } + break; + + case 'firebird': + // check the version of FB, use some hackery if we can't get access to the server info + if ($db->service_handle !== false && function_exists('ibase_server_info')) + { + $val = @ibase_server_info($db->service_handle, IBASE_SVC_SERVER_VERSION); + preg_match('#V([\d.]+)#', $val, $match); + if ($match[1] < 2) + { + $error[] = $lang['INST_ERR_DB_NO_FIREBIRD']; + } + } + else + { + $sql = "SELECT * + FROM RDB$FUNCTIONS + WHERE RDB$SYSTEM_FLAG IS NULL + AND RDB$FUNCTION_NAME = 'CHAR_LENGTH'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + // if its a UDF, its too old + if ($row) + { + $error[] = $lang['INST_ERR_DB_NO_FIREBIRD']; + } + else + { + $sql = "SELECT FIRST 0 char_length('') + FROM RDB\$DATABASE"; + $result = $db->sql_query($sql); + if (!$result) // This can only fail if char_length is not defined + { + $error[] = $lang['INST_ERR_DB_NO_FIREBIRD']; + } + $db->sql_freeresult($result); + } } + break; + case 'oracle': + $sql = "SELECT * + FROM NLS_DATABASE_PARAMETERS + WHERE PARAMETER = 'NLS_RDBMS_VERSION' + OR PARAMETER = 'NLS_CHARACTERSET'"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $stats[$row['parameter']] = $row['value']; + } + $db->sql_freeresult($result); + + if (version_compare($stats['NLS_RDBMS_VERSION'], '9.2', '<') && $stats['NLS_CHARACTERSET'] !== 'UTF8') + { + $error[] = $lang['INST_ERR_DB_NO_ORACLE']; + } + break; + + case 'postgres': + $sql = "SHOW server_encoding;"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row['server_encoding'] !== 'UNICODE' && $row['server_encoding'] !== 'UTF8') + { + $error[] = $lang['INST_ERR_DB_NO_POSTGRES']; + } break; } @@ -1854,7 +1973,7 @@ class install_install extends module /** * Specific PHP modules we may require for certain optional or extended features */ - var $php_dlls_other = array('zlib', 'ftp', 'xml'); + var $php_dlls_other = array('zlib', 'ftp', 'gd', 'xml'); /** * Details of the database management systems supported @@ -1865,63 +1984,64 @@ class install_install extends module 'SCHEMA' => 'firebird', 'MODULE' => 'interbase', 'DELIM' => ';;', - 'COMMENTS' => 'remove_remarks' + 'COMMENTS' => 'remove_remarks', + 'DRIVER' => 'firebird' ), 'mysqli' => array( - 'LABEL' => 'MySQL 4.1.x/5.x (MySQLi)', - 'SCHEMA' => 'mysql', + 'LABEL' => 'MySQL with MySQLi Extension', + 'SCHEMA' => 'mysql_41', 'MODULE' => 'mysqli', 'DELIM' => ';', - 'COMMENTS' => 'remove_remarks' - ), - 'mysql4' => array( - 'LABEL' => 'MySQL 4.x/5.x', - 'SCHEMA' => 'mysql', - 'MODULE' => 'mysql', - 'DELIM' => ';', - 'COMMENTS' => 'remove_remarks' + 'COMMENTS' => 'remove_remarks', + 'DRIVER' => 'mysqli' ), 'mysql' => array( 'LABEL' => 'MySQL', 'SCHEMA' => 'mysql', 'MODULE' => 'mysql', 'DELIM' => ';', - 'COMMENTS' => 'remove_remarks' + 'COMMENTS' => 'remove_remarks', + 'DRIVER' => 'mysql' ), 'mssql' => array( 'LABEL' => 'MS SQL Server 2000+', 'SCHEMA' => 'mssql', 'MODULE' => 'mssql', 'DELIM' => 'GO', - 'COMMENTS' => 'remove_comments' + 'COMMENTS' => 'remove_comments', + 'DRIVER' => 'mssql' ), 'mssql_odbc'=> array( 'LABEL' => 'MS SQL Server [ ODBC ]', 'SCHEMA' => 'mssql', 'MODULE' => 'odbc', 'DELIM' => 'GO', - 'COMMENTS' => 'remove_comments' + 'COMMENTS' => 'remove_comments', + 'DRIVER' => 'mssql_odbc' ), 'oracle' => array( 'LABEL' => 'Oracle', 'SCHEMA' => 'oracle', 'MODULE' => 'oci8', 'DELIM' => '/', - 'COMMENTS' => 'remove_comments' + 'COMMENTS' => 'remove_comments', + 'DRIVER' => 'oracle' ), 'postgres' => array( 'LABEL' => 'PostgreSQL 7.x/8.x', 'SCHEMA' => 'postgres', 'MODULE' => 'pgsql', 'DELIM' => ';', - 'COMMENTS' => 'remove_comments' + 'COMMENTS' => 'remove_comments', + 'DRIVER' => 'postgres' ), 'sqlite' => array( 'LABEL' => 'SQLite', 'SCHEMA' => 'sqlite', 'MODULE' => 'sqlite', 'DELIM' => ';', - 'COMMENTS' => 'remove_remarks' + 'COMMENTS' => 'remove_remarks', + 'DRIVER' => 'sqlite' ), ); @@ -1996,7 +2116,6 @@ class install_install extends module 'UCP_PREFS' => null, 'UCP_PM' => null, 'UCP_USERGROUPS' => null, - 'UCP_ATTACHMENTS' => null, 'UCP_ZEBRA' => null, ), ); diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php new file mode 100644 index 0000000000..ae5ae11223 --- /dev/null +++ b/phpBB/install/install_update.php @@ -0,0 +1,1010 @@ +<?php +/** +* +* @package install +* @version $Id$ +* @copyright (c) 2006 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +*/ +if (!defined('IN_INSTALL')) +{ + // Someone has tried to access the file directly. This is not a good idea, so exit + exit; +} + +if (!empty($setmodules)) +{ + // If phpBB is not installed we do not include this module + if (@file_exists($phpbb_root_path . 'config.' . $phpEx) && !@file_exists($phpbb_root_path . 'cache/install_lock')) + { + include_once($phpbb_root_path . 'config.' . $phpEx); + + if (!defined('PHPBB_INSTALLED')) + { + return; + } + } + else + { + return; + } + + $module[] = array( + 'module_type' => 'update', + 'module_title' => 'UPDATE', + 'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1), + 'module_order' => 30, + 'module_subs' => '', + 'module_stages' => array('INTRO', 'VERSION_CHECK', 'FILE_CHECK', 'UPDATE_FILES', 'UPDATE_DB'), + 'module_reqs' => '' + ); +} + +/** +* Update Installation +* @package install +*/ +class install_update extends module +{ + var $p_master; + var $update_info; + + var $old_location; + var $new_location; + var $latest_version; + var $current_version; + + function install_update(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($mode, $sub) + { + global $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth; + + $this->tpl_name = 'install_update'; + $this->old_location = $phpbb_root_path . 'install/update/old/'; + $this->new_location = $phpbb_root_path . 'install/update/new/'; + + // Init DB + require($phpbb_root_path . 'config.' . $phpEx); + require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); + require($phpbb_root_path . 'includes/constants.' . $phpEx); + + $db = new $sql_db(); + + // Connect to DB + $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false); + + // We do not need this any longer, unset for safety purposes + unset($dbpasswd); + + $config = $cache->obtain_config(); + + // First of all, init the user session + $user->session_begin(); + $auth->acl($user->data); + $user->setup('install'); + + include_once($phpbb_root_path . 'includes/diff/diff.' . $phpEx); + + // Check for user session + if (!$user->data['is_registered']) + { + login_box('', $user->lang['LOGIN_UPDATE_EXPLAIN']); + } + + if (!$auth->acl_get('a_')) + { + trigger_error($user->lang['NO_AUTH_UPDATE']); + } + + // If we are within the intro page we need to make sure we get up-to-date version info + if ($sub == 'intro') + { + $cache->destroy('_version_info'); + } + + // Set custom template again. ;) + $template->set_custom_template('../adm/style', 'admin'); + + // Get current and latest version + $this->current_version = $config['version']; + + if (($latest_version = $cache->get('_version_info')) === false) + { + $this->latest_version = $this->get_file('version_info'); + $cache->put('_version_info', $this->latest_version); + } + else + { + $this->latest_version = $latest_version; + } + + $up_to_date = (version_compare(strtolower($this->current_version), strtolower($this->latest_version), '<')) ? false : true; + + // Check for a valid update directory, else point the user to the phpbb.com website + if (!file_exists($phpbb_root_path . 'install/update') || !file_exists($phpbb_root_path . 'install/update/index.' . $phpEx) || !file_exists($this->old_location) || !file_exists($this->new_location)) + { + $template->assign_vars(array( + 'S_ERROR' => true, + 'ERROR_MSG' => ($up_to_date) ? $user->lang['NO_UPDATE_FILES_UP_TO_DATE'] : sprintf($user->lang['NO_UPDATE_FILES_OUTDATED'], $config['version'], $this->current_version, $this->latest_version)) + ); + + return; + } + + $this->update_info = $this->get_file('update_info'); + + // Make sure the update directory holds the correct information + // Since admins are able to run the update/checks more than once we only check if the current version is lower or equal than the version to which we update to. + if (version_compare(strtolower($this->current_version), strtolower($this->update_info['version']['to']), '>')) + { + $template->assign_vars(array( + 'S_ERROR' => true, + 'ERROR_MSG' => sprintf($user->lang['INCOMPATIBLE_UPDATE_FILES'], $config['version'], $this->update_info['version']['from'], $this->update_info['version']['to'])) + ); + + return; + } + + // Check if the update files stored are for the latest version... + if ($this->latest_version != $this->update_info['version']['to']) + { + $template->assign_vars(array( + 'S_ERROR' => true, + 'ERROR_MSG' => sprintf($user->lang['OLD_UPDATE_FILES'], $this->update_info['version']['from'], $this->update_info['version']['to'], $this->latest_version)) + ); + + return; + } + + // Make sure we stay at the file check if checking the files again + if (!empty($_POST['check_again'])) + { + $sub = $this->p_master->sub = 'file_check'; + } + + switch ($sub) + { + case 'intro': + $this->page_title = 'UPDATE_INSTALLATION'; + + $template->assign_vars(array( + 'S_INTRO' => true, + 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=version_check"), + )); + + // Make sure the update list is destroyed. + $cache->destroy('_update_list'); + break; + + case 'version_check': + $this->page_title = 'STAGE_VERSION_CHECK'; + + $template->assign_vars(array( + 'S_UP_TO_DATE' => $up_to_date, + 'S_VERSION_CHECK' => true, + 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check"), + + 'LATEST_VERSION' => $this->latest_version, + 'CURRENT_VERSION' => $config['version']) + ); + + break; + + case 'file_check': + + $this->page_title = 'STAGE_FILE_CHECK'; + + // Now make sure our update list is correct if the admin refreshes + $action = request_var('action', ''); + + // We are directly within an update. To make sure our update list is correct we check its status. + $update_list = (!empty($_POST['check_again'])) ? false : $cache->get('_update_list'); + $modified = ($update_list !== false) ? @filemtime($cache->cache_dir . 'data_update_list.' . $phpEx) : 0; + + // Make sure the list is up-to-date + if ($update_list !== false) + { + $get_new_list = false; + foreach ($this->update_info['files'] as $file) + { + if (file_exists($phpbb_root_path . $file) && filemtime($phpbb_root_path . $file) > $modified) + { + $get_new_list = true; + break; + } + } + } + else + { + $get_new_list = true; + } + + if ($get_new_list) + { + $update_list = $this->get_update_structure(); + $cache->put('_update_list', $update_list); + } + + if ($action == 'diff') + { + $this->show_diff($update_list); + return; + } + + if (sizeof($update_list['no_update'])) + { + $template->assign_vars(array( + 'S_NO_UPDATE_FILES' => true, + 'NO_UPDATE_FILES' => implode(', ', array_map('htmlspecialchars', $update_list['no_update']))) + ); + } + + // Now assign the list to the template + foreach ($update_list as $status => $filelist) + { + if ($status == 'no_update' || !sizeof($filelist)) + { + continue; + } + + $template->assign_block_vars('files', array( + 'S_STATUS' => true, + 'STATUS' => $status, + 'L_STATUS' => $user->lang['STATUS_' . strtoupper($status)], + 'TITLE' => $user->lang['FILES_' . strtoupper($status)], + 'EXPLAIN' => $user->lang['FILES_' . strtoupper($status) . '_EXPLAIN'], + ) + ); + + foreach ($filelist as $file_struct) + { + $template->assign_block_vars('files', array( + 'STATUS' => $status, + + 'FILENAME' => htmlspecialchars($file_struct['filename']), + 'NUM_CONFLICTS' => (isset($file_struct['conflicts'])) ? $file_struct['conflicts'] : 0, + + 'S_CUSTOM' => ($file_struct['custom']) ? true : false, + 'CUSTOM_ORIGINAL' => ($file_struct['custom']) ? $file_struct['original'] : '', + + 'U_SHOW_DIFF' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check&action=diff&status=$status&file=" . urlencode($file_struct['filename'])), + 'UA_SHOW_DIFF' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check&action=diff&status=$status&file=" . urlencode($file_struct['filename']), false), + 'L_SHOW_DIFF' => ($status != 'up_to_date') ? $user->lang['SHOW_DIFF_' . strtoupper($status)] : '', + )); + } + } + + $all_up_to_date = true; + foreach ($update_list as $status => $filelist) + { + if ($status != 'up_to_date' && $status != 'custom' && sizeof($filelist)) + { + $all_up_to_date = false; + break; + } + } + + $template->assign_vars(array( + 'S_FILE_CHECK' => true, + 'S_ALL_UP_TO_DATE' => $all_up_to_date, + 'S_VERSION_UP_TO_DATE' => $up_to_date, + 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check"), + 'U_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_files"), + 'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_db"), + )); + + break; + + case 'update_files': + + $this->page_title = 'STAGE_UPDATE_FILES'; + + $s_hidden_fields = ''; + foreach (request_var('conflict', array('' => 0)) as $filename => $merge_option) + { + $s_hidden_fields .= '<input type="hidden" name="conflict[' . htmlspecialchars($filename) . ']" value="' . $merge_option . '" />'; + } + + $no_update = request_var('no_update', array(0 => '')); + + foreach ($no_update as $index => $filename) + { + $s_hidden_fields .= '<input type="hidden" name="no_update[]" value="' . htmlspecialchars($filename) . '" />'; + } + + if (!empty($_POST['download'])) + { + include_once($phpbb_root_path . 'includes/functions_compress.' . $phpEx); + + $use_method = request_var('use_method', ''); + $methods = array('.tar'); + + $available_methods = array('.tar.gz' => 'zlib', '.tar.bz2' => 'bz2', '.zip' => 'zlib'); + foreach ($available_methods as $type => $module) + { + if (!@extension_loaded($module)) + { + continue; + } + + $methods[] = $type; + } + + // Let the user decide in which format he wants to have the pack + if (!$use_method) + { + $this->page_title = 'SELECT_DOWNLOAD_FORMAT'; + + $radio_buttons = ''; + foreach ($methods as $method) + { + $radio_buttons .= '<input type="radio"' . ((!$radio_buttons) ? ' id="use_method"' : '') . ' class="radio" value="' . $method . '" name="use_method" /> ' . $method . ' '; + } + + $template->assign_vars(array( + 'S_DOWNLOAD_FILES' => true, + 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_files"), + 'RADIO_BUTTONS' => $radio_buttons, + 'S_HIDDEN_FIELDS' => $s_hidden_fields) + ); + + // To ease the update process create a file location map + $update_list = $cache->get('_update_list'); + + foreach ($update_list as $status => $files) + { + if ($status == 'up_to_date' || $status == 'no_update') + { + continue; + } + + foreach ($files as $file_struct) + { + if (in_array($file_struct['filename'], $no_update)) + { + continue; + } + + $template->assign_block_vars('location', array( + 'SOURCE' => htmlspecialchars($file_struct['filename']), + 'DESTINATION' => $user->page['root_script_path'] . htmlspecialchars($file_struct['filename']), + )); + } + } + + return; + } + + if (!in_array($use_method, $methods)) + { + $use_method = '.tar'; + } + + $update_mode = 'download'; + } + else + { + include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx); + + // Choose FTP, if not available use fsock... + $method = request_var('method', ''); + $submit = (isset($_POST['submit'])) ? true : false; + $test_ftp_connection = request_var('test_connection', ''); + + if (!$method) + { + $method = 'ftp'; + $methods = transfer::methods(); + + if (!in_array('ftp', $methods)) + { + $method = $methods[0]; + } + } + + $test_connection = false; + if ($test_ftp_connection || $submit) + { + $transfer = new $method(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', '')); + $test_connection = $transfer->open_session(); + + // Make sure that the directory is correct by checking for the existence of common.php + if ($test_connection === true) + { + // Check for common.php file + if (!$transfer->file_exists($phpbb_root_path, 'common.' . $phpEx)) + { + $test_connection = 'ERR_WRONG_PATH_TO_PHPBB'; + } + } + + $transfer->close_session(); + + // Make sure the login details are correct before continuing + if ($submit && $test_connection !== true) + { + $submit = false; + $test_ftp_connection = true; + } + } + + if (!$submit) + { + $this->page_title = 'SELECT_FTP_SETTINGS'; + + $requested_data = call_user_func(array($method, 'data')); + foreach ($requested_data as $data => $default) + { + $template->assign_block_vars('data', array( + 'DATA' => $data, + 'NAME' => $user->lang[strtoupper($method . '_' . $data)], + 'EXPLAIN' => $user->lang[strtoupper($method . '_' . $data) . '_EXPLAIN'], + 'DEFAULT' => (!empty($_REQUEST[$data])) ? request_var($data, '') : $default + )); + } + + $s_hidden_fields .= build_hidden_fields(array('method' => $method)); + + $template->assign_vars(array( + 'S_CONNECTION_SUCCESS' => ($test_ftp_connection && $test_connection === true) ? true : false, + 'S_CONNECTION_FAILED' => ($test_ftp_connection && $test_connection !== true) ? true : false, + 'ERROR_MSG' => ($test_ftp_connection && $test_connection !== true) ? $user->lang[$test_connection] : '', + + 'S_FTP_UPLOAD' => true, + 'UPLOAD_METHOD' => $method, + 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_files"), + 'S_HIDDEN_FIELDS' => $s_hidden_fields) + ); + + return; + } + + $update_mode = 'upload'; + } + + // Now update the installation or download the archive... + $archive_filename = 'update_' . $this->update_info['version']['from'] . '_to_' . $this->update_info['version']['to']; + $update_list = $cache->get('_update_list'); + $conflicts = request_var('conflict', array('' => 0)); + + if ($update_list === false) + { + trigger_error($user->lang['NO_UPDATE_INFO'], E_USER_ERROR); + } + + // Check if the conflicts data is valid + if (sizeof($conflicts)) + { + $conflict_filenames = array(); + foreach ($update_list['conflict'] as $files) + { + $conflict_filenames[] = $files['filename']; + } + + $new_conflicts = array(); + foreach ($conflicts as $filename => $diff_method) + { + if (in_array($filename, $conflict_filenames)) + { + $new_conflicts[$filename] = $diff_method; + } + } + + $conflicts = $new_conflicts; + } + + if (sizeof($update_list['conflict']) != sizeof($conflicts)) + { + trigger_error($user->lang['MERGE_SELECT_ERROR'], E_USER_ERROR); + } + + // Now init the connection + if ($update_mode == 'download') + { + if ($use_method == '.zip') + { + $compress = new compress_zip('w', $phpbb_root_path . 'store/' . $archive_filename . $use_method); + } + else + { + $compress = new compress_tar('w', $phpbb_root_path . 'store/' . $archive_filename . $use_method, $use_method); + } + } + else + { + $transfer = new $method(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', '')); + $transfer->open_session(); + } + + // Ok, go through the update list and do the operations based on their status + foreach ($update_list as $status => $files) + { + foreach ($files as $file_struct) + { + // Skip this file if the user selected to not update it + if (in_array($file_struct['filename'], $no_update)) + { + continue; + } + + $original_filename = ($file_struct['custom']) ? $file_struct['original'] : $file_struct['filename']; + + switch ($status) + { + case 'new': + case 'new_conflict': + case 'not_modified': + if ($update_mode == 'download') + { + $compress->add_custom_file($this->new_location . $original_filename, $file_struct['filename']); + } + else + { + if ($status != 'new') + { + $transfer->rename($file_struct['filename'], $file_struct['filename'] . '.bak'); + } + $transfer->copy_file($this->new_location . $original_filename, $file_struct['filename']); + } + break; + + case 'modified': + $diff = &new diff3(file($this->old_location . $original_filename), file($phpbb_root_path . $file_struct['filename']), file($this->new_location . $original_filename)); + $contents = implode("\n", $diff->merged_output()); + + if ($update_mode == 'download') + { + $compress->add_data($contents, $file_struct['filename']); + } + else + { + $transfer->rename($file_struct['filename'], $file_struct['filename'] . '.bak'); + $transfer->write_file($file_struct['filename'], $contents); + } + break; + + case 'conflict': + $diff = &new diff3(file($this->old_location . $original_filename), file($phpbb_root_path . $file_struct['filename']), file($this->new_location . $original_filename)); + + if ($conflicts[$file_struct['filename']] == 1) + { + $contents = implode("\n", $diff->merged_new_output()); + } + else if ($conflicts[$file_struct['filename']] == 2) + { + $contents = implode("\n", $diff->merged_orig_output()); + } + else + { + break; + } + + if ($update_mode == 'download') + { + $compress->add_data($contents, $file_struct['filename']); + } + else + { + $transfer->rename($file_struct['filename'], $file_struct['filename'] . '.bak'); + $transfer->write_file($file_struct['filename'], $contents); + } + break; + } + } + } + + if ($update_mode == 'download') + { + $compress->close(); + + $compress->download($archive_filename); + @unlink($phpbb_root_path . 'store/' . $archive_filename . $use_method); + + exit; + } + else + { + $transfer->close_session(); + + $template->assign_vars(array( + 'S_UPLOAD_SUCCESS' => true, + 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check")) + ); + return; + } + + break; + + case 'update_db': + + // Make sure the database update is valid for the latest version + $valid = false; + $updates_to_version = ''; + + if (file_exists($phpbb_root_path . 'install/database_update.' . $phpEx)) + { + include_once($phpbb_root_path . 'install/database_update.' . $phpEx); + + if ($updates_to_version === $this->latest_version) + { + $valid = true; + } + } + + // Should not happen at all + if (!$valid) + { + trigger_error($user->lang['DATABASE_UPDATE_INFO_OLD'], E_USER_ERROR); + } + + // Because we are done with the file update we purge the cache directory + $cache->purge(); + + // Redirect the user to the database update script with some explanations... + $template->assign_vars(array( + 'S_DB_UPDATE' => true, + 'U_DB_UPDATE' => $phpbb_root_path . 'install/database_update.' . $phpEx) + ); + + break; + } + } + + /** + * Show file diff + */ + function show_diff(&$update_list) + { + global $phpbb_root_path, $template, $user; + + $this->tpl_name = 'install_update_diff'; + $this->page_title = 'VIEWING_FILE_DIFF'; + + $status = request_var('status', ''); + $file = request_var('file', ''); + $diff_mode = request_var('diff_mode', 'side_by_side'); + + // First of all make sure the file is within our file update list with the correct status + $found_entry = array(); + foreach ($update_list[$status] as $index => $file_struct) + { + if ($file_struct['filename'] === $file) + { + $found_entry = $update_list[$status][$index]; + } + } + + if (empty($found_entry)) + { + trigger_error('File not allowed to be diffed', E_USER_ERROR); + } + + // If the status is 'up_to_date' then we do not need to show a diff + if ($status == 'up_to_date') + { + trigger_error($user->lang['FILE_ALREADY_UP_TO_DATE'], E_USER_ERROR); + } + + $original_file = ($found_entry['custom']) ? $found_entry['original'] : $file; + + // Get the correct diff + switch ($status) + { + case 'conflict': + $diff = &new diff3(file($this->old_location . $original_file), file($phpbb_root_path . $file), file($this->new_location . $original_file)); + + $template->assign_vars(array( + 'S_DIFF_CONFLICT_FILE' => true, + 'NUM_CONFLICTS' => $diff->merged_output(false, false, false, true)) + ); + break; + + case 'modified': + $diff = &new diff3(file($this->old_location . $original_file), file($phpbb_root_path . $original_file), file($this->new_location . $file)); + break; + + case 'not_modified': + case 'new_conflict': + $diff = &new diff(file($phpbb_root_path . $file), file($this->new_location . $original_file)); + break; + + case 'new': + $diff = &new diff(array(), file($this->new_location . $original_file)); + $template->assign_var('S_DIFF_NEW_FILE', true); + $diff_mode = 'inline'; + $this->page_title = 'VIEWING_FILE_CONTENTS'; + break; + } + + $diff_mode_options = ''; + foreach (array('side_by_side', 'inline', 'unified', 'raw') as $option) + { + $diff_mode_options .= '<option value="' . $option . '"' . (($diff_mode == $option) ? ' selected="selected"' : '') . '>' . $user->lang['DIFF_' . strtoupper($option)] . '</option>'; + } + + // Now the correct renderer + $render_class = 'diff_renderer_' . $diff_mode; + + if (!class_exists($render_class)) + { + trigger_error('Chosen diff mode is not supported', E_USER_ERROR); + } + + $renderer = &new $render_class(); + + $template->assign_vars(array( + 'DIFF_CONTENT' => $renderer->get_diff_content($diff), + 'S_DIFF_MODE_OPTIONS' => $diff_mode_options, + 'S_SHOW_DIFF' => true, + )); + } + + /** + * Collect all file status infos we need for the update by diffing all files + */ + function get_update_structure() + { + global $phpbb_root_path, $phpEx, $user; + + $update_list = array( + 'up_to_date' => array(), + 'new' => array(), + 'not_modified' => array(), + 'modified' => array(), + 'new_conflict' => array(), + 'conflict' => array(), + 'no_update' => array(), + ); + + // Get a list of those files which are completely new by checking with file_exists... + foreach ($this->update_info['files'] as $index => $file) + { + if (!file_exists($phpbb_root_path . $file)) + { + // Make sure the update files are consistent by checking if the file is in new_files... + if (!file_exists($this->new_location . $file)) + { + trigger_error($user->lang['INCOMPLETE_UPDATE_FILES'], E_USER_ERROR); + } + + // If the file exists within the old directory the file got removed and we will write it back + // not a biggie, but we might want to state this circumstance seperatly later. + // if (file_exists($this->old_location . $file)) + // { + // $update_list['removed'][] = $file; + // } + + // Only include a new file as new if the underlying path exist + // The path normally do not exist if the original style or language has been removed + if (file_exists($phpbb_root_path . dirname($file))) + { + $this->get_custom_info($update_list['new'], $file); + $update_list['new'][] = array('filename' => $file, 'custom' => false); + } + else + { + $update_list['no_update'][] = $file; + } + unset($this->update_info['files'][$index]); + } + } + + if (!sizeof($this->update_info['files'])) + { + return $update_list; + } + + // Now diff the remaining files to get informations about their status (not modified/modified/up-to-date) + + // not modified? + foreach ($this->update_info['files'] as $index => $file) + { + $this->make_update_diff($update_list, $file, $file); + } + + // Now to the styles... + if (empty($this->update_info['custom'])) + { + return $update_list; + } + + foreach ($this->update_info['custom'] as $original_file => $file_ary) + { + foreach ($file_ary as $index => $file) + { + $this->make_update_diff($update_list, $original_file, $file, true); + } + } + + return $update_list; + } + + /** + * Compare files for storage in update_list + */ + function make_update_diff(&$update_list, $original_file, $file, $custom = false) + { + global $phpbb_root_path, $user; + + $update_ary = array('filename' => $file, 'custom' => $custom); + + if ($custom) + { + $update_ary['original'] = $original_file; + } + + // On a successfull update the new location file exists but the old one does not exist. + // Check for this circumstance, the new file need to be up-to-date with the current file then... + if (!file_exists($this->old_location . $original_file) && file_exists($this->new_location . $original_file) && file_exists($phpbb_root_path . $file)) + { + // We need to diff the contents here to make sure the file is really the one we expect + $diff = &new diff(file($this->new_location . $original_file), file($phpbb_root_path . $file)); + + // if there are no differences we have an up-to-date file... + if ($diff->is_empty()) + { + $update_list['up_to_date'][] = $update_ary; + return; + } + + // If no other status matches we have another file in the way... + $update_list['new_conflict'][] = $update_ary; + return; + } + + // Check for existance, else abort immediatly + if (!file_exists($this->old_location . $original_file) || !file_exists($this->new_location . $original_file)) + { + trigger_error($user->lang['INCOMPLETE_UPDATE_FILES'], E_USER_ERROR); + } + + $diff = &new diff(file($this->old_location . $original_file), file($phpbb_root_path . $file)); + + // If the file is not modified we are finished here... + if ($diff->is_empty()) + { + $update_list['not_modified'][] = $update_ary; + return; + } + + // If the file had been modified then we need to check if it is already up to date + $diff = &new diff(file($this->new_location . $original_file), file($phpbb_root_path . $file)); + + // if there are no differences we have an up-to-date file... + if ($diff->is_empty()) + { + $update_list['up_to_date'][] = $update_ary; + return; + } + + // if the file is modified we try to make sure a merge succeed + $diff = &new diff3(file($this->old_location . $original_file), file($phpbb_root_path . $file), file($this->new_location . $original_file)); + + if ($diff->merged_output(false, false, false, true)) + { + $update_ary['conflicts'] = $diff->_conflicting_blocks; + $update_list['conflict'][] = $update_ary; + return; + } + + // now compare the merged output with the original file to see if the modified file is up to date + $diff = &new diff(file($phpbb_root_path . $file), $diff->merged_output()); + + if ($diff->is_empty()) + { + $update_list['up_to_date'][] = $update_ary; + return; + } + + // If no other status matches we have a modified file... + $update_list['modified'][] = $update_ary; + } + + /** + * Update update_list with custom new files + */ + function get_custom_info(&$update_list, $file) + { + if (empty($this->update_info['custom'])) + { + return; + } + + if (in_array($file, array_keys($this->update_info['custom']))) + { + foreach ($this->update_info['custom'][$file] as $_file) + { + $update_list[] = array('filename' => $_file, 'custom' => true, 'original' => $file); + } + } + } + + /** + * Get remote file + */ + function get_file($mode) + { + global $user, $db; + + $errstr = ''; + $errno = 0; + + switch ($mode) + { + case 'version_info': + $info = get_remote_file('www.phpbb.com', '/updatecheck', '30x.txt', $errstr, $errno); + + if ($info !== false) + { + $info = explode("\n", $info); + $info = trim($info[0]); + } + break; + + case 'update_info': + global $phpbb_root_path, $phpEx; + + $update_info = array(); + include($phpbb_root_path . 'install/update/index.php'); + + $info = (empty($update_info) || !is_array($update_info)) ? false : $update_info; + $errstr = ($info === false) ? $user->lang['WRONG_INFO_FILE_FORMAT'] : ''; + + if ($info !== false) + { + // Adjust the update info file to hold some specific style-related informations + $info['custom'] = array(); + + // Get custom installed styles... + $sql = 'SELECT template_name, template_path + FROM ' . STYLES_TEMPLATE_TABLE . " + WHERE template_name NOT IN ('subSilver', 'BLABLA')"; + $result = $db->sql_query($sql); + + $templates = array(); + while ($row = $db->sql_fetchrow($result)) + { + $templates[] = $row; + } + $db->sql_freeresult($result); + + if (sizeof($templates)) + { + foreach ($info['files'] as $filename) + { + // Template update? + if (strpos($filename, 'styles/subSilver/template/') === 0) + { + foreach ($templates as $row) + { + $info['custom'][$filename][] = str_replace('/subSilver/', '/' . $row['template_path'] . '/', $filename); + } + } + } + } + } + break; + + default: + trigger_error('Mode for getting remote file not specified', E_USER_ERROR); + break; + } + + if ($info === false) + { + trigger_error($errstr, E_USER_ERROR); + } + + return $info; + } +} + +?>
\ No newline at end of file diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 6126af9549..811c009d7c 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -5,21 +5,6 @@ # -# Emulation of STRLEN, might need to be checked out for FB 2.0 -DECLARE EXTERNAL FUNCTION STRLEN CSTRING(32767) -RETURNS INTEGER BY VALUE -ENTRY_POINT 'IB_UDF_strlen' MODULE_NAME 'ib_udf';; - -# Emulation of LOWER, might need to be checked out for FB 2.0 -DECLARE EXTERNAL FUNCTION LOWER CSTRING(80) -RETURNS CSTRING(80) FREE_IT -ENTRY_POINT 'IB_UDF_lower' MODULE_NAME 'ib_udf';; - -# Only used for insertion of binary strings as defaults -DECLARE EXTERNAL FUNCTION ASCII_CHAR INTEGER -RETURNS CSTRING(1) FREE_IT -ENTRY_POINT 'IB_UDF_ascii_char' MODULE_NAME 'ib_udf';; - # Table: 'phpbb_attachments' CREATE TABLE phpbb_attachments ( attach_id INTEGER NOT NULL, @@ -27,12 +12,13 @@ CREATE TABLE phpbb_attachments ( topic_id INTEGER DEFAULT 0 NOT NULL, in_message INTEGER DEFAULT 0 NOT NULL, poster_id INTEGER DEFAULT 0 NOT NULL, - physical_filename VARCHAR(255) DEFAULT '' NOT NULL, - real_filename VARCHAR(255) DEFAULT '' NOT NULL, + is_orphan INTEGER DEFAULT 1 NOT NULL, + physical_filename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + real_filename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, download_count INTEGER DEFAULT 0 NOT NULL, - attach_comment BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - extension VARCHAR(100) DEFAULT '' NOT NULL, - mimetype VARCHAR(100) DEFAULT '' NOT NULL, + attach_comment BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + extension VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL, + mimetype VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL, filesize INTEGER DEFAULT 0 NOT NULL, filetime INTEGER DEFAULT 0 NOT NULL, thumbnail INTEGER DEFAULT 0 NOT NULL @@ -44,7 +30,7 @@ CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments(filetime);; CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments(post_msg_id);; CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments(topic_id);; CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments(poster_id);; -CREATE INDEX phpbb_attachments_filesize ON phpbb_attachments(filesize);; +CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments(is_orphan);; CREATE GENERATOR phpbb_attachments_gen;; SET GENERATOR phpbb_attachments_gen TO 0;; @@ -72,7 +58,7 @@ CREATE INDEX phpbb_acl_groups_auth_opt_id ON phpbb_acl_groups(auth_option_id);; # Table: 'phpbb_acl_options' CREATE TABLE phpbb_acl_options ( auth_option_id INTEGER NOT NULL, - auth_option VARCHAR(50) DEFAULT '' NOT NULL, + auth_option VARCHAR(50) CHARACTER SET NONE DEFAULT '' NOT NULL, is_global INTEGER DEFAULT 0 NOT NULL, is_local INTEGER DEFAULT 0 NOT NULL, founder_only INTEGER DEFAULT 0 NOT NULL @@ -96,9 +82,9 @@ END;; # Table: 'phpbb_acl_roles' CREATE TABLE phpbb_acl_roles ( role_id INTEGER NOT NULL, - role_name VARCHAR(255) DEFAULT '' NOT NULL, - role_description BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - role_type VARCHAR(10) DEFAULT '' NOT NULL, + role_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + role_description BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + role_type VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL, role_order INTEGER DEFAULT 0 NOT NULL );; @@ -144,13 +130,13 @@ CREATE INDEX phpbb_acl_users_auth_option_id ON phpbb_acl_users(auth_option_id);; CREATE TABLE phpbb_banlist ( ban_id INTEGER NOT NULL, ban_userid INTEGER DEFAULT 0 NOT NULL, - ban_ip VARCHAR(40) DEFAULT '' NOT NULL, - ban_email VARCHAR(100) DEFAULT '' NOT NULL, + ban_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, + ban_email VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, ban_start INTEGER DEFAULT 0 NOT NULL, ban_end INTEGER DEFAULT 0 NOT NULL, ban_exclude INTEGER DEFAULT 0 NOT NULL, - ban_reason BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - ban_give_reason BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL + ban_reason BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL, + ban_give_reason BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL );; ALTER TABLE phpbb_banlist ADD PRIMARY KEY (ban_id);; @@ -174,15 +160,15 @@ END;; # Table: 'phpbb_bbcodes' CREATE TABLE phpbb_bbcodes ( bbcode_id INTEGER DEFAULT 0 NOT NULL, - bbcode_tag VARCHAR(16) DEFAULT '' NOT NULL, - bbcode_helpline VARCHAR(255) DEFAULT '' NOT NULL, + bbcode_tag VARCHAR(16) CHARACTER SET NONE DEFAULT '' NOT NULL, + bbcode_helpline VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, display_on_posting INTEGER DEFAULT 0 NOT NULL, - bbcode_match BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - bbcode_tpl BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - first_pass_match BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - first_pass_replace BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - second_pass_match BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - second_pass_replace BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL + bbcode_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + bbcode_tpl BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + first_pass_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + first_pass_replace BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + second_pass_match BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + second_pass_replace BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL );; ALTER TABLE phpbb_bbcodes ADD PRIMARY KEY (bbcode_id);; @@ -203,10 +189,10 @@ CREATE INDEX phpbb_bookmarks_topic_user_id ON phpbb_bookmarks(topic_id, user_id) CREATE TABLE phpbb_bots ( bot_id INTEGER NOT NULL, bot_active INTEGER DEFAULT 1 NOT NULL, - bot_name BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, + bot_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, user_id INTEGER DEFAULT 0 NOT NULL, - bot_agent VARCHAR(255) DEFAULT '' NOT NULL, - bot_ip VARCHAR(255) DEFAULT '' NOT NULL + bot_agent VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + bot_ip VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL );; ALTER TABLE phpbb_bots ADD PRIMARY KEY (bot_id);; @@ -226,8 +212,8 @@ END;; # Table: 'phpbb_config' CREATE TABLE phpbb_config ( - config_name VARCHAR(252) DEFAULT '' NOT NULL, - config_value VARCHAR(255) DEFAULT '' NOT NULL, + config_name VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + config_value VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, is_dynamic INTEGER DEFAULT 0 NOT NULL );; @@ -237,10 +223,10 @@ CREATE INDEX phpbb_config_is_dynamic ON phpbb_config(is_dynamic);; # Table: 'phpbb_confirm' CREATE TABLE phpbb_confirm ( - confirm_id CHAR(32) DEFAULT '' NOT NULL, - session_id CHAR(32) DEFAULT '' NOT NULL, + confirm_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, + session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, confirm_type INTEGER DEFAULT 0 NOT NULL, - code VARCHAR(8) DEFAULT '' NOT NULL + code VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL );; ALTER TABLE phpbb_confirm ADD PRIMARY KEY (session_id, confirm_id);; @@ -250,7 +236,7 @@ CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm(confirm_type);; # Table: 'phpbb_disallow' CREATE TABLE phpbb_disallow ( disallow_id INTEGER NOT NULL, - disallow_username VARCHAR(252) DEFAULT '' NOT NULL + disallow_username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE );; ALTER TABLE phpbb_disallow ADD PRIMARY KEY (disallow_id);; @@ -274,8 +260,8 @@ CREATE TABLE phpbb_drafts ( topic_id INTEGER DEFAULT 0 NOT NULL, forum_id INTEGER DEFAULT 0 NOT NULL, save_time INTEGER DEFAULT 0 NOT NULL, - draft_subject BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - draft_message BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL + draft_subject VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + draft_message BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL );; ALTER TABLE phpbb_drafts ADD PRIMARY KEY (draft_id);; @@ -297,7 +283,7 @@ END;; CREATE TABLE phpbb_extensions ( extension_id INTEGER NOT NULL, group_id INTEGER DEFAULT 0 NOT NULL, - extension VARCHAR(100) DEFAULT '' NOT NULL + extension VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL );; ALTER TABLE phpbb_extensions ADD PRIMARY KEY (extension_id);; @@ -317,13 +303,13 @@ END;; # Table: 'phpbb_extension_groups' CREATE TABLE phpbb_extension_groups ( group_id INTEGER NOT NULL, - group_name VARCHAR(255) DEFAULT '' NOT NULL, + group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, cat_id INTEGER DEFAULT 0 NOT NULL, allow_group INTEGER DEFAULT 0 NOT NULL, download_mode INTEGER DEFAULT 1 NOT NULL, - upload_icon VARCHAR(255) DEFAULT '' NOT NULL, + upload_icon VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, max_filesize INTEGER DEFAULT 0 NOT NULL, - allowed_forums BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, + allowed_forums BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL, allow_in_pm INTEGER DEFAULT 0 NOT NULL );; @@ -347,21 +333,21 @@ CREATE TABLE phpbb_forums ( parent_id INTEGER DEFAULT 0 NOT NULL, left_id INTEGER DEFAULT 0 NOT NULL, right_id INTEGER DEFAULT 0 NOT NULL, - forum_parents BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - forum_name BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - forum_desc BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - forum_desc_bitfield VARCHAR(252) DEFAULT '' NOT NULL, - forum_desc_options INTEGER DEFAULT 0 NOT NULL, - forum_desc_uid VARCHAR(5) DEFAULT '' NOT NULL, - forum_link VARCHAR(255) DEFAULT '' NOT NULL, - forum_password VARCHAR(40) DEFAULT '' NOT NULL, + forum_parents BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL, + forum_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + forum_desc BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + forum_desc_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + forum_desc_options INTEGER DEFAULT 7 NOT NULL, + forum_desc_uid VARCHAR(5) CHARACTER SET NONE DEFAULT '' NOT NULL, + forum_link VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + forum_password VARCHAR(40) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, forum_style INTEGER DEFAULT 0 NOT NULL, - forum_image VARCHAR(255) DEFAULT '' NOT NULL, - forum_rules BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - forum_rules_link VARCHAR(255) DEFAULT '' NOT NULL, - forum_rules_bitfield VARCHAR(252) DEFAULT '' NOT NULL, - forum_rules_options INTEGER DEFAULT 0 NOT NULL, - forum_rules_uid VARCHAR(5) DEFAULT '' NOT NULL, + forum_image VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + forum_rules BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + forum_rules_link VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + forum_rules_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + forum_rules_options INTEGER DEFAULT 7 NOT NULL, + forum_rules_uid VARCHAR(5) CHARACTER SET NONE DEFAULT '' NOT NULL, forum_topics_per_page INTEGER DEFAULT 0 NOT NULL, forum_type INTEGER DEFAULT 0 NOT NULL, forum_status INTEGER DEFAULT 0 NOT NULL, @@ -370,8 +356,10 @@ CREATE TABLE phpbb_forums ( forum_topics_real INTEGER DEFAULT 0 NOT NULL, forum_last_post_id INTEGER DEFAULT 0 NOT NULL, forum_last_poster_id INTEGER DEFAULT 0 NOT NULL, + forum_last_post_subject VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, forum_last_post_time INTEGER DEFAULT 0 NOT NULL, - forum_last_poster_name VARCHAR(255) DEFAULT '' NOT NULL, + forum_last_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + forum_last_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL, forum_flags INTEGER DEFAULT 32 NOT NULL, display_on_index INTEGER DEFAULT 1 NOT NULL, enable_indexing INTEGER DEFAULT 1 NOT NULL, @@ -403,7 +391,7 @@ END;; CREATE TABLE phpbb_forums_access ( forum_id INTEGER DEFAULT 0 NOT NULL, user_id INTEGER DEFAULT 0 NOT NULL, - session_id CHAR(32) DEFAULT '' NOT NULL + session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL );; ALTER TABLE phpbb_forums_access ADD PRIMARY KEY (forum_id, user_id, session_id);; @@ -434,18 +422,18 @@ CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch(notify_status) CREATE TABLE phpbb_groups ( group_id INTEGER NOT NULL, group_type INTEGER DEFAULT 1 NOT NULL, - group_name VARCHAR(252) DEFAULT '' NOT NULL, - group_desc BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - group_desc_bitfield VARCHAR(252) DEFAULT '' NOT NULL, - group_desc_options INTEGER DEFAULT 0 NOT NULL, - group_desc_uid VARCHAR(5) DEFAULT '' NOT NULL, + group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + group_desc BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + group_desc_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + group_desc_options INTEGER DEFAULT 7 NOT NULL, + group_desc_uid VARCHAR(5) CHARACTER SET NONE DEFAULT '' NOT NULL, group_display INTEGER DEFAULT 0 NOT NULL, - group_avatar VARCHAR(255) DEFAULT '' NOT NULL, + group_avatar VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, group_avatar_type INTEGER DEFAULT 0 NOT NULL, group_avatar_width INTEGER DEFAULT 0 NOT NULL, group_avatar_height INTEGER DEFAULT 0 NOT NULL, group_rank INTEGER DEFAULT 0 NOT NULL, - group_colour VARCHAR(6) DEFAULT '' NOT NULL, + group_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL, group_sig_chars INTEGER DEFAULT 0 NOT NULL, group_receive_pm INTEGER DEFAULT 0 NOT NULL, group_message_limit INTEGER DEFAULT 0 NOT NULL, @@ -470,7 +458,7 @@ END;; # Table: 'phpbb_icons' CREATE TABLE phpbb_icons ( icons_id INTEGER NOT NULL, - icons_url VARCHAR(255) DEFAULT '' NOT NULL, + icons_url VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, icons_width INTEGER DEFAULT 0 NOT NULL, icons_height INTEGER DEFAULT 0 NOT NULL, icons_order INTEGER DEFAULT 0 NOT NULL, @@ -495,11 +483,11 @@ END;; # Table: 'phpbb_lang' CREATE TABLE phpbb_lang ( lang_id INTEGER NOT NULL, - lang_iso VARCHAR(30) DEFAULT '' NOT NULL, - lang_dir VARCHAR(30) DEFAULT '' NOT NULL, - lang_english_name VARCHAR(100) DEFAULT '' NOT NULL, - lang_local_name VARCHAR(255) DEFAULT '' NOT NULL, - lang_author VARCHAR(255) DEFAULT '' NOT NULL + lang_iso VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL, + lang_dir VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL, + lang_english_name VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + lang_local_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + lang_author VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE );; ALTER TABLE phpbb_lang ADD PRIMARY KEY (lang_id);; @@ -525,10 +513,10 @@ CREATE TABLE phpbb_log ( forum_id INTEGER DEFAULT 0 NOT NULL, topic_id INTEGER DEFAULT 0 NOT NULL, reportee_id INTEGER DEFAULT 0 NOT NULL, - log_ip VARCHAR(40) DEFAULT '' NOT NULL, + log_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, log_time INTEGER DEFAULT 0 NOT NULL, - log_operation BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - log_data BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL + log_operation BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + log_data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL );; ALTER TABLE phpbb_log ADD PRIMARY KEY (log_id);; @@ -554,9 +542,9 @@ END;; CREATE TABLE phpbb_moderator_cache ( forum_id INTEGER DEFAULT 0 NOT NULL, user_id INTEGER DEFAULT 0 NOT NULL, - username VARCHAR(252) DEFAULT '' NOT NULL, + username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, group_id INTEGER DEFAULT 0 NOT NULL, - group_name VARCHAR(255) DEFAULT '' NOT NULL, + group_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, display_on_index INTEGER DEFAULT 1 NOT NULL );; @@ -568,14 +556,14 @@ CREATE TABLE phpbb_modules ( module_id INTEGER NOT NULL, module_enabled INTEGER DEFAULT 1 NOT NULL, module_display INTEGER DEFAULT 1 NOT NULL, - module_basename VARCHAR(255) DEFAULT '' NOT NULL, - module_class VARCHAR(10) DEFAULT '' NOT NULL, + module_basename VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + module_class VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL, parent_id INTEGER DEFAULT 0 NOT NULL, left_id INTEGER DEFAULT 0 NOT NULL, right_id INTEGER DEFAULT 0 NOT NULL, - module_langname VARCHAR(255) DEFAULT '' NOT NULL, - module_mode VARCHAR(255) DEFAULT '' NOT NULL, - module_auth VARCHAR(255) DEFAULT '' NOT NULL + module_langname VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + module_mode VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + module_auth VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL );; ALTER TABLE phpbb_modules ADD PRIMARY KEY (module_id);; @@ -599,7 +587,7 @@ END;; CREATE TABLE phpbb_poll_options ( poll_option_id INTEGER DEFAULT 0 NOT NULL, topic_id INTEGER DEFAULT 0 NOT NULL, - poll_option_text BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, + poll_option_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, poll_option_total INTEGER DEFAULT 0 NOT NULL );; @@ -611,7 +599,7 @@ CREATE TABLE phpbb_poll_votes ( topic_id INTEGER DEFAULT 0 NOT NULL, poll_option_id INTEGER DEFAULT 0 NOT NULL, vote_user_id INTEGER DEFAULT 0 NOT NULL, - vote_user_ip VARCHAR(40) DEFAULT '' NOT NULL + vote_user_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL );; CREATE INDEX phpbb_poll_votes_topic_id ON phpbb_poll_votes(topic_id);; @@ -625,7 +613,7 @@ CREATE TABLE phpbb_posts ( forum_id INTEGER DEFAULT 0 NOT NULL, poster_id INTEGER DEFAULT 0 NOT NULL, icon_id INTEGER DEFAULT 0 NOT NULL, - poster_ip VARCHAR(40) DEFAULT '' NOT NULL, + poster_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, post_time INTEGER DEFAULT 0 NOT NULL, post_approved INTEGER DEFAULT 1 NOT NULL, post_reported INTEGER DEFAULT 0 NOT NULL, @@ -633,17 +621,16 @@ CREATE TABLE phpbb_posts ( enable_smilies INTEGER DEFAULT 1 NOT NULL, enable_magic_url INTEGER DEFAULT 1 NOT NULL, enable_sig INTEGER DEFAULT 1 NOT NULL, - post_username VARCHAR(252) DEFAULT '' NOT NULL, - post_subject BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - post_text BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - post_checksum VARCHAR(32) DEFAULT '' NOT NULL, - post_encoding VARCHAR(20) DEFAULT 'iso-8859-1' NOT NULL, + post_username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + post_subject VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + post_checksum VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, post_attachment INTEGER DEFAULT 0 NOT NULL, - bbcode_bitfield VARCHAR(252) DEFAULT '' NOT NULL, - bbcode_uid VARCHAR(5) DEFAULT '' NOT NULL, + bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + bbcode_uid VARCHAR(5) CHARACTER SET NONE DEFAULT '' NOT NULL, post_postcount INTEGER DEFAULT 1 NOT NULL, post_edit_time INTEGER DEFAULT 0 NOT NULL, - post_edit_reason BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, + post_edit_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, post_edit_user INTEGER DEFAULT 0 NOT NULL, post_edit_count INTEGER DEFAULT 0 NOT NULL, post_edit_locked INTEGER DEFAULT 0 NOT NULL @@ -656,8 +643,7 @@ CREATE INDEX phpbb_posts_topic_id ON phpbb_posts(topic_id);; CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts(poster_ip);; CREATE INDEX phpbb_posts_poster_id ON phpbb_posts(poster_id);; CREATE INDEX phpbb_posts_post_approved ON phpbb_posts(post_approved);; -CREATE INDEX phpbb_posts_post_postcount ON phpbb_posts(post_postcount);; -CREATE INDEX phpbb_posts_post_time ON phpbb_posts(post_time);; +CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts(topic_id, post_time);; CREATE GENERATOR phpbb_posts_gen;; SET GENERATOR phpbb_posts_gen TO 0;; @@ -676,24 +662,23 @@ CREATE TABLE phpbb_privmsgs ( root_level INTEGER DEFAULT 0 NOT NULL, author_id INTEGER DEFAULT 0 NOT NULL, icon_id INTEGER DEFAULT 0 NOT NULL, - author_ip VARCHAR(40) DEFAULT '' NOT NULL, + author_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, message_time INTEGER DEFAULT 0 NOT NULL, enable_bbcode INTEGER DEFAULT 1 NOT NULL, enable_smilies INTEGER DEFAULT 1 NOT NULL, enable_magic_url INTEGER DEFAULT 1 NOT NULL, enable_sig INTEGER DEFAULT 1 NOT NULL, - message_subject BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - message_text BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - message_edit_reason BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, + message_subject VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + message_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + message_edit_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, message_edit_user INTEGER DEFAULT 0 NOT NULL, - message_encoding VARCHAR(20) DEFAULT 'iso-8859-1' NOT NULL, message_attachment INTEGER DEFAULT 0 NOT NULL, - bbcode_bitfield VARCHAR(252) DEFAULT '' NOT NULL, - bbcode_uid VARCHAR(5) DEFAULT '' NOT NULL, + bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + bbcode_uid VARCHAR(5) CHARACTER SET NONE DEFAULT '' NOT NULL, message_edit_time INTEGER DEFAULT 0 NOT NULL, message_edit_count INTEGER DEFAULT 0 NOT NULL, - to_address BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - bcc_address BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL + to_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + bcc_address BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL );; ALTER TABLE phpbb_privmsgs ADD PRIMARY KEY (msg_id);; @@ -718,7 +703,7 @@ END;; CREATE TABLE phpbb_privmsgs_folder ( folder_id INTEGER NOT NULL, user_id INTEGER DEFAULT 0 NOT NULL, - folder_name VARCHAR(255) DEFAULT '' NOT NULL, + folder_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, pm_count INTEGER DEFAULT 0 NOT NULL );; @@ -743,7 +728,7 @@ CREATE TABLE phpbb_privmsgs_rules ( user_id INTEGER DEFAULT 0 NOT NULL, rule_check INTEGER DEFAULT 0 NOT NULL, rule_connection INTEGER DEFAULT 0 NOT NULL, - rule_string VARCHAR(255) DEFAULT '' NOT NULL, + rule_string VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, rule_user_id INTEGER DEFAULT 0 NOT NULL, rule_group_id INTEGER DEFAULT 0 NOT NULL, rule_action INTEGER DEFAULT 0 NOT NULL, @@ -786,15 +771,15 @@ CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to(user_id, folder # Table: 'phpbb_profile_fields' CREATE TABLE phpbb_profile_fields ( field_id INTEGER NOT NULL, - field_name VARCHAR(255) DEFAULT '' NOT NULL, + field_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, field_type INTEGER DEFAULT 0 NOT NULL, - field_ident VARCHAR(20) DEFAULT '' NOT NULL, - field_length VARCHAR(20) DEFAULT '' NOT NULL, - field_minlen VARCHAR(255) DEFAULT '' NOT NULL, - field_maxlen VARCHAR(255) DEFAULT '' NOT NULL, - field_novalue VARCHAR(255) DEFAULT '' NOT NULL, - field_default_value VARCHAR(255) DEFAULT '' NOT NULL, - field_validation VARCHAR(20) DEFAULT '' NOT NULL, + field_ident VARCHAR(20) CHARACTER SET NONE DEFAULT '' NOT NULL, + field_length VARCHAR(20) CHARACTER SET NONE DEFAULT '' NOT NULL, + field_minlen VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + field_maxlen VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + field_novalue VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + field_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + field_validation VARCHAR(20) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, field_required INTEGER DEFAULT 0 NOT NULL, field_show_on_reg INTEGER DEFAULT 0 NOT NULL, field_hide INTEGER DEFAULT 0 NOT NULL, @@ -833,7 +818,7 @@ CREATE TABLE phpbb_profile_fields_lang ( lang_id INTEGER DEFAULT 0 NOT NULL, option_id INTEGER DEFAULT 0 NOT NULL, field_type INTEGER DEFAULT 0 NOT NULL, - lang_value VARCHAR(255) DEFAULT '' NOT NULL + lang_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE );; ALTER TABLE phpbb_profile_fields_lang ADD PRIMARY KEY (field_id, lang_id, option_id);; @@ -843,9 +828,9 @@ ALTER TABLE phpbb_profile_fields_lang ADD PRIMARY KEY (field_id, lang_id, option CREATE TABLE phpbb_profile_lang ( field_id INTEGER DEFAULT 0 NOT NULL, lang_id INTEGER DEFAULT 0 NOT NULL, - lang_name VARCHAR(255) DEFAULT '' NOT NULL, - lang_explain BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - lang_default_value VARCHAR(255) DEFAULT '' NOT NULL + lang_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + lang_explain BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + lang_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE );; ALTER TABLE phpbb_profile_lang ADD PRIMARY KEY (field_id, lang_id);; @@ -854,10 +839,10 @@ ALTER TABLE phpbb_profile_lang ADD PRIMARY KEY (field_id, lang_id);; # Table: 'phpbb_ranks' CREATE TABLE phpbb_ranks ( rank_id INTEGER NOT NULL, - rank_title VARCHAR(255) DEFAULT '' NOT NULL, + rank_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, rank_min INTEGER DEFAULT 0 NOT NULL, rank_special INTEGER DEFAULT 0 NOT NULL, - rank_image VARCHAR(255) DEFAULT '' NOT NULL + rank_image VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL );; ALTER TABLE phpbb_ranks ADD PRIMARY KEY (rank_id);; @@ -883,7 +868,7 @@ CREATE TABLE phpbb_reports ( user_notify INTEGER DEFAULT 0 NOT NULL, report_closed INTEGER DEFAULT 0 NOT NULL, report_time INTEGER DEFAULT 0 NOT NULL, - report_text BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL + report_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL );; ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);; @@ -903,8 +888,8 @@ END;; # Table: 'phpbb_reports_reasons' CREATE TABLE phpbb_reports_reasons ( reason_id INTEGER NOT NULL, - reason_title VARCHAR(255) DEFAULT '' NOT NULL, - reason_description BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, + reason_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + reason_description BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, reason_order INTEGER DEFAULT 0 NOT NULL );; @@ -924,10 +909,10 @@ END;; # Table: 'phpbb_search_results' CREATE TABLE phpbb_search_results ( - search_key VARCHAR(32) DEFAULT '' NOT NULL, + search_key VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, search_time INTEGER DEFAULT 0 NOT NULL, - search_keywords BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - search_authors BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL + search_keywords BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + search_authors BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL );; ALTER TABLE phpbb_search_results ADD PRIMARY KEY (search_key);; @@ -936,7 +921,7 @@ ALTER TABLE phpbb_search_results ADD PRIMARY KEY (search_key);; # Table: 'phpbb_search_wordlist' CREATE TABLE phpbb_search_wordlist ( word_id INTEGER NOT NULL, - word_text VARCHAR(84) CHARACTER SET UNICODE_FSS DEFAULT '' NOT NULL, + word_text VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, word_common INTEGER DEFAULT 0 NOT NULL );; @@ -967,14 +952,14 @@ CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch(post_id);; # Table: 'phpbb_sessions' CREATE TABLE phpbb_sessions ( - session_id CHAR(32) DEFAULT '' NOT NULL, + session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, session_user_id INTEGER DEFAULT 0 NOT NULL, session_last_visit INTEGER DEFAULT 0 NOT NULL, session_start INTEGER DEFAULT 0 NOT NULL, session_time INTEGER DEFAULT 0 NOT NULL, - session_ip VARCHAR(40) DEFAULT '' NOT NULL, - session_browser VARCHAR(150) DEFAULT '' NOT NULL, - session_page VARCHAR(255) DEFAULT '' NOT NULL, + session_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, + session_browser VARCHAR(150) CHARACTER SET NONE DEFAULT '' NOT NULL, + session_page VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, session_viewonline INTEGER DEFAULT 1 NOT NULL, session_autologin INTEGER DEFAULT 0 NOT NULL, session_admin INTEGER DEFAULT 0 NOT NULL @@ -987,9 +972,9 @@ CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions(session_user_id);; # Table: 'phpbb_sessions_keys' CREATE TABLE phpbb_sessions_keys ( - key_id CHAR(32) DEFAULT '' NOT NULL, + key_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, user_id INTEGER DEFAULT 0 NOT NULL, - last_ip VARCHAR(40) DEFAULT '' NOT NULL, + last_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, last_login INTEGER DEFAULT 0 NOT NULL );; @@ -1000,8 +985,8 @@ CREATE INDEX phpbb_sessions_keys_last_login ON phpbb_sessions_keys(last_login);; # Table: 'phpbb_sitelist' CREATE TABLE phpbb_sitelist ( site_id INTEGER NOT NULL, - site_ip VARCHAR(40) DEFAULT '' NOT NULL, - site_hostname VARCHAR(255) DEFAULT '' NOT NULL, + site_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, + site_hostname VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, ip_exclude INTEGER DEFAULT 0 NOT NULL );; @@ -1022,9 +1007,9 @@ END;; # Table: 'phpbb_smilies' CREATE TABLE phpbb_smilies ( smiley_id INTEGER NOT NULL, - code VARCHAR(50) DEFAULT '' NOT NULL, - emotion VARCHAR(50) DEFAULT '' NOT NULL, - smiley_url VARCHAR(50) DEFAULT '' NOT NULL, + code VARCHAR(50) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + emotion VARCHAR(50) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + smiley_url VARCHAR(50) CHARACTER SET NONE DEFAULT '' NOT NULL, smiley_width INTEGER DEFAULT 0 NOT NULL, smiley_height INTEGER DEFAULT 0 NOT NULL, smiley_order INTEGER DEFAULT 0 NOT NULL, @@ -1049,8 +1034,8 @@ END;; # Table: 'phpbb_styles' CREATE TABLE phpbb_styles ( style_id INTEGER NOT NULL, - style_name VARCHAR(252) DEFAULT '' NOT NULL, - style_copyright VARCHAR(255) DEFAULT '' NOT NULL, + style_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + style_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, style_active INTEGER DEFAULT 1 NOT NULL, template_id INTEGER DEFAULT 0 NOT NULL, theme_id INTEGER DEFAULT 0 NOT NULL, @@ -1078,10 +1063,10 @@ END;; # Table: 'phpbb_styles_template' CREATE TABLE phpbb_styles_template ( template_id INTEGER NOT NULL, - template_name VARCHAR(252) DEFAULT '' NOT NULL, - template_copyright VARCHAR(255) DEFAULT '' NOT NULL, - template_path VARCHAR(100) DEFAULT '' NOT NULL, - bbcode_bitfield VARCHAR(252) DEFAULT 'kNg=' NOT NULL, + template_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + template_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + template_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL, + bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT 'kNg=' NOT NULL, template_storedb INTEGER DEFAULT 0 NOT NULL );; @@ -1103,10 +1088,10 @@ END;; # Table: 'phpbb_styles_template_data' CREATE TABLE phpbb_styles_template_data ( template_id INTEGER NOT NULL, - template_filename VARCHAR(100) DEFAULT '' NOT NULL, - template_included BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, + template_filename VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL, + template_included BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL, template_mtime INTEGER DEFAULT 0 NOT NULL, - template_data BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL + template_data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL );; CREATE INDEX phpbb_styles_template_data_tid ON phpbb_styles_template_data(template_id);; @@ -1126,12 +1111,12 @@ END;; # Table: 'phpbb_styles_theme' CREATE TABLE phpbb_styles_theme ( theme_id INTEGER NOT NULL, - theme_name VARCHAR(252) DEFAULT '' NOT NULL, - theme_copyright VARCHAR(255) DEFAULT '' NOT NULL, - theme_path VARCHAR(100) DEFAULT '' NOT NULL, + theme_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + theme_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + theme_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL, theme_storedb INTEGER DEFAULT 0 NOT NULL, theme_mtime INTEGER DEFAULT 0 NOT NULL, - theme_data BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL + theme_data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL );; ALTER TABLE phpbb_styles_theme ADD PRIMARY KEY (theme_id);; @@ -1152,103 +1137,103 @@ END;; # Table: 'phpbb_styles_imageset' CREATE TABLE phpbb_styles_imageset ( imageset_id INTEGER NOT NULL, - imageset_name VARCHAR(252) DEFAULT '' NOT NULL, - imageset_copyright VARCHAR(255) DEFAULT '' NOT NULL, - imageset_path VARCHAR(100) DEFAULT '' NOT NULL, - site_logo VARCHAR(200) DEFAULT '' NOT NULL, - upload_bar VARCHAR(200) DEFAULT '' NOT NULL, - poll_left VARCHAR(200) DEFAULT '' NOT NULL, - poll_center VARCHAR(200) DEFAULT '' NOT NULL, - poll_right VARCHAR(200) DEFAULT '' NOT NULL, - icon_friend VARCHAR(200) DEFAULT '' NOT NULL, - icon_foe VARCHAR(200) DEFAULT '' NOT NULL, - forum_link VARCHAR(200) DEFAULT '' NOT NULL, - forum_read VARCHAR(200) DEFAULT '' NOT NULL, - forum_read_locked VARCHAR(200) DEFAULT '' NOT NULL, - forum_read_subforum VARCHAR(200) DEFAULT '' NOT NULL, - forum_unread VARCHAR(200) DEFAULT '' NOT NULL, - forum_unread_locked VARCHAR(200) DEFAULT '' NOT NULL, - forum_unread_subforum VARCHAR(200) DEFAULT '' NOT NULL, - topic_moved VARCHAR(200) DEFAULT '' NOT NULL, - topic_read VARCHAR(200) DEFAULT '' NOT NULL, - topic_read_mine VARCHAR(200) DEFAULT '' NOT NULL, - topic_read_hot VARCHAR(200) DEFAULT '' NOT NULL, - topic_read_hot_mine VARCHAR(200) DEFAULT '' NOT NULL, - topic_read_locked VARCHAR(200) DEFAULT '' NOT NULL, - topic_read_locked_mine VARCHAR(200) DEFAULT '' NOT NULL, - topic_unread VARCHAR(200) DEFAULT '' NOT NULL, - topic_unread_mine VARCHAR(200) DEFAULT '' NOT NULL, - topic_unread_hot VARCHAR(200) DEFAULT '' NOT NULL, - topic_unread_hot_mine VARCHAR(200) DEFAULT '' NOT NULL, - topic_unread_locked VARCHAR(200) DEFAULT '' NOT NULL, - topic_unread_locked_mine VARCHAR(200) DEFAULT '' NOT NULL, - sticky_read VARCHAR(200) DEFAULT '' NOT NULL, - sticky_read_mine VARCHAR(200) DEFAULT '' NOT NULL, - sticky_read_locked VARCHAR(200) DEFAULT '' NOT NULL, - sticky_read_locked_mine VARCHAR(200) DEFAULT '' NOT NULL, - sticky_unread VARCHAR(200) DEFAULT '' NOT NULL, - sticky_unread_mine VARCHAR(200) DEFAULT '' NOT NULL, - sticky_unread_locked VARCHAR(200) DEFAULT '' NOT NULL, - sticky_unread_locked_mine VARCHAR(200) DEFAULT '' NOT NULL, - announce_read VARCHAR(200) DEFAULT '' NOT NULL, - announce_read_mine VARCHAR(200) DEFAULT '' NOT NULL, - announce_read_locked VARCHAR(200) DEFAULT '' NOT NULL, - announce_read_locked_mine VARCHAR(200) DEFAULT '' NOT NULL, - announce_unread VARCHAR(200) DEFAULT '' NOT NULL, - announce_unread_mine VARCHAR(200) DEFAULT '' NOT NULL, - announce_unread_locked VARCHAR(200) DEFAULT '' NOT NULL, - announce_unread_locked_mine VARCHAR(200) DEFAULT '' NOT NULL, - global_read VARCHAR(200) DEFAULT '' NOT NULL, - global_read_mine VARCHAR(200) DEFAULT '' NOT NULL, - global_read_locked VARCHAR(200) DEFAULT '' NOT NULL, - global_read_locked_mine VARCHAR(200) DEFAULT '' NOT NULL, - global_unread VARCHAR(200) DEFAULT '' NOT NULL, - global_unread_mine VARCHAR(200) DEFAULT '' NOT NULL, - global_unread_locked VARCHAR(200) DEFAULT '' NOT NULL, - global_unread_locked_mine VARCHAR(200) DEFAULT '' NOT NULL, - pm_read VARCHAR(200) DEFAULT '' NOT NULL, - pm_unread VARCHAR(200) DEFAULT '' NOT NULL, - icon_contact_aim VARCHAR(200) DEFAULT '' NOT NULL, - icon_contact_email VARCHAR(200) DEFAULT '' NOT NULL, - icon_contact_icq VARCHAR(200) DEFAULT '' NOT NULL, - icon_contact_jabber VARCHAR(200) DEFAULT '' NOT NULL, - icon_contact_msnm VARCHAR(200) DEFAULT '' NOT NULL, - icon_contact_pm VARCHAR(200) DEFAULT '' NOT NULL, - icon_contact_yahoo VARCHAR(200) DEFAULT '' NOT NULL, - icon_contact_www VARCHAR(200) DEFAULT '' NOT NULL, - icon_post_delete VARCHAR(200) DEFAULT '' NOT NULL, - icon_post_edit VARCHAR(200) DEFAULT '' NOT NULL, - icon_post_info VARCHAR(200) DEFAULT '' NOT NULL, - icon_post_quote VARCHAR(200) DEFAULT '' NOT NULL, - icon_post_report VARCHAR(200) DEFAULT '' NOT NULL, - icon_post_target VARCHAR(200) DEFAULT '' NOT NULL, - icon_post_target_unread VARCHAR(200) DEFAULT '' NOT NULL, - icon_topic_attach VARCHAR(200) DEFAULT '' NOT NULL, - icon_topic_latest VARCHAR(200) DEFAULT '' NOT NULL, - icon_topic_newest VARCHAR(200) DEFAULT '' NOT NULL, - icon_topic_reported VARCHAR(200) DEFAULT '' NOT NULL, - icon_topic_unapproved VARCHAR(200) DEFAULT '' NOT NULL, - icon_user_online VARCHAR(200) DEFAULT '' NOT NULL, - icon_user_offline VARCHAR(200) DEFAULT '' NOT NULL, - icon_user_profile VARCHAR(200) DEFAULT '' NOT NULL, - icon_user_search VARCHAR(200) DEFAULT '' NOT NULL, - icon_user_warn VARCHAR(200) DEFAULT '' NOT NULL, - button_pm_forward VARCHAR(200) DEFAULT '' NOT NULL, - button_pm_new VARCHAR(200) DEFAULT '' NOT NULL, - button_pm_reply VARCHAR(200) DEFAULT '' NOT NULL, - button_topic_locked VARCHAR(200) DEFAULT '' NOT NULL, - button_topic_new VARCHAR(200) DEFAULT '' NOT NULL, - button_topic_reply VARCHAR(200) DEFAULT '' NOT NULL, - user_icon1 VARCHAR(200) DEFAULT '' NOT NULL, - user_icon2 VARCHAR(200) DEFAULT '' NOT NULL, - user_icon3 VARCHAR(200) DEFAULT '' NOT NULL, - user_icon4 VARCHAR(200) DEFAULT '' NOT NULL, - user_icon5 VARCHAR(200) DEFAULT '' NOT NULL, - user_icon6 VARCHAR(200) DEFAULT '' NOT NULL, - user_icon7 VARCHAR(200) DEFAULT '' NOT NULL, - user_icon8 VARCHAR(200) DEFAULT '' NOT NULL, - user_icon9 VARCHAR(200) DEFAULT '' NOT NULL, - user_icon10 VARCHAR(200) DEFAULT '' NOT NULL + imageset_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + imageset_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + imageset_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL, + site_logo VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + upload_bar VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + poll_left VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + poll_center VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + poll_right VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_friend VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_foe VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + forum_link VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + forum_read VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + forum_read_locked VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + forum_read_subforum VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + forum_unread VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + forum_unread_locked VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + forum_unread_subforum VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + topic_moved VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + topic_read VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + topic_read_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + topic_read_hot VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + topic_read_hot_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + topic_read_locked VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + topic_read_locked_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + topic_unread VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + topic_unread_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + topic_unread_hot VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + topic_unread_hot_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + topic_unread_locked VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + topic_unread_locked_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + sticky_read VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + sticky_read_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + sticky_read_locked VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + sticky_read_locked_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + sticky_unread VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + sticky_unread_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + sticky_unread_locked VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + sticky_unread_locked_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + announce_read VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + announce_read_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + announce_read_locked VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + announce_read_locked_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + announce_unread VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + announce_unread_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + announce_unread_locked VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + announce_unread_locked_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + global_read VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + global_read_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + global_read_locked VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + global_read_locked_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + global_unread VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + global_unread_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + global_unread_locked VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + global_unread_locked_mine VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + pm_read VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + pm_unread VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_contact_aim VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_contact_email VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_contact_icq VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_contact_jabber VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_contact_msnm VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_contact_pm VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_contact_yahoo VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_contact_www VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_post_delete VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_post_edit VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_post_info VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_post_quote VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_post_report VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_post_target VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_post_target_unread VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_topic_attach VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_topic_latest VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_topic_newest VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_topic_reported VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_topic_unapproved VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_user_online VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_user_offline VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_user_profile VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_user_search VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + icon_user_warn VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + button_pm_forward VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + button_pm_new VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + button_pm_reply VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + button_topic_locked VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + button_topic_new VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + button_topic_reply VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + user_icon1 VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + user_icon2 VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + user_icon3 VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + user_icon4 VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + user_icon5 VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + user_icon6 VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + user_icon7 VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + user_icon8 VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + user_icon9 VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, + user_icon10 VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL );; ALTER TABLE phpbb_styles_imageset ADD PRIMARY KEY (imageset_id);; @@ -1274,7 +1259,7 @@ CREATE TABLE phpbb_topics ( topic_attachment INTEGER DEFAULT 0 NOT NULL, topic_approved INTEGER DEFAULT 1 NOT NULL, topic_reported INTEGER DEFAULT 0 NOT NULL, - topic_title BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, + topic_title VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, topic_poster INTEGER DEFAULT 0 NOT NULL, topic_time INTEGER DEFAULT 0 NOT NULL, topic_time_limit INTEGER DEFAULT 0 NOT NULL, @@ -1284,16 +1269,19 @@ CREATE TABLE phpbb_topics ( topic_status INTEGER DEFAULT 0 NOT NULL, topic_type INTEGER DEFAULT 0 NOT NULL, topic_first_post_id INTEGER DEFAULT 0 NOT NULL, - topic_first_poster_name VARCHAR(255) DEFAULT '' NOT NULL, + topic_first_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + topic_first_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL, topic_last_post_id INTEGER DEFAULT 0 NOT NULL, topic_last_poster_id INTEGER DEFAULT 0 NOT NULL, - topic_last_poster_name VARCHAR(255) DEFAULT '' NOT NULL, + topic_last_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + topic_last_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL, + topic_last_post_subject VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, topic_last_post_time INTEGER DEFAULT 0 NOT NULL, topic_last_view_time INTEGER DEFAULT 0 NOT NULL, topic_moved_id INTEGER DEFAULT 0 NOT NULL, topic_bumped INTEGER DEFAULT 0 NOT NULL, topic_bumper INTEGER DEFAULT 0 NOT NULL, - poll_title BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, + poll_title VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, poll_start INTEGER DEFAULT 0 NOT NULL, poll_length INTEGER DEFAULT 0 NOT NULL, poll_max_options INTEGER DEFAULT 1 NOT NULL, @@ -1306,6 +1294,7 @@ ALTER TABLE phpbb_topics ADD PRIMARY KEY (topic_id);; CREATE INDEX phpbb_topics_forum_id ON phpbb_topics(forum_id);; CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics(forum_id, topic_type);; CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics(topic_last_post_time);; +CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics(topic_approved);; CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics(forum_id, topic_last_post_time, topic_moved_id);; CREATE GENERATOR phpbb_topics_gen;; @@ -1369,33 +1358,36 @@ CREATE TABLE phpbb_users ( user_id INTEGER NOT NULL, user_type INTEGER DEFAULT 0 NOT NULL, group_id INTEGER DEFAULT 3 NOT NULL, - user_permissions BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, + user_permissions BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL, user_perm_from INTEGER DEFAULT 0 NOT NULL, - user_ip VARCHAR(40) DEFAULT '' NOT NULL, + user_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, user_regdate INTEGER DEFAULT 0 NOT NULL, - username VARCHAR(252) DEFAULT '' NOT NULL, - user_password VARCHAR(40) DEFAULT '' NOT NULL, + username VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + username_clean VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + user_password VARCHAR(40) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, user_passchg INTEGER DEFAULT 0 NOT NULL, - user_email VARCHAR(100) DEFAULT '' NOT NULL, + user_email VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, user_email_hash DOUBLE PRECISION DEFAULT 0 NOT NULL, - user_birthday VARCHAR(10) DEFAULT '' NOT NULL, + user_birthday VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL, user_lastvisit INTEGER DEFAULT 0 NOT NULL, user_lastmark INTEGER DEFAULT 0 NOT NULL, user_lastpost_time INTEGER DEFAULT 0 NOT NULL, - user_lastpage VARCHAR(200) DEFAULT '' NOT NULL, - user_last_confirm_key VARCHAR(10) DEFAULT '' NOT NULL, + user_lastpage VARCHAR(200) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + user_last_confirm_key VARCHAR(10) CHARACTER SET NONE DEFAULT '' NOT NULL, user_last_search INTEGER DEFAULT 0 NOT NULL, user_warnings INTEGER DEFAULT 0 NOT NULL, user_last_warning INTEGER DEFAULT 0 NOT NULL, user_login_attempts INTEGER DEFAULT 0 NOT NULL, + user_inactive_reason INTEGER DEFAULT 0 NOT NULL, + user_inactive_time INTEGER DEFAULT 0 NOT NULL, user_posts INTEGER DEFAULT 0 NOT NULL, - user_lang VARCHAR(30) DEFAULT '' NOT NULL, + user_lang VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL, user_timezone DOUBLE PRECISION DEFAULT 0 NOT NULL, user_dst INTEGER DEFAULT 0 NOT NULL, - user_dateformat VARCHAR(30) DEFAULT 'd M Y H:i' NOT NULL, + user_dateformat VARCHAR(30) CHARACTER SET UTF8 DEFAULT 'd M Y H:i' NOT NULL COLLATE UNICODE, user_style INTEGER DEFAULT 0 NOT NULL, user_rank INTEGER DEFAULT 0 NOT NULL, - user_colour VARCHAR(6) DEFAULT '' NOT NULL, + user_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL, user_new_privmsg INTEGER DEFAULT 0 NOT NULL, user_unread_privmsg INTEGER DEFAULT 0 NOT NULL, user_last_privmsg INTEGER DEFAULT 0 NOT NULL, @@ -1403,38 +1395,37 @@ CREATE TABLE phpbb_users ( user_full_folder INTEGER DEFAULT -3 NOT NULL, user_emailtime INTEGER DEFAULT 0 NOT NULL, user_topic_show_days INTEGER DEFAULT 0 NOT NULL, - user_topic_sortby_type VARCHAR(1) DEFAULT 't' NOT NULL, - user_topic_sortby_dir VARCHAR(1) DEFAULT 'd' NOT NULL, + user_topic_sortby_type VARCHAR(1) CHARACTER SET NONE DEFAULT 't' NOT NULL, + user_topic_sortby_dir VARCHAR(1) CHARACTER SET NONE DEFAULT 'd' NOT NULL, user_post_show_days INTEGER DEFAULT 0 NOT NULL, - user_post_sortby_type VARCHAR(1) DEFAULT 't' NOT NULL, - user_post_sortby_dir VARCHAR(1) DEFAULT 'a' NOT NULL, + user_post_sortby_type VARCHAR(1) CHARACTER SET NONE DEFAULT 't' NOT NULL, + user_post_sortby_dir VARCHAR(1) CHARACTER SET NONE DEFAULT 'a' NOT NULL, user_notify INTEGER DEFAULT 0 NOT NULL, user_notify_pm INTEGER DEFAULT 1 NOT NULL, user_notify_type INTEGER DEFAULT 0 NOT NULL, user_allow_pm INTEGER DEFAULT 1 NOT NULL, - user_allow_email INTEGER DEFAULT 1 NOT NULL, user_allow_viewonline INTEGER DEFAULT 1 NOT NULL, user_allow_viewemail INTEGER DEFAULT 1 NOT NULL, user_allow_massemail INTEGER DEFAULT 1 NOT NULL, user_options INTEGER DEFAULT 893 NOT NULL, - user_avatar VARCHAR(255) DEFAULT '' NOT NULL, + user_avatar VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, user_avatar_type INTEGER DEFAULT 0 NOT NULL, user_avatar_width INTEGER DEFAULT 0 NOT NULL, user_avatar_height INTEGER DEFAULT 0 NOT NULL, - user_sig BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - user_sig_bbcode_uid VARCHAR(5) DEFAULT '' NOT NULL, - user_sig_bbcode_bitfield VARCHAR(252) DEFAULT '' NOT NULL, - user_from VARCHAR(100) DEFAULT '' NOT NULL, - user_icq VARCHAR(15) DEFAULT '' NOT NULL, - user_aim VARCHAR(255) DEFAULT '' NOT NULL, - user_yim VARCHAR(255) DEFAULT '' NOT NULL, - user_msnm VARCHAR(255) DEFAULT '' NOT NULL, - user_jabber VARCHAR(255) DEFAULT '' NOT NULL, - user_website VARCHAR(200) DEFAULT '' NOT NULL, - user_occ VARCHAR(255) DEFAULT '' NOT NULL, - user_interests BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, - user_actkey VARCHAR(32) DEFAULT '' NOT NULL, - user_newpasswd VARCHAR(32) DEFAULT '' NOT NULL + user_sig BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + user_sig_bbcode_uid VARCHAR(5) CHARACTER SET NONE DEFAULT '' NOT NULL, + user_sig_bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, + user_from VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + user_icq VARCHAR(15) CHARACTER SET NONE DEFAULT '' NOT NULL, + user_aim VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + user_yim VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + user_msnm VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + user_jabber VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + user_website VARCHAR(200) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + user_occ VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + user_interests BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + user_actkey VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, + user_newpasswd VARCHAR(32) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE );; ALTER TABLE phpbb_users ADD PRIMARY KEY (user_id);; @@ -1442,7 +1433,7 @@ ALTER TABLE phpbb_users ADD PRIMARY KEY (user_id);; CREATE INDEX phpbb_users_user_birthday ON phpbb_users(user_birthday);; CREATE INDEX phpbb_users_user_email_hash ON phpbb_users(user_email_hash);; CREATE INDEX phpbb_users_user_type ON phpbb_users(user_type);; -CREATE INDEX phpbb_users_username ON phpbb_users(username);; +CREATE INDEX phpbb_users_username_clean ON phpbb_users(username_clean);; CREATE GENERATOR phpbb_users_gen;; SET GENERATOR phpbb_users_gen TO 0;; @@ -1481,8 +1472,8 @@ END;; # Table: 'phpbb_words' CREATE TABLE phpbb_words ( word_id INTEGER NOT NULL, - word VARCHAR(255) DEFAULT '' NOT NULL, - replacement VARCHAR(255) DEFAULT '' NOT NULL + word VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + replacement VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE );; ALTER TABLE phpbb_words ADD PRIMARY KEY (word_id);; diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 737ec7842f..b058a7c86d 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -17,10 +17,11 @@ CREATE TABLE [phpbb_attachments] ( [topic_id] [int] DEFAULT (0) NOT NULL , [in_message] [int] DEFAULT (0) NOT NULL , [poster_id] [int] DEFAULT (0) NOT NULL , + [is_orphan] [int] DEFAULT (1) NOT NULL , [physical_filename] [varchar] (255) DEFAULT ('') NOT NULL , [real_filename] [varchar] (255) DEFAULT ('') NOT NULL , [download_count] [int] DEFAULT (0) NOT NULL , - [attach_comment] [varchar] (8000) DEFAULT ('') NOT NULL , + [attach_comment] [varchar] (4000) DEFAULT ('') NOT NULL , [extension] [varchar] (100) DEFAULT ('') NOT NULL , [mimetype] [varchar] (100) DEFAULT ('') NOT NULL , [filesize] [int] DEFAULT (0) NOT NULL , @@ -48,7 +49,7 @@ GO CREATE INDEX [poster_id] ON [phpbb_attachments]([poster_id]) ON [PRIMARY] GO -CREATE INDEX [filesize] ON [phpbb_attachments]([filesize]) ON [PRIMARY] +CREATE INDEX [is_orphan] ON [phpbb_attachments]([is_orphan]) ON [PRIMARY] GO @@ -100,7 +101,7 @@ GO CREATE TABLE [phpbb_acl_roles] ( [role_id] [int] IDENTITY (1, 1) NOT NULL , [role_name] [varchar] (255) DEFAULT ('') NOT NULL , - [role_description] [varchar] (8000) DEFAULT ('') NOT NULL , + [role_description] [varchar] (4000) DEFAULT ('') NOT NULL , [role_type] [varchar] (10) DEFAULT ('') NOT NULL , [role_order] [int] DEFAULT (0) NOT NULL ) ON [PRIMARY] @@ -202,7 +203,7 @@ CREATE TABLE [phpbb_bbcodes] ( [bbcode_tag] [varchar] (16) DEFAULT ('') NOT NULL , [bbcode_helpline] [varchar] (255) DEFAULT ('') NOT NULL , [display_on_posting] [int] DEFAULT (0) NOT NULL , - [bbcode_match] [varchar] (8000) DEFAULT ('') NOT NULL , + [bbcode_match] [varchar] (4000) DEFAULT ('') NOT NULL , [bbcode_tpl] [text] DEFAULT ('') NOT NULL , [first_pass_match] [text] DEFAULT ('') NOT NULL , [first_pass_replace] [text] DEFAULT ('') NOT NULL , @@ -245,7 +246,7 @@ GO CREATE TABLE [phpbb_bots] ( [bot_id] [int] IDENTITY (1, 1) NOT NULL , [bot_active] [int] DEFAULT (1) NOT NULL , - [bot_name] [varchar] (3000) DEFAULT ('') NOT NULL , + [bot_name] [varchar] (255) DEFAULT ('') NOT NULL , [user_id] [int] DEFAULT (0) NOT NULL , [bot_agent] [varchar] (255) DEFAULT ('') NOT NULL , [bot_ip] [varchar] (255) DEFAULT ('') NOT NULL @@ -267,7 +268,7 @@ GO Table: 'phpbb_config' */ CREATE TABLE [phpbb_config] ( - [config_name] [varchar] (252) DEFAULT ('') NOT NULL , + [config_name] [varchar] (255) DEFAULT ('') NOT NULL , [config_value] [varchar] (255) DEFAULT ('') NOT NULL , [is_dynamic] [int] DEFAULT (0) NOT NULL ) ON [PRIMARY] @@ -312,7 +313,7 @@ GO */ CREATE TABLE [phpbb_disallow] ( [disallow_id] [int] IDENTITY (1, 1) NOT NULL , - [disallow_username] [varchar] (252) DEFAULT ('') NOT NULL + [disallow_username] [varchar] (255) DEFAULT ('') NOT NULL ) ON [PRIMARY] GO @@ -333,7 +334,7 @@ CREATE TABLE [phpbb_drafts] ( [topic_id] [int] DEFAULT (0) NOT NULL , [forum_id] [int] DEFAULT (0) NOT NULL , [save_time] [int] DEFAULT (0) NOT NULL , - [draft_subject] [varchar] (1000) DEFAULT ('') NOT NULL , + [draft_subject] [varchar] (100) DEFAULT ('') NOT NULL , [draft_message] [text] DEFAULT ('') NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO @@ -400,19 +401,19 @@ CREATE TABLE [phpbb_forums] ( [left_id] [int] DEFAULT (0) NOT NULL , [right_id] [int] DEFAULT (0) NOT NULL , [forum_parents] [text] DEFAULT ('') NOT NULL , - [forum_name] [varchar] (3000) DEFAULT ('') NOT NULL , - [forum_desc] [varchar] (8000) DEFAULT ('') NOT NULL , - [forum_desc_bitfield] [varchar] (252) DEFAULT ('') NOT NULL , - [forum_desc_options] [int] DEFAULT (0) NOT NULL , + [forum_name] [varchar] (255) DEFAULT ('') NOT NULL , + [forum_desc] [varchar] (4000) DEFAULT ('') NOT NULL , + [forum_desc_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , + [forum_desc_options] [int] DEFAULT (7) NOT NULL , [forum_desc_uid] [varchar] (5) DEFAULT ('') NOT NULL , [forum_link] [varchar] (255) DEFAULT ('') NOT NULL , [forum_password] [varchar] (40) DEFAULT ('') NOT NULL , [forum_style] [int] DEFAULT (0) NOT NULL , [forum_image] [varchar] (255) DEFAULT ('') NOT NULL , - [forum_rules] [varchar] (8000) DEFAULT ('') NOT NULL , + [forum_rules] [varchar] (4000) DEFAULT ('') NOT NULL , [forum_rules_link] [varchar] (255) DEFAULT ('') NOT NULL , - [forum_rules_bitfield] [varchar] (252) DEFAULT ('') NOT NULL , - [forum_rules_options] [int] DEFAULT (0) NOT NULL , + [forum_rules_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , + [forum_rules_options] [int] DEFAULT (7) NOT NULL , [forum_rules_uid] [varchar] (5) DEFAULT ('') NOT NULL , [forum_topics_per_page] [int] DEFAULT (0) NOT NULL , [forum_type] [int] DEFAULT (0) NOT NULL , @@ -422,8 +423,10 @@ CREATE TABLE [phpbb_forums] ( [forum_topics_real] [int] DEFAULT (0) NOT NULL , [forum_last_post_id] [int] DEFAULT (0) NOT NULL , [forum_last_poster_id] [int] DEFAULT (0) NOT NULL , + [forum_last_post_subject] [varchar] (100) DEFAULT ('') NOT NULL , [forum_last_post_time] [int] DEFAULT (0) NOT NULL , [forum_last_poster_name] [varchar] (255) DEFAULT ('') NOT NULL , + [forum_last_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL , [forum_flags] [int] DEFAULT (32) NOT NULL , [display_on_index] [int] DEFAULT (1) NOT NULL , [enable_indexing] [int] DEFAULT (1) NOT NULL , @@ -515,10 +518,10 @@ GO CREATE TABLE [phpbb_groups] ( [group_id] [int] IDENTITY (1, 1) NOT NULL , [group_type] [int] DEFAULT (1) NOT NULL , - [group_name] [varchar] (252) DEFAULT ('') NOT NULL , - [group_desc] [varchar] (8000) DEFAULT ('') NOT NULL , - [group_desc_bitfield] [varchar] (252) DEFAULT ('') NOT NULL , - [group_desc_options] [int] DEFAULT (0) NOT NULL , + [group_name] [varchar] (255) DEFAULT ('') NOT NULL , + [group_desc] [varchar] (4000) DEFAULT ('') NOT NULL , + [group_desc_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , + [group_desc_options] [int] DEFAULT (7) NOT NULL , [group_desc_uid] [varchar] (5) DEFAULT ('') NOT NULL , [group_display] [int] DEFAULT (0) NOT NULL , [group_avatar] [varchar] (255) DEFAULT ('') NOT NULL , @@ -605,7 +608,7 @@ CREATE TABLE [phpbb_log] ( [reportee_id] [int] DEFAULT (0) NOT NULL , [log_ip] [varchar] (40) DEFAULT ('') NOT NULL , [log_time] [int] DEFAULT (0) NOT NULL , - [log_operation] [varchar] (8000) DEFAULT ('') NOT NULL , + [log_operation] [varchar] (4000) DEFAULT ('') NOT NULL , [log_data] [text] DEFAULT ('') NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO @@ -639,7 +642,7 @@ GO CREATE TABLE [phpbb_moderator_cache] ( [forum_id] [int] DEFAULT (0) NOT NULL , [user_id] [int] DEFAULT (0) NOT NULL , - [username] [varchar] (252) DEFAULT ('') NOT NULL , + [username] [varchar] (255) DEFAULT ('') NOT NULL , [group_id] [int] DEFAULT (0) NOT NULL , [group_name] [varchar] (255) DEFAULT ('') NOT NULL , [display_on_index] [int] DEFAULT (1) NOT NULL @@ -694,7 +697,7 @@ GO CREATE TABLE [phpbb_poll_options] ( [poll_option_id] [int] DEFAULT (0) NOT NULL , [topic_id] [int] DEFAULT (0) NOT NULL , - [poll_option_text] [varchar] (8000) DEFAULT ('') NOT NULL , + [poll_option_text] [varchar] (4000) DEFAULT ('') NOT NULL , [poll_option_total] [int] DEFAULT (0) NOT NULL ) ON [PRIMARY] GO @@ -744,17 +747,16 @@ CREATE TABLE [phpbb_posts] ( [enable_smilies] [int] DEFAULT (1) NOT NULL , [enable_magic_url] [int] DEFAULT (1) NOT NULL , [enable_sig] [int] DEFAULT (1) NOT NULL , - [post_username] [varchar] (252) DEFAULT ('') NOT NULL , - [post_subject] [varchar] (1000) DEFAULT ('') NOT NULL , + [post_username] [varchar] (255) DEFAULT ('') NOT NULL , + [post_subject] [varchar] (100) DEFAULT ('') NOT NULL , [post_text] [text] DEFAULT ('') NOT NULL , [post_checksum] [varchar] (32) DEFAULT ('') NOT NULL , - [post_encoding] [varchar] (20) DEFAULT ('iso-8859-1') NOT NULL , [post_attachment] [int] DEFAULT (0) NOT NULL , - [bbcode_bitfield] [varchar] (252) DEFAULT ('') NOT NULL , + [bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , [bbcode_uid] [varchar] (5) DEFAULT ('') NOT NULL , [post_postcount] [int] DEFAULT (1) NOT NULL , [post_edit_time] [int] DEFAULT (0) NOT NULL , - [post_edit_reason] [varchar] (3000) DEFAULT ('') NOT NULL , + [post_edit_reason] [varchar] (255) DEFAULT ('') NOT NULL , [post_edit_user] [int] DEFAULT (0) NOT NULL , [post_edit_count] [int] DEFAULT (0) NOT NULL , [post_edit_locked] [int] DEFAULT (0) NOT NULL @@ -783,10 +785,7 @@ GO CREATE INDEX [post_approved] ON [phpbb_posts]([post_approved]) ON [PRIMARY] GO -CREATE INDEX [post_postcount] ON [phpbb_posts]([post_postcount]) ON [PRIMARY] -GO - -CREATE INDEX [post_time] ON [phpbb_posts]([post_time]) ON [PRIMARY] +CREATE INDEX [tid_post_time] ON [phpbb_posts]([topic_id], [post_time]) ON [PRIMARY] GO @@ -804,18 +803,17 @@ CREATE TABLE [phpbb_privmsgs] ( [enable_smilies] [int] DEFAULT (1) NOT NULL , [enable_magic_url] [int] DEFAULT (1) NOT NULL , [enable_sig] [int] DEFAULT (1) NOT NULL , - [message_subject] [varchar] (1000) DEFAULT ('') NOT NULL , + [message_subject] [varchar] (100) DEFAULT ('') NOT NULL , [message_text] [text] DEFAULT ('') NOT NULL , - [message_edit_reason] [varchar] (3000) DEFAULT ('') NOT NULL , + [message_edit_reason] [varchar] (255) DEFAULT ('') NOT NULL , [message_edit_user] [int] DEFAULT (0) NOT NULL , - [message_encoding] [varchar] (20) DEFAULT ('iso-8859-1') NOT NULL , [message_attachment] [int] DEFAULT (0) NOT NULL , - [bbcode_bitfield] [varchar] (252) DEFAULT ('') NOT NULL , + [bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , [bbcode_uid] [varchar] (5) DEFAULT ('') NOT NULL , [message_edit_time] [int] DEFAULT (0) NOT NULL , [message_edit_count] [int] DEFAULT (0) NOT NULL , - [to_address] [varchar] (8000) DEFAULT ('') NOT NULL , - [bcc_address] [varchar] (8000) DEFAULT ('') NOT NULL + [to_address] [varchar] (4000) DEFAULT ('') NOT NULL , + [bcc_address] [varchar] (4000) DEFAULT ('') NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO @@ -997,7 +995,7 @@ CREATE TABLE [phpbb_profile_lang] ( [field_id] [int] DEFAULT (0) NOT NULL , [lang_id] [int] DEFAULT (0) NOT NULL , [lang_name] [varchar] (255) DEFAULT ('') NOT NULL , - [lang_explain] [varchar] (8000) DEFAULT ('') NOT NULL , + [lang_explain] [varchar] (4000) DEFAULT ('') NOT NULL , [lang_default_value] [varchar] (255) DEFAULT ('') NOT NULL ) ON [PRIMARY] GO @@ -1097,7 +1095,7 @@ GO */ CREATE TABLE [phpbb_search_wordlist] ( [word_id] [int] IDENTITY (1, 1) NOT NULL , - [word_text] [nvarchar] (252) DEFAULT ('') NOT NULL , + [word_text] [varchar] (255) DEFAULT ('') NOT NULL , [word_common] [int] DEFAULT (0) NOT NULL ) ON [PRIMARY] GO @@ -1235,7 +1233,7 @@ GO */ CREATE TABLE [phpbb_styles] ( [style_id] [int] IDENTITY (1, 1) NOT NULL , - [style_name] [varchar] (252) DEFAULT ('') NOT NULL , + [style_name] [varchar] (255) DEFAULT ('') NOT NULL , [style_copyright] [varchar] (255) DEFAULT ('') NOT NULL , [style_active] [int] DEFAULT (1) NOT NULL , [template_id] [int] DEFAULT (0) NOT NULL , @@ -1269,10 +1267,10 @@ GO */ CREATE TABLE [phpbb_styles_template] ( [template_id] [int] IDENTITY (1, 1) NOT NULL , - [template_name] [varchar] (252) DEFAULT ('') NOT NULL , + [template_name] [varchar] (255) DEFAULT ('') NOT NULL , [template_copyright] [varchar] (255) DEFAULT ('') NOT NULL , [template_path] [varchar] (100) DEFAULT ('') NOT NULL , - [bbcode_bitfield] [varchar] (252) DEFAULT ('kNg=') NOT NULL , + [bbcode_bitfield] [varchar] (255) DEFAULT ('kNg=') NOT NULL , [template_storedb] [int] DEFAULT (0) NOT NULL ) ON [PRIMARY] GO @@ -1312,7 +1310,7 @@ GO */ CREATE TABLE [phpbb_styles_theme] ( [theme_id] [int] IDENTITY (1, 1) NOT NULL , - [theme_name] [varchar] (252) DEFAULT ('') NOT NULL , + [theme_name] [varchar] (255) DEFAULT ('') NOT NULL , [theme_copyright] [varchar] (255) DEFAULT ('') NOT NULL , [theme_path] [varchar] (100) DEFAULT ('') NOT NULL , [theme_storedb] [int] DEFAULT (0) NOT NULL , @@ -1337,7 +1335,7 @@ GO */ CREATE TABLE [phpbb_styles_imageset] ( [imageset_id] [int] IDENTITY (1, 1) NOT NULL , - [imageset_name] [varchar] (252) DEFAULT ('') NOT NULL , + [imageset_name] [varchar] (255) DEFAULT ('') NOT NULL , [imageset_copyright] [varchar] (255) DEFAULT ('') NOT NULL , [imageset_path] [varchar] (100) DEFAULT ('') NOT NULL , [site_logo] [varchar] (200) DEFAULT ('') NOT NULL , @@ -1458,7 +1456,7 @@ CREATE TABLE [phpbb_topics] ( [topic_attachment] [int] DEFAULT (0) NOT NULL , [topic_approved] [int] DEFAULT (1) NOT NULL , [topic_reported] [int] DEFAULT (0) NOT NULL , - [topic_title] [varchar] (1000) DEFAULT ('') NOT NULL , + [topic_title] [varchar] (100) DEFAULT ('') NOT NULL , [topic_poster] [int] DEFAULT (0) NOT NULL , [topic_time] [int] DEFAULT (0) NOT NULL , [topic_time_limit] [int] DEFAULT (0) NOT NULL , @@ -1469,15 +1467,18 @@ CREATE TABLE [phpbb_topics] ( [topic_type] [int] DEFAULT (0) NOT NULL , [topic_first_post_id] [int] DEFAULT (0) NOT NULL , [topic_first_poster_name] [varchar] (255) DEFAULT ('') NOT NULL , + [topic_first_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL , [topic_last_post_id] [int] DEFAULT (0) NOT NULL , [topic_last_poster_id] [int] DEFAULT (0) NOT NULL , [topic_last_poster_name] [varchar] (255) DEFAULT ('') NOT NULL , + [topic_last_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL , + [topic_last_post_subject] [varchar] (100) DEFAULT ('') NOT NULL , [topic_last_post_time] [int] DEFAULT (0) NOT NULL , [topic_last_view_time] [int] DEFAULT (0) NOT NULL , [topic_moved_id] [int] DEFAULT (0) NOT NULL , [topic_bumped] [int] DEFAULT (0) NOT NULL , [topic_bumper] [int] DEFAULT (0) NOT NULL , - [poll_title] [varchar] (1000) DEFAULT ('') NOT NULL , + [poll_title] [varchar] (100) DEFAULT ('') NOT NULL , [poll_start] [int] DEFAULT (0) NOT NULL , [poll_length] [int] DEFAULT (0) NOT NULL , [poll_max_options] [int] DEFAULT (1) NOT NULL , @@ -1502,6 +1503,9 @@ GO CREATE INDEX [last_post_time] ON [phpbb_topics]([topic_last_post_time]) ON [PRIMARY] GO +CREATE INDEX [topic_approved] ON [phpbb_topics]([topic_approved]) ON [PRIMARY] +GO + CREATE INDEX [fid_time_moved] ON [phpbb_topics]([forum_id], [topic_last_post_time], [topic_moved_id]) ON [PRIMARY] GO @@ -1600,7 +1604,8 @@ CREATE TABLE [phpbb_users] ( [user_perm_from] [int] DEFAULT (0) NOT NULL , [user_ip] [varchar] (40) DEFAULT ('') NOT NULL , [user_regdate] [int] DEFAULT (0) NOT NULL , - [username] [varchar] (252) DEFAULT ('') NOT NULL , + [username] [varchar] (255) DEFAULT ('') NOT NULL , + [username_clean] [varchar] (255) DEFAULT ('') NOT NULL , [user_password] [varchar] (40) DEFAULT ('') NOT NULL , [user_passchg] [int] DEFAULT (0) NOT NULL , [user_email] [varchar] (100) DEFAULT ('') NOT NULL , @@ -1615,6 +1620,8 @@ CREATE TABLE [phpbb_users] ( [user_warnings] [int] DEFAULT (0) NOT NULL , [user_last_warning] [int] DEFAULT (0) NOT NULL , [user_login_attempts] [int] DEFAULT (0) NOT NULL , + [user_inactive_reason] [int] DEFAULT (0) NOT NULL , + [user_inactive_time] [int] DEFAULT (0) NOT NULL , [user_posts] [int] DEFAULT (0) NOT NULL , [user_lang] [varchar] (30) DEFAULT ('') NOT NULL , [user_timezone] [float] DEFAULT (0) NOT NULL , @@ -1639,7 +1646,6 @@ CREATE TABLE [phpbb_users] ( [user_notify_pm] [int] DEFAULT (1) NOT NULL , [user_notify_type] [int] DEFAULT (0) NOT NULL , [user_allow_pm] [int] DEFAULT (1) NOT NULL , - [user_allow_email] [int] DEFAULT (1) NOT NULL , [user_allow_viewonline] [int] DEFAULT (1) NOT NULL , [user_allow_viewemail] [int] DEFAULT (1) NOT NULL , [user_allow_massemail] [int] DEFAULT (1) NOT NULL , @@ -1650,7 +1656,7 @@ CREATE TABLE [phpbb_users] ( [user_avatar_height] [int] DEFAULT (0) NOT NULL , [user_sig] [text] DEFAULT ('') NOT NULL , [user_sig_bbcode_uid] [varchar] (5) DEFAULT ('') NOT NULL , - [user_sig_bbcode_bitfield] [varchar] (252) DEFAULT ('') NOT NULL , + [user_sig_bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , [user_from] [varchar] (100) DEFAULT ('') NOT NULL , [user_icq] [varchar] (15) DEFAULT ('') NOT NULL , [user_aim] [varchar] (255) DEFAULT ('') NOT NULL , @@ -1659,7 +1665,7 @@ CREATE TABLE [phpbb_users] ( [user_jabber] [varchar] (255) DEFAULT ('') NOT NULL , [user_website] [varchar] (200) DEFAULT ('') NOT NULL , [user_occ] [varchar] (255) DEFAULT ('') NOT NULL , - [user_interests] [varchar] (8000) DEFAULT ('') NOT NULL , + [user_interests] [varchar] (4000) DEFAULT ('') NOT NULL , [user_actkey] [varchar] (32) DEFAULT ('') NOT NULL , [user_newpasswd] [varchar] (32) DEFAULT ('') NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] @@ -1681,7 +1687,7 @@ GO CREATE INDEX [user_type] ON [phpbb_users]([user_type]) ON [PRIMARY] GO -CREATE INDEX [username] ON [phpbb_users]([username]) ON [PRIMARY] +CREATE INDEX [username_clean] ON [phpbb_users]([username_clean]) ON [PRIMARY] GO diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql new file mode 100644 index 0000000000..5442fa2254 --- /dev/null +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -0,0 +1,1069 @@ +# +# MySQL Schema for phpBB 3.x - (c) phpBB Group, 2005 +# +# $Id$ +# + +# Table: 'phpbb_attachments' +CREATE TABLE phpbb_attachments ( + attach_id mediumint(8) UNSIGNED NOT NULL auto_increment, + post_msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + in_message tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + is_orphan tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + physical_filename varchar(255) DEFAULT '' NOT NULL, + real_filename varchar(255) DEFAULT '' NOT NULL, + download_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + attach_comment text NOT NULL, + extension varchar(100) DEFAULT '' NOT NULL, + mimetype varchar(100) DEFAULT '' NOT NULL, + filesize int(20) UNSIGNED DEFAULT '0' NOT NULL, + filetime int(11) UNSIGNED DEFAULT '0' NOT NULL, + thumbnail tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (attach_id), + KEY filetime (filetime), + KEY post_msg_id (post_msg_id), + KEY topic_id (topic_id), + KEY poster_id (poster_id), + KEY is_orphan (is_orphan) +); + + +# Table: 'phpbb_acl_groups' +CREATE TABLE phpbb_acl_groups ( + group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_setting tinyint(2) DEFAULT '0' NOT NULL, + KEY group_id (group_id), + KEY auth_opt_id (auth_option_id) +); + + +# Table: 'phpbb_acl_options' +CREATE TABLE phpbb_acl_options ( + auth_option_id mediumint(8) UNSIGNED NOT NULL auto_increment, + auth_option varchar(50) DEFAULT '' NOT NULL, + is_global tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + is_local tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + founder_only tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (auth_option_id), + KEY auth_option (auth_option) +); + + +# Table: 'phpbb_acl_roles' +CREATE TABLE phpbb_acl_roles ( + role_id mediumint(8) UNSIGNED NOT NULL auto_increment, + role_name text NOT NULL, + role_description text NOT NULL, + role_type varchar(10) DEFAULT '' NOT NULL, + role_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (role_id), + KEY role_type (role_type), + KEY role_order (role_order) +); + + +# Table: 'phpbb_acl_roles_data' +CREATE TABLE phpbb_acl_roles_data ( + role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_setting tinyint(2) DEFAULT '0' NOT NULL, + PRIMARY KEY (role_id, auth_option_id) +); + + +# Table: 'phpbb_acl_users' +CREATE TABLE phpbb_acl_users ( + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_role_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_setting tinyint(2) DEFAULT '0' NOT NULL, + KEY user_id (user_id), + KEY auth_option_id (auth_option_id) +); + + +# Table: 'phpbb_banlist' +CREATE TABLE phpbb_banlist ( + ban_id mediumint(8) UNSIGNED NOT NULL auto_increment, + ban_userid mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + ban_ip varchar(40) DEFAULT '' NOT NULL, + ban_email text NOT NULL, + ban_start int(11) UNSIGNED DEFAULT '0' NOT NULL, + ban_end int(11) UNSIGNED DEFAULT '0' NOT NULL, + ban_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + ban_reason text NOT NULL, + ban_give_reason text NOT NULL, + PRIMARY KEY (ban_id), + KEY ban_end (ban_end), + KEY ban_user (ban_userid, ban_exclude), + KEY ban_email (ban_email(255), ban_exclude), + KEY ban_ip (ban_ip, ban_exclude) +); + + +# Table: 'phpbb_bbcodes' +CREATE TABLE phpbb_bbcodes ( + bbcode_id tinyint(3) DEFAULT '0' NOT NULL, + bbcode_tag varchar(16) DEFAULT '' NOT NULL, + bbcode_helpline varchar(255) DEFAULT '' NOT NULL, + display_on_posting tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + bbcode_match text NOT NULL, + bbcode_tpl mediumtext NOT NULL, + first_pass_match mediumtext NOT NULL, + first_pass_replace mediumtext NOT NULL, + second_pass_match mediumtext NOT NULL, + second_pass_replace mediumtext NOT NULL, + PRIMARY KEY (bbcode_id), + KEY display_on_post (display_on_posting) +); + + +# Table: 'phpbb_bookmarks' +CREATE TABLE phpbb_bookmarks ( + topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + order_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + KEY order_id (order_id), + KEY topic_user_id (topic_id, user_id) +); + + +# Table: 'phpbb_bots' +CREATE TABLE phpbb_bots ( + bot_id mediumint(8) UNSIGNED NOT NULL auto_increment, + bot_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + bot_name text NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + bot_agent varchar(255) DEFAULT '' NOT NULL, + bot_ip varchar(255) DEFAULT '' NOT NULL, + PRIMARY KEY (bot_id), + KEY bot_active (bot_active) +); + + +# Table: 'phpbb_config' +CREATE TABLE phpbb_config ( + config_name varchar(255) DEFAULT '' NOT NULL, + config_value varchar(255) DEFAULT '' NOT NULL, + is_dynamic tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (config_name), + KEY is_dynamic (is_dynamic) +); + + +# Table: 'phpbb_confirm' +CREATE TABLE phpbb_confirm ( + confirm_id char(32) DEFAULT '' NOT NULL, + session_id char(32) DEFAULT '' NOT NULL, + confirm_type tinyint(3) DEFAULT '0' NOT NULL, + code varchar(8) DEFAULT '' NOT NULL, + PRIMARY KEY (session_id, confirm_id), + KEY confirm_type (confirm_type) +); + + +# Table: 'phpbb_disallow' +CREATE TABLE phpbb_disallow ( + disallow_id mediumint(8) UNSIGNED NOT NULL auto_increment, + disallow_username text NOT NULL, + PRIMARY KEY (disallow_id) +); + + +# Table: 'phpbb_drafts' +CREATE TABLE phpbb_drafts ( + draft_id mediumint(8) UNSIGNED NOT NULL auto_increment, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + save_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + draft_subject text NOT NULL, + draft_message mediumtext NOT NULL, + PRIMARY KEY (draft_id), + KEY save_time (save_time) +); + + +# Table: 'phpbb_extensions' +CREATE TABLE phpbb_extensions ( + extension_id mediumint(8) UNSIGNED NOT NULL auto_increment, + group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + extension varchar(100) DEFAULT '' NOT NULL, + PRIMARY KEY (extension_id) +); + + +# Table: 'phpbb_extension_groups' +CREATE TABLE phpbb_extension_groups ( + group_id mediumint(8) UNSIGNED NOT NULL auto_increment, + group_name text NOT NULL, + cat_id tinyint(2) DEFAULT '0' NOT NULL, + allow_group tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + download_mode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + upload_icon varchar(255) DEFAULT '' NOT NULL, + max_filesize int(20) UNSIGNED DEFAULT '0' NOT NULL, + allowed_forums text NOT NULL, + allow_in_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (group_id) +); + + +# Table: 'phpbb_forums' +CREATE TABLE phpbb_forums ( + forum_id mediumint(8) UNSIGNED NOT NULL auto_increment, + parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_parents mediumtext NOT NULL, + forum_name text NOT NULL, + forum_desc text NOT NULL, + forum_desc_bitfield varchar(255) DEFAULT '' NOT NULL, + forum_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL, + forum_desc_uid varchar(5) DEFAULT '' NOT NULL, + forum_link text NOT NULL, + forum_password varchar(120) DEFAULT '' NOT NULL, + forum_style tinyint(4) DEFAULT '0' NOT NULL, + forum_image varchar(255) DEFAULT '' NOT NULL, + forum_rules text NOT NULL, + forum_rules_link text NOT NULL, + forum_rules_bitfield varchar(255) DEFAULT '' NOT NULL, + forum_rules_options int(11) UNSIGNED DEFAULT '7' NOT NULL, + forum_rules_uid varchar(5) DEFAULT '' NOT NULL, + forum_topics_per_page tinyint(4) DEFAULT '0' NOT NULL, + forum_type tinyint(4) DEFAULT '0' NOT NULL, + forum_status tinyint(4) DEFAULT '0' NOT NULL, + forum_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_topics mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_topics_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_last_post_subject text NOT NULL, + forum_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + forum_last_poster_name text NOT NULL, + forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL, + forum_flags tinyint(4) DEFAULT '32' NOT NULL, + display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + prune_next int(11) UNSIGNED DEFAULT '0' NOT NULL, + prune_days tinyint(4) DEFAULT '0' NOT NULL, + prune_viewed tinyint(4) DEFAULT '0' NOT NULL, + prune_freq tinyint(4) DEFAULT '0' NOT NULL, + PRIMARY KEY (forum_id), + KEY left_right_id (left_id, right_id), + KEY forum_lastpost_id (forum_last_post_id) +); + + +# Table: 'phpbb_forums_access' +CREATE TABLE phpbb_forums_access ( + forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + session_id char(32) DEFAULT '' NOT NULL, + PRIMARY KEY (forum_id, user_id, session_id) +); + + +# Table: 'phpbb_forums_track' +CREATE TABLE phpbb_forums_track ( + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (user_id, forum_id) +); + + +# Table: 'phpbb_forums_watch' +CREATE TABLE phpbb_forums_watch ( + forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + KEY forum_id (forum_id), + KEY user_id (user_id), + KEY notify_stat (notify_status) +); + + +# Table: 'phpbb_groups' +CREATE TABLE phpbb_groups ( + group_id mediumint(8) UNSIGNED NOT NULL auto_increment, + group_type tinyint(4) DEFAULT '1' NOT NULL, + group_name text NOT NULL, + group_desc text NOT NULL, + group_desc_bitfield varchar(255) DEFAULT '' NOT NULL, + group_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL, + group_desc_uid varchar(5) DEFAULT '' NOT NULL, + group_display tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + group_avatar varchar(255) DEFAULT '' NOT NULL, + group_avatar_type tinyint(4) DEFAULT '0' NOT NULL, + group_avatar_width tinyint(4) DEFAULT '0' NOT NULL, + group_avatar_height tinyint(4) DEFAULT '0' NOT NULL, + group_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + group_colour varchar(6) DEFAULT '' NOT NULL, + group_sig_chars mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + group_receive_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + group_legend tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + PRIMARY KEY (group_id), + KEY group_legend (group_legend) +); + + +# Table: 'phpbb_icons' +CREATE TABLE phpbb_icons ( + icons_id mediumint(8) UNSIGNED NOT NULL auto_increment, + icons_url varchar(255) DEFAULT '' NOT NULL, + icons_width tinyint(4) DEFAULT '0' NOT NULL, + icons_height tinyint(4) DEFAULT '0' NOT NULL, + icons_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + PRIMARY KEY (icons_id), + KEY display_on_posting (display_on_posting) +); + + +# Table: 'phpbb_lang' +CREATE TABLE phpbb_lang ( + lang_id tinyint(4) NOT NULL auto_increment, + lang_iso varchar(30) DEFAULT '' NOT NULL, + lang_dir varchar(30) DEFAULT '' NOT NULL, + lang_english_name text NOT NULL, + lang_local_name text NOT NULL, + lang_author text NOT NULL, + PRIMARY KEY (lang_id), + KEY lang_iso (lang_iso) +); + + +# Table: 'phpbb_log' +CREATE TABLE phpbb_log ( + log_id mediumint(8) UNSIGNED NOT NULL auto_increment, + log_type tinyint(4) DEFAULT '0' NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + reportee_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + log_ip varchar(40) DEFAULT '' NOT NULL, + log_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + log_operation text NOT NULL, + log_data mediumtext NOT NULL, + PRIMARY KEY (log_id), + KEY log_type (log_type), + KEY forum_id (forum_id), + KEY topic_id (topic_id), + KEY reportee_id (reportee_id), + KEY user_id (user_id) +); + + +# Table: 'phpbb_moderator_cache' +CREATE TABLE phpbb_moderator_cache ( + forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + username text NOT NULL, + group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + group_name text NOT NULL, + display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + KEY disp_idx (display_on_index), + KEY forum_id (forum_id) +); + + +# Table: 'phpbb_modules' +CREATE TABLE phpbb_modules ( + module_id mediumint(8) UNSIGNED NOT NULL auto_increment, + module_enabled tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + module_display tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + module_basename varchar(255) DEFAULT '' NOT NULL, + module_class varchar(10) DEFAULT '' NOT NULL, + parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + module_langname varchar(255) DEFAULT '' NOT NULL, + module_mode varchar(255) DEFAULT '' NOT NULL, + module_auth varchar(255) DEFAULT '' NOT NULL, + PRIMARY KEY (module_id), + KEY left_right_id (left_id, right_id), + KEY module_enabled (module_enabled), + KEY class_left_id (module_class, left_id) +); + + +# Table: 'phpbb_poll_options' +CREATE TABLE phpbb_poll_options ( + poll_option_id tinyint(4) DEFAULT '0' NOT NULL, + topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + poll_option_text text NOT NULL, + poll_option_total mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + KEY poll_opt_id (poll_option_id), + KEY topic_id (topic_id) +); + + +# Table: 'phpbb_poll_votes' +CREATE TABLE phpbb_poll_votes ( + topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + poll_option_id tinyint(4) DEFAULT '0' NOT NULL, + vote_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + vote_user_ip varchar(40) DEFAULT '' NOT NULL, + KEY topic_id (topic_id), + KEY vote_user_id (vote_user_id), + KEY vote_user_ip (vote_user_ip) +); + + +# Table: 'phpbb_posts' +CREATE TABLE phpbb_posts ( + post_id mediumint(8) UNSIGNED NOT NULL auto_increment, + topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + poster_ip varchar(40) DEFAULT '' NOT NULL, + post_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + post_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + post_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + post_username text NOT NULL, + post_subject text NOT NULL, + post_text mediumtext NOT NULL, + post_checksum varchar(32) DEFAULT '' NOT NULL, + post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, + bbcode_uid varchar(5) DEFAULT '' NOT NULL, + post_postcount tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + post_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + post_edit_reason text NOT NULL, + post_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + post_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + post_edit_locked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (post_id), + KEY forum_id (forum_id), + KEY topic_id (topic_id), + KEY poster_ip (poster_ip), + KEY poster_id (poster_id), + KEY post_approved (post_approved), + KEY tid_post_time (topic_id, post_time) +); + + +# Table: 'phpbb_privmsgs' +CREATE TABLE phpbb_privmsgs ( + msg_id mediumint(8) UNSIGNED NOT NULL auto_increment, + root_level mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + author_ip varchar(40) DEFAULT '' NOT NULL, + message_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + enable_bbcode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + message_subject text NOT NULL, + message_text mediumtext NOT NULL, + message_edit_reason text NOT NULL, + message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + message_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, + bbcode_uid varchar(5) DEFAULT '' NOT NULL, + message_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + message_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + to_address text NOT NULL, + bcc_address text NOT NULL, + PRIMARY KEY (msg_id), + KEY author_ip (author_ip), + KEY message_time (message_time), + KEY author_id (author_id), + KEY root_level (root_level) +); + + +# Table: 'phpbb_privmsgs_folder' +CREATE TABLE phpbb_privmsgs_folder ( + folder_id mediumint(8) UNSIGNED NOT NULL auto_increment, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + folder_name text NOT NULL, + pm_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (folder_id), + KEY user_id (user_id) +); + + +# Table: 'phpbb_privmsgs_rules' +CREATE TABLE phpbb_privmsgs_rules ( + rule_id mediumint(8) UNSIGNED NOT NULL auto_increment, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + rule_check mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + rule_connection mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + rule_string text NOT NULL, + rule_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + rule_group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + rule_action mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + rule_folder_id int(4) DEFAULT '0' NOT NULL, + PRIMARY KEY (rule_id), + KEY user_id (user_id) +); + + +# Table: 'phpbb_privmsgs_to' +CREATE TABLE phpbb_privmsgs_to ( + msg_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + author_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + pm_deleted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + pm_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + pm_unread tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + pm_replied tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + pm_marked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + pm_forwarded tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + folder_id int(4) DEFAULT '0' NOT NULL, + KEY msg_id (msg_id), + KEY author_id (author_id), + KEY usr_flder_id (user_id, folder_id) +); + + +# Table: 'phpbb_profile_fields' +CREATE TABLE phpbb_profile_fields ( + field_id mediumint(8) UNSIGNED NOT NULL auto_increment, + field_name text NOT NULL, + field_type tinyint(4) DEFAULT '0' NOT NULL, + field_ident varchar(20) DEFAULT '' NOT NULL, + field_length varchar(20) DEFAULT '' NOT NULL, + field_minlen varchar(255) DEFAULT '' NOT NULL, + field_maxlen varchar(255) DEFAULT '' NOT NULL, + field_novalue text NOT NULL, + field_default_value text NOT NULL, + field_validation varchar(60) DEFAULT '' NOT NULL, + field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + field_hide tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + field_no_view tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + field_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + field_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (field_id), + KEY fld_type (field_type), + KEY fld_ordr (field_order) +); + + +# Table: 'phpbb_profile_fields_data' +CREATE TABLE phpbb_profile_fields_data ( + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (user_id) +); + + +# Table: 'phpbb_profile_fields_lang' +CREATE TABLE phpbb_profile_fields_lang ( + field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + field_type tinyint(4) DEFAULT '0' NOT NULL, + lang_value text NOT NULL, + PRIMARY KEY (field_id, lang_id, option_id) +); + + +# Table: 'phpbb_profile_lang' +CREATE TABLE phpbb_profile_lang ( + field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + lang_name text NOT NULL, + lang_explain text NOT NULL, + lang_default_value text NOT NULL, + PRIMARY KEY (field_id, lang_id) +); + + +# Table: 'phpbb_ranks' +CREATE TABLE phpbb_ranks ( + rank_id mediumint(8) UNSIGNED NOT NULL auto_increment, + rank_title text NOT NULL, + rank_min mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + rank_special tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + rank_image varchar(255) DEFAULT '' NOT NULL, + PRIMARY KEY (rank_id) +); + + +# Table: 'phpbb_reports' +CREATE TABLE phpbb_reports ( + report_id mediumint(8) UNSIGNED NOT NULL auto_increment, + reason_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + report_text mediumtext NOT NULL, + PRIMARY KEY (report_id) +); + + +# Table: 'phpbb_reports_reasons' +CREATE TABLE phpbb_reports_reasons ( + reason_id smallint(4) UNSIGNED NOT NULL auto_increment, + reason_title text NOT NULL, + reason_description mediumtext NOT NULL, + reason_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (reason_id) +); + + +# Table: 'phpbb_search_results' +CREATE TABLE phpbb_search_results ( + search_key varchar(32) DEFAULT '' NOT NULL, + search_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + search_keywords mediumtext NOT NULL, + search_authors mediumtext NOT NULL, + PRIMARY KEY (search_key) +); + + +# Table: 'phpbb_search_wordlist' +CREATE TABLE phpbb_search_wordlist ( + word_id mediumint(8) UNSIGNED NOT NULL auto_increment, + word_text text NOT NULL, + word_common tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (word_id), + UNIQUE wrd_txt (word_text(255)) +); + + +# Table: 'phpbb_search_wordmatch' +CREATE TABLE phpbb_search_wordmatch ( + post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + word_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + title_match tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + KEY word_id (word_id), + KEY post_id (post_id) +); + + +# Table: 'phpbb_sessions' +CREATE TABLE phpbb_sessions ( + session_id char(32) DEFAULT '' NOT NULL, + session_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + session_last_visit int(11) UNSIGNED DEFAULT '0' NOT NULL, + session_start int(11) UNSIGNED DEFAULT '0' NOT NULL, + session_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + session_ip varchar(40) DEFAULT '' NOT NULL, + session_browser varchar(150) DEFAULT '' NOT NULL, + session_page text NOT NULL, + session_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + session_autologin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + session_admin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (session_id), + KEY session_time (session_time), + KEY session_user_id (session_user_id) +); + + +# Table: 'phpbb_sessions_keys' +CREATE TABLE phpbb_sessions_keys ( + key_id char(32) DEFAULT '' NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + last_ip varchar(40) DEFAULT '' NOT NULL, + last_login int(11) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (key_id, user_id), + KEY last_login (last_login) +); + + +# Table: 'phpbb_sitelist' +CREATE TABLE phpbb_sitelist ( + site_id mediumint(8) UNSIGNED NOT NULL auto_increment, + site_ip varchar(40) DEFAULT '' NOT NULL, + site_hostname varchar(255) DEFAULT '' NOT NULL, + ip_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (site_id) +); + + +# Table: 'phpbb_smilies' +CREATE TABLE phpbb_smilies ( + smiley_id mediumint(8) UNSIGNED NOT NULL auto_increment, + code varchar(150) DEFAULT '' NOT NULL, + emotion varchar(150) DEFAULT '' NOT NULL, + smiley_url varchar(50) DEFAULT '' NOT NULL, + smiley_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + smiley_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + smiley_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + PRIMARY KEY (smiley_id), + KEY display_on_post (display_on_posting) +); + + +# Table: 'phpbb_styles' +CREATE TABLE phpbb_styles ( + style_id tinyint(4) NOT NULL auto_increment, + style_name text NOT NULL, + style_copyright text NOT NULL, + style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + template_id tinyint(4) DEFAULT '0' NOT NULL, + theme_id tinyint(4) DEFAULT '0' NOT NULL, + imageset_id tinyint(4) DEFAULT '0' NOT NULL, + PRIMARY KEY (style_id), + UNIQUE style_name (style_name(255)), + KEY template_id (template_id), + KEY theme_id (theme_id), + KEY imageset_id (imageset_id) +); + + +# Table: 'phpbb_styles_template' +CREATE TABLE phpbb_styles_template ( + template_id tinyint(4) NOT NULL auto_increment, + template_name text NOT NULL, + template_copyright text NOT NULL, + template_path varchar(100) DEFAULT '' NOT NULL, + bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL, + template_storedb tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (template_id), + UNIQUE tmplte_nm (template_name(255)) +); + + +# Table: 'phpbb_styles_template_data' +CREATE TABLE phpbb_styles_template_data ( + template_id tinyint(4) NOT NULL auto_increment, + template_filename varchar(100) DEFAULT '' NOT NULL, + template_included text NOT NULL, + template_mtime int(11) UNSIGNED DEFAULT '0' NOT NULL, + template_data mediumtext NOT NULL, + KEY tid (template_id), + KEY tfn (template_filename) +); + + +# Table: 'phpbb_styles_theme' +CREATE TABLE phpbb_styles_theme ( + theme_id tinyint(4) NOT NULL auto_increment, + theme_name text NOT NULL, + theme_copyright text NOT NULL, + theme_path varchar(100) DEFAULT '' NOT NULL, + theme_storedb tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + theme_mtime int(11) UNSIGNED DEFAULT '0' NOT NULL, + theme_data mediumtext NOT NULL, + PRIMARY KEY (theme_id), + UNIQUE theme_name (theme_name(255)) +); + + +# Table: 'phpbb_styles_imageset' +CREATE TABLE phpbb_styles_imageset ( + imageset_id tinyint(4) NOT NULL auto_increment, + imageset_name text NOT NULL, + imageset_copyright text NOT NULL, + imageset_path varchar(100) DEFAULT '' NOT NULL, + site_logo varchar(200) DEFAULT '' NOT NULL, + upload_bar varchar(200) DEFAULT '' NOT NULL, + poll_left varchar(200) DEFAULT '' NOT NULL, + poll_center varchar(200) DEFAULT '' NOT NULL, + poll_right varchar(200) DEFAULT '' NOT NULL, + icon_friend varchar(200) DEFAULT '' NOT NULL, + icon_foe varchar(200) DEFAULT '' NOT NULL, + forum_link varchar(200) DEFAULT '' NOT NULL, + forum_read varchar(200) DEFAULT '' NOT NULL, + forum_read_locked varchar(200) DEFAULT '' NOT NULL, + forum_read_subforum varchar(200) DEFAULT '' NOT NULL, + forum_unread varchar(200) DEFAULT '' NOT NULL, + forum_unread_locked varchar(200) DEFAULT '' NOT NULL, + forum_unread_subforum varchar(200) DEFAULT '' NOT NULL, + topic_moved varchar(200) DEFAULT '' NOT NULL, + topic_read varchar(200) DEFAULT '' NOT NULL, + topic_read_mine varchar(200) DEFAULT '' NOT NULL, + topic_read_hot varchar(200) DEFAULT '' NOT NULL, + topic_read_hot_mine varchar(200) DEFAULT '' NOT NULL, + topic_read_locked varchar(200) DEFAULT '' NOT NULL, + topic_read_locked_mine varchar(200) DEFAULT '' NOT NULL, + topic_unread varchar(200) DEFAULT '' NOT NULL, + topic_unread_mine varchar(200) DEFAULT '' NOT NULL, + topic_unread_hot varchar(200) DEFAULT '' NOT NULL, + topic_unread_hot_mine varchar(200) DEFAULT '' NOT NULL, + topic_unread_locked varchar(200) DEFAULT '' NOT NULL, + topic_unread_locked_mine varchar(200) DEFAULT '' NOT NULL, + sticky_read varchar(200) DEFAULT '' NOT NULL, + sticky_read_mine varchar(200) DEFAULT '' NOT NULL, + sticky_read_locked varchar(200) DEFAULT '' NOT NULL, + sticky_read_locked_mine varchar(200) DEFAULT '' NOT NULL, + sticky_unread varchar(200) DEFAULT '' NOT NULL, + sticky_unread_mine varchar(200) DEFAULT '' NOT NULL, + sticky_unread_locked varchar(200) DEFAULT '' NOT NULL, + sticky_unread_locked_mine varchar(200) DEFAULT '' NOT NULL, + announce_read varchar(200) DEFAULT '' NOT NULL, + announce_read_mine varchar(200) DEFAULT '' NOT NULL, + announce_read_locked varchar(200) DEFAULT '' NOT NULL, + announce_read_locked_mine varchar(200) DEFAULT '' NOT NULL, + announce_unread varchar(200) DEFAULT '' NOT NULL, + announce_unread_mine varchar(200) DEFAULT '' NOT NULL, + announce_unread_locked varchar(200) DEFAULT '' NOT NULL, + announce_unread_locked_mine varchar(200) DEFAULT '' NOT NULL, + global_read varchar(200) DEFAULT '' NOT NULL, + global_read_mine varchar(200) DEFAULT '' NOT NULL, + global_read_locked varchar(200) DEFAULT '' NOT NULL, + global_read_locked_mine varchar(200) DEFAULT '' NOT NULL, + global_unread varchar(200) DEFAULT '' NOT NULL, + global_unread_mine varchar(200) DEFAULT '' NOT NULL, + global_unread_locked varchar(200) DEFAULT '' NOT NULL, + global_unread_locked_mine varchar(200) DEFAULT '' NOT NULL, + pm_read varchar(200) DEFAULT '' NOT NULL, + pm_unread varchar(200) DEFAULT '' NOT NULL, + icon_contact_aim varchar(200) DEFAULT '' NOT NULL, + icon_contact_email varchar(200) DEFAULT '' NOT NULL, + icon_contact_icq varchar(200) DEFAULT '' NOT NULL, + icon_contact_jabber varchar(200) DEFAULT '' NOT NULL, + icon_contact_msnm varchar(200) DEFAULT '' NOT NULL, + icon_contact_pm varchar(200) DEFAULT '' NOT NULL, + icon_contact_yahoo varchar(200) DEFAULT '' NOT NULL, + icon_contact_www varchar(200) DEFAULT '' NOT NULL, + icon_post_delete varchar(200) DEFAULT '' NOT NULL, + icon_post_edit varchar(200) DEFAULT '' NOT NULL, + icon_post_info varchar(200) DEFAULT '' NOT NULL, + icon_post_quote varchar(200) DEFAULT '' NOT NULL, + icon_post_report varchar(200) DEFAULT '' NOT NULL, + icon_post_target varchar(200) DEFAULT '' NOT NULL, + icon_post_target_unread varchar(200) DEFAULT '' NOT NULL, + icon_topic_attach varchar(200) DEFAULT '' NOT NULL, + icon_topic_latest varchar(200) DEFAULT '' NOT NULL, + icon_topic_newest varchar(200) DEFAULT '' NOT NULL, + icon_topic_reported varchar(200) DEFAULT '' NOT NULL, + icon_topic_unapproved varchar(200) DEFAULT '' NOT NULL, + icon_user_online varchar(200) DEFAULT '' NOT NULL, + icon_user_offline varchar(200) DEFAULT '' NOT NULL, + icon_user_profile varchar(200) DEFAULT '' NOT NULL, + icon_user_search varchar(200) DEFAULT '' NOT NULL, + icon_user_warn varchar(200) DEFAULT '' NOT NULL, + button_pm_forward varchar(200) DEFAULT '' NOT NULL, + button_pm_new varchar(200) DEFAULT '' NOT NULL, + button_pm_reply varchar(200) DEFAULT '' NOT NULL, + button_topic_locked varchar(200) DEFAULT '' NOT NULL, + button_topic_new varchar(200) DEFAULT '' NOT NULL, + button_topic_reply varchar(200) DEFAULT '' NOT NULL, + user_icon1 varchar(200) DEFAULT '' NOT NULL, + user_icon2 varchar(200) DEFAULT '' NOT NULL, + user_icon3 varchar(200) DEFAULT '' NOT NULL, + user_icon4 varchar(200) DEFAULT '' NOT NULL, + user_icon5 varchar(200) DEFAULT '' NOT NULL, + user_icon6 varchar(200) DEFAULT '' NOT NULL, + user_icon7 varchar(200) DEFAULT '' NOT NULL, + user_icon8 varchar(200) DEFAULT '' NOT NULL, + user_icon9 varchar(200) DEFAULT '' NOT NULL, + user_icon10 varchar(200) DEFAULT '' NOT NULL, + PRIMARY KEY (imageset_id), + UNIQUE imgset_nm (imageset_name(255)) +); + + +# Table: 'phpbb_topics' +CREATE TABLE phpbb_topics ( + topic_id mediumint(8) UNSIGNED NOT NULL auto_increment, + forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + icon_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + topic_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + topic_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + topic_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + topic_title text NOT NULL, + topic_poster mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + topic_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + topic_time_limit int(11) UNSIGNED DEFAULT '0' NOT NULL, + topic_views mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + topic_replies mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + topic_replies_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + topic_status tinyint(3) DEFAULT '0' NOT NULL, + topic_type tinyint(3) DEFAULT '0' NOT NULL, + topic_first_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + topic_first_poster_name text NOT NULL, + topic_first_poster_colour varchar(6) DEFAULT '' NOT NULL, + topic_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + topic_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + topic_last_poster_name text NOT NULL, + topic_last_poster_colour varchar(6) DEFAULT '' NOT NULL, + topic_last_post_subject text NOT NULL, + topic_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + topic_last_view_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + topic_moved_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + topic_bumped tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + topic_bumper mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + poll_title text NOT NULL, + poll_start int(11) UNSIGNED DEFAULT '0' NOT NULL, + poll_length int(11) UNSIGNED DEFAULT '0' NOT NULL, + poll_max_options tinyint(4) DEFAULT '1' NOT NULL, + poll_last_vote int(11) UNSIGNED DEFAULT '0' NOT NULL, + poll_vote_change tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (topic_id), + KEY forum_id (forum_id), + KEY forum_id_type (forum_id, topic_type), + KEY last_post_time (topic_last_post_time), + KEY topic_approved (topic_approved), + KEY fid_time_moved (forum_id, topic_last_post_time, topic_moved_id) +); + + +# Table: 'phpbb_topics_track' +CREATE TABLE phpbb_topics_track ( + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (user_id, topic_id), + KEY forum_id (forum_id) +); + + +# Table: 'phpbb_topics_posted' +CREATE TABLE phpbb_topics_posted ( + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + topic_posted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (user_id, topic_id) +); + + +# Table: 'phpbb_topics_watch' +CREATE TABLE phpbb_topics_watch ( + topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + notify_status tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + KEY topic_id (topic_id), + KEY user_id (user_id), + KEY notify_stat (notify_status) +); + + +# Table: 'phpbb_user_group' +CREATE TABLE phpbb_user_group ( + group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + group_leader tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + user_pending tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + KEY group_id (group_id), + KEY user_id (user_id), + KEY group_leader (group_leader) +); + + +# Table: 'phpbb_users' +CREATE TABLE phpbb_users ( + user_id mediumint(8) UNSIGNED NOT NULL auto_increment, + user_type tinyint(2) DEFAULT '0' NOT NULL, + group_id mediumint(8) UNSIGNED DEFAULT '3' NOT NULL, + user_permissions mediumtext NOT NULL, + user_perm_from mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_ip varchar(40) DEFAULT '' NOT NULL, + user_regdate int(11) UNSIGNED DEFAULT '0' NOT NULL, + username text NOT NULL, + username_clean text NOT NULL, + user_password varchar(120) DEFAULT '' NOT NULL, + user_passchg int(11) UNSIGNED DEFAULT '0' NOT NULL, + user_email text NOT NULL, + user_email_hash bigint(20) DEFAULT '0' NOT NULL, + user_birthday varchar(10) DEFAULT '' NOT NULL, + user_lastvisit int(11) UNSIGNED DEFAULT '0' NOT NULL, + user_lastmark int(11) UNSIGNED DEFAULT '0' NOT NULL, + user_lastpost_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + user_lastpage text NOT NULL, + user_last_confirm_key varchar(10) DEFAULT '' NOT NULL, + user_last_search int(11) UNSIGNED DEFAULT '0' NOT NULL, + user_warnings tinyint(4) DEFAULT '0' NOT NULL, + user_last_warning int(11) UNSIGNED DEFAULT '0' NOT NULL, + user_login_attempts tinyint(4) DEFAULT '0' NOT NULL, + user_inactive_reason tinyint(2) DEFAULT '0' NOT NULL, + user_inactive_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_lang varchar(30) DEFAULT '' NOT NULL, + user_timezone decimal(5,2) DEFAULT '0' NOT NULL, + user_dst tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + user_dateformat varchar(90) DEFAULT 'd M Y H:i' NOT NULL, + user_style tinyint(4) DEFAULT '0' NOT NULL, + user_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + user_colour varchar(6) DEFAULT '' NOT NULL, + user_new_privmsg tinyint(4) DEFAULT '0' NOT NULL, + user_unread_privmsg tinyint(4) DEFAULT '0' NOT NULL, + user_last_privmsg int(11) UNSIGNED DEFAULT '0' NOT NULL, + user_message_rules tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + user_full_folder int(11) DEFAULT '-3' NOT NULL, + user_emailtime int(11) UNSIGNED DEFAULT '0' NOT NULL, + user_topic_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + user_topic_sortby_type varchar(1) DEFAULT 't' NOT NULL, + user_topic_sortby_dir varchar(1) DEFAULT 'd' NOT NULL, + user_post_show_days smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + user_post_sortby_type varchar(1) DEFAULT 't' NOT NULL, + user_post_sortby_dir varchar(1) DEFAULT 'a' NOT NULL, + user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + user_notify_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + user_notify_type tinyint(4) DEFAULT '0' NOT NULL, + user_allow_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + user_allow_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + user_allow_viewemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + user_allow_massemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + user_options int(11) UNSIGNED DEFAULT '893' NOT NULL, + user_avatar varchar(255) DEFAULT '' NOT NULL, + user_avatar_type tinyint(2) DEFAULT '0' NOT NULL, + user_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + user_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + user_sig mediumtext NOT NULL, + user_sig_bbcode_uid varchar(5) DEFAULT '' NOT NULL, + user_sig_bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, + user_from text NOT NULL, + user_icq varchar(15) DEFAULT '' NOT NULL, + user_aim text NOT NULL, + user_yim text NOT NULL, + user_msnm text NOT NULL, + user_jabber text NOT NULL, + user_website text NOT NULL, + user_occ text NOT NULL, + user_interests text NOT NULL, + user_actkey varchar(32) DEFAULT '' NOT NULL, + user_newpasswd varchar(96) DEFAULT '' NOT NULL, + PRIMARY KEY (user_id), + KEY user_birthday (user_birthday), + KEY user_email_hash (user_email_hash), + KEY user_type (user_type), + KEY username_clean (username_clean(255)) +); + + +# Table: 'phpbb_warnings' +CREATE TABLE phpbb_warnings ( + warning_id mediumint(8) UNSIGNED NOT NULL auto_increment, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + log_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + warning_time int(11) UNSIGNED DEFAULT '0' NOT NULL, + PRIMARY KEY (warning_id) +); + + +# Table: 'phpbb_words' +CREATE TABLE phpbb_words ( + word_id mediumint(8) UNSIGNED NOT NULL auto_increment, + word text NOT NULL, + replacement text NOT NULL, + PRIMARY KEY (word_id) +); + + +# Table: 'phpbb_zebra' +CREATE TABLE phpbb_zebra ( + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + zebra_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + friend tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + foe tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + KEY user_id (user_id), + KEY zebra_id (zebra_id) +); + + diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index c9e7009bd0..1b0288359d 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -11,10 +11,11 @@ CREATE TABLE phpbb_attachments ( topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, in_message tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + is_orphan tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, physical_filename varchar(255) DEFAULT '' NOT NULL, real_filename varchar(255) DEFAULT '' NOT NULL, download_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - attach_comment text DEFAULT '' NOT NULL, + attach_comment text NOT NULL, extension varchar(100) DEFAULT '' NOT NULL, mimetype varchar(100) DEFAULT '' NOT NULL, filesize int(20) UNSIGNED DEFAULT '0' NOT NULL, @@ -25,8 +26,8 @@ CREATE TABLE phpbb_attachments ( KEY post_msg_id (post_msg_id), KEY topic_id (topic_id), KEY poster_id (poster_id), - KEY filesize (filesize) -); + KEY is_orphan (is_orphan) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_acl_groups' @@ -38,7 +39,7 @@ CREATE TABLE phpbb_acl_groups ( auth_setting tinyint(2) DEFAULT '0' NOT NULL, KEY group_id (group_id), KEY auth_opt_id (auth_option_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_acl_options' @@ -50,20 +51,20 @@ CREATE TABLE phpbb_acl_options ( founder_only tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (auth_option_id), KEY auth_option (auth_option) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_acl_roles' CREATE TABLE phpbb_acl_roles ( role_id mediumint(8) UNSIGNED NOT NULL auto_increment, role_name varchar(255) DEFAULT '' NOT NULL, - role_description text DEFAULT '' NOT NULL, + role_description text NOT NULL, role_type varchar(10) DEFAULT '' NOT NULL, role_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (role_id), KEY role_type (role_type), KEY role_order (role_order) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_acl_roles_data' @@ -72,7 +73,7 @@ CREATE TABLE phpbb_acl_roles_data ( auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, auth_setting tinyint(2) DEFAULT '0' NOT NULL, PRIMARY KEY (role_id, auth_option_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_acl_users' @@ -84,7 +85,7 @@ CREATE TABLE phpbb_acl_users ( auth_setting tinyint(2) DEFAULT '0' NOT NULL, KEY user_id (user_id), KEY auth_option_id (auth_option_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_banlist' @@ -96,14 +97,14 @@ CREATE TABLE phpbb_banlist ( ban_start int(11) UNSIGNED DEFAULT '0' NOT NULL, ban_end int(11) UNSIGNED DEFAULT '0' NOT NULL, ban_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - ban_reason text DEFAULT '' NOT NULL, - ban_give_reason text DEFAULT '' NOT NULL, + ban_reason text NOT NULL, + ban_give_reason text NOT NULL, PRIMARY KEY (ban_id), KEY ban_end (ban_end), KEY ban_user (ban_userid, ban_exclude), KEY ban_email (ban_email, ban_exclude), KEY ban_ip (ban_ip, ban_exclude) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_bbcodes' @@ -112,15 +113,15 @@ CREATE TABLE phpbb_bbcodes ( bbcode_tag varchar(16) DEFAULT '' NOT NULL, bbcode_helpline varchar(255) DEFAULT '' NOT NULL, display_on_posting tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - bbcode_match text DEFAULT '' NOT NULL, - bbcode_tpl mediumtext DEFAULT '' NOT NULL, - first_pass_match mediumtext DEFAULT '' NOT NULL, - first_pass_replace mediumtext DEFAULT '' NOT NULL, - second_pass_match mediumtext DEFAULT '' NOT NULL, - second_pass_replace mediumtext DEFAULT '' NOT NULL, + bbcode_match text NOT NULL, + bbcode_tpl mediumtext NOT NULL, + first_pass_match mediumtext NOT NULL, + first_pass_replace mediumtext NOT NULL, + second_pass_match mediumtext NOT NULL, + second_pass_replace mediumtext NOT NULL, PRIMARY KEY (bbcode_id), KEY display_on_post (display_on_posting) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_bookmarks' @@ -130,30 +131,30 @@ CREATE TABLE phpbb_bookmarks ( order_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, KEY order_id (order_id), KEY topic_user_id (topic_id, user_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_bots' CREATE TABLE phpbb_bots ( bot_id mediumint(8) UNSIGNED NOT NULL auto_increment, bot_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - bot_name text DEFAULT '' NOT NULL, + bot_name varchar(255) DEFAULT '' NOT NULL, user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, bot_agent varchar(255) DEFAULT '' NOT NULL, bot_ip varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (bot_id), KEY bot_active (bot_active) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_config' CREATE TABLE phpbb_config ( - config_name varchar(252) DEFAULT '' NOT NULL, + config_name varchar(255) DEFAULT '' NOT NULL, config_value varchar(255) DEFAULT '' NOT NULL, is_dynamic tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (config_name), KEY is_dynamic (is_dynamic) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_confirm' @@ -164,15 +165,15 @@ CREATE TABLE phpbb_confirm ( code varchar(8) DEFAULT '' NOT NULL, PRIMARY KEY (session_id, confirm_id), KEY confirm_type (confirm_type) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_disallow' CREATE TABLE phpbb_disallow ( disallow_id mediumint(8) UNSIGNED NOT NULL auto_increment, - disallow_username varchar(252) DEFAULT '' NOT NULL, + disallow_username varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (disallow_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_drafts' @@ -182,11 +183,11 @@ CREATE TABLE phpbb_drafts ( topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, save_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - draft_subject text DEFAULT '' NOT NULL, - draft_message mediumtext DEFAULT '' NOT NULL, + draft_subject varchar(100) DEFAULT '' NOT NULL, + draft_message mediumtext NOT NULL, PRIMARY KEY (draft_id), KEY save_time (save_time) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_extensions' @@ -195,7 +196,7 @@ CREATE TABLE phpbb_extensions ( group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, extension varchar(100) DEFAULT '' NOT NULL, PRIMARY KEY (extension_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_extension_groups' @@ -207,10 +208,10 @@ CREATE TABLE phpbb_extension_groups ( download_mode tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, upload_icon varchar(255) DEFAULT '' NOT NULL, max_filesize int(20) UNSIGNED DEFAULT '0' NOT NULL, - allowed_forums text DEFAULT '' NOT NULL, + allowed_forums text NOT NULL, allow_in_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (group_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_forums' @@ -219,20 +220,20 @@ CREATE TABLE phpbb_forums ( parent_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, left_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, right_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - forum_parents mediumtext DEFAULT '' NOT NULL, - forum_name text DEFAULT '' NOT NULL, - forum_desc text DEFAULT '' NOT NULL, - forum_desc_bitfield varchar(252) DEFAULT '' NOT NULL, - forum_desc_options int(11) UNSIGNED DEFAULT '0' NOT NULL, + forum_parents mediumtext NOT NULL, + forum_name varchar(255) DEFAULT '' NOT NULL, + forum_desc text NOT NULL, + forum_desc_bitfield varchar(255) DEFAULT '' NOT NULL, + forum_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL, forum_desc_uid varchar(5) DEFAULT '' NOT NULL, forum_link varchar(255) DEFAULT '' NOT NULL, forum_password varchar(40) DEFAULT '' NOT NULL, forum_style tinyint(4) DEFAULT '0' NOT NULL, forum_image varchar(255) DEFAULT '' NOT NULL, - forum_rules text DEFAULT '' NOT NULL, + forum_rules text NOT NULL, forum_rules_link varchar(255) DEFAULT '' NOT NULL, - forum_rules_bitfield varchar(252) DEFAULT '' NOT NULL, - forum_rules_options int(11) UNSIGNED DEFAULT '0' NOT NULL, + forum_rules_bitfield varchar(255) DEFAULT '' NOT NULL, + forum_rules_options int(11) UNSIGNED DEFAULT '7' NOT NULL, forum_rules_uid varchar(5) DEFAULT '' NOT NULL, forum_topics_per_page tinyint(4) DEFAULT '0' NOT NULL, forum_type tinyint(4) DEFAULT '0' NOT NULL, @@ -242,8 +243,10 @@ CREATE TABLE phpbb_forums ( forum_topics_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, forum_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, forum_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_last_post_subject varchar(100) DEFAULT '' NOT NULL, forum_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL, forum_last_poster_name varchar(255) DEFAULT '' NOT NULL, + forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL, forum_flags tinyint(4) DEFAULT '32' NOT NULL, display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, @@ -256,7 +259,7 @@ CREATE TABLE phpbb_forums ( PRIMARY KEY (forum_id), KEY left_right_id (left_id, right_id), KEY forum_lastpost_id (forum_last_post_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_forums_access' @@ -265,7 +268,7 @@ CREATE TABLE phpbb_forums_access ( user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, session_id char(32) DEFAULT '' NOT NULL, PRIMARY KEY (forum_id, user_id, session_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_forums_track' @@ -274,7 +277,7 @@ CREATE TABLE phpbb_forums_track ( forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (user_id, forum_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_forums_watch' @@ -285,17 +288,17 @@ CREATE TABLE phpbb_forums_watch ( KEY forum_id (forum_id), KEY user_id (user_id), KEY notify_stat (notify_status) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_groups' CREATE TABLE phpbb_groups ( group_id mediumint(8) UNSIGNED NOT NULL auto_increment, group_type tinyint(4) DEFAULT '1' NOT NULL, - group_name varchar(252) DEFAULT '' NOT NULL, - group_desc text DEFAULT '' NOT NULL, - group_desc_bitfield varchar(252) DEFAULT '' NOT NULL, - group_desc_options int(11) UNSIGNED DEFAULT '0' NOT NULL, + group_name varchar(255) DEFAULT '' NOT NULL, + group_desc text NOT NULL, + group_desc_bitfield varchar(255) DEFAULT '' NOT NULL, + group_desc_options int(11) UNSIGNED DEFAULT '7' NOT NULL, group_desc_uid varchar(5) DEFAULT '' NOT NULL, group_display tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, group_avatar varchar(255) DEFAULT '' NOT NULL, @@ -310,7 +313,7 @@ CREATE TABLE phpbb_groups ( group_legend tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, PRIMARY KEY (group_id), KEY group_legend (group_legend) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_icons' @@ -323,7 +326,7 @@ CREATE TABLE phpbb_icons ( display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, PRIMARY KEY (icons_id), KEY display_on_posting (display_on_posting) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_lang' @@ -336,7 +339,7 @@ CREATE TABLE phpbb_lang ( lang_author varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (lang_id), KEY lang_iso (lang_iso) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_log' @@ -349,28 +352,28 @@ CREATE TABLE phpbb_log ( reportee_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, log_ip varchar(40) DEFAULT '' NOT NULL, log_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - log_operation text DEFAULT '' NOT NULL, - log_data mediumtext DEFAULT '' NOT NULL, + log_operation text NOT NULL, + log_data mediumtext NOT NULL, PRIMARY KEY (log_id), KEY log_type (log_type), KEY forum_id (forum_id), KEY topic_id (topic_id), KEY reportee_id (reportee_id), KEY user_id (user_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_moderator_cache' CREATE TABLE phpbb_moderator_cache ( forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - username varchar(252) DEFAULT '' NOT NULL, + username varchar(255) DEFAULT '' NOT NULL, group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, group_name varchar(255) DEFAULT '' NOT NULL, display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, KEY disp_idx (display_on_index), KEY forum_id (forum_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_modules' @@ -390,18 +393,18 @@ CREATE TABLE phpbb_modules ( KEY left_right_id (left_id, right_id), KEY module_enabled (module_enabled), KEY class_left_id (module_class, left_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_poll_options' CREATE TABLE phpbb_poll_options ( poll_option_id tinyint(4) DEFAULT '0' NOT NULL, topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - poll_option_text text DEFAULT '' NOT NULL, + poll_option_text text NOT NULL, poll_option_total mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, KEY poll_opt_id (poll_option_id), KEY topic_id (topic_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_poll_votes' @@ -413,7 +416,7 @@ CREATE TABLE phpbb_poll_votes ( KEY topic_id (topic_id), KEY vote_user_id (vote_user_id), KEY vote_user_ip (vote_user_ip) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_posts' @@ -431,17 +434,16 @@ CREATE TABLE phpbb_posts ( enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - post_username varchar(252) DEFAULT '' NOT NULL, - post_subject text DEFAULT '' NOT NULL, - post_text mediumtext DEFAULT '' NOT NULL, + post_username varchar(255) DEFAULT '' NOT NULL, + post_subject varchar(100) DEFAULT '' NOT NULL, + post_text mediumtext NOT NULL, post_checksum varchar(32) DEFAULT '' NOT NULL, - post_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - bbcode_bitfield varchar(252) DEFAULT '' NOT NULL, + bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, bbcode_uid varchar(5) DEFAULT '' NOT NULL, post_postcount tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, post_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - post_edit_reason text DEFAULT '' NOT NULL, + post_edit_reason varchar(255) DEFAULT '' NOT NULL, post_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, post_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL, post_edit_locked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, @@ -451,9 +453,8 @@ CREATE TABLE phpbb_posts ( KEY poster_ip (poster_ip), KEY poster_id (poster_id), KEY post_approved (post_approved), - KEY post_postcount (post_postcount), - KEY post_time (post_time) -); + KEY tid_post_time (topic_id, post_time) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_privmsgs' @@ -468,24 +469,23 @@ CREATE TABLE phpbb_privmsgs ( enable_smilies tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - message_subject text DEFAULT '' NOT NULL, - message_text mediumtext DEFAULT '' NOT NULL, - message_edit_reason text DEFAULT '' NOT NULL, + message_subject varchar(100) DEFAULT '' NOT NULL, + message_text mediumtext NOT NULL, + message_edit_reason varchar(255) DEFAULT '' NOT NULL, message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - message_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, message_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - bbcode_bitfield varchar(252) DEFAULT '' NOT NULL, + bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, bbcode_uid varchar(5) DEFAULT '' NOT NULL, message_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL, message_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - to_address text DEFAULT '' NOT NULL, - bcc_address text DEFAULT '' NOT NULL, + to_address text NOT NULL, + bcc_address text NOT NULL, PRIMARY KEY (msg_id), KEY author_ip (author_ip), KEY message_time (message_time), KEY author_id (author_id), KEY root_level (root_level) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_privmsgs_folder' @@ -496,7 +496,7 @@ CREATE TABLE phpbb_privmsgs_folder ( pm_count mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (folder_id), KEY user_id (user_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_privmsgs_rules' @@ -512,7 +512,7 @@ CREATE TABLE phpbb_privmsgs_rules ( rule_folder_id int(4) DEFAULT '0' NOT NULL, PRIMARY KEY (rule_id), KEY user_id (user_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_privmsgs_to' @@ -530,7 +530,7 @@ CREATE TABLE phpbb_privmsgs_to ( KEY msg_id (msg_id), KEY author_id (author_id), KEY usr_flder_id (user_id, folder_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_profile_fields' @@ -554,14 +554,14 @@ CREATE TABLE phpbb_profile_fields ( PRIMARY KEY (field_id), KEY fld_type (field_type), KEY fld_ordr (field_order) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_profile_fields_data' CREATE TABLE phpbb_profile_fields_data ( user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (user_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_profile_fields_lang' @@ -572,7 +572,7 @@ CREATE TABLE phpbb_profile_fields_lang ( field_type tinyint(4) DEFAULT '0' NOT NULL, lang_value varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (field_id, lang_id, option_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_profile_lang' @@ -580,10 +580,10 @@ CREATE TABLE phpbb_profile_lang ( field_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, lang_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, lang_name varchar(255) DEFAULT '' NOT NULL, - lang_explain text DEFAULT '' NOT NULL, + lang_explain text NOT NULL, lang_default_value varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (field_id, lang_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_ranks' @@ -594,7 +594,7 @@ CREATE TABLE phpbb_ranks ( rank_special tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, rank_image varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (rank_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_reports' @@ -606,39 +606,39 @@ CREATE TABLE phpbb_reports ( user_notify tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - report_text mediumtext DEFAULT '' NOT NULL, + report_text mediumtext NOT NULL, PRIMARY KEY (report_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_reports_reasons' CREATE TABLE phpbb_reports_reasons ( reason_id smallint(4) UNSIGNED NOT NULL auto_increment, reason_title varchar(255) DEFAULT '' NOT NULL, - reason_description mediumtext DEFAULT '' NOT NULL, + reason_description mediumtext NOT NULL, reason_order smallint(4) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (reason_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_search_results' CREATE TABLE phpbb_search_results ( search_key varchar(32) DEFAULT '' NOT NULL, search_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - search_keywords mediumtext DEFAULT '' NOT NULL, - search_authors mediumtext DEFAULT '' NOT NULL, + search_keywords mediumtext NOT NULL, + search_authors mediumtext NOT NULL, PRIMARY KEY (search_key) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_search_wordlist' CREATE TABLE phpbb_search_wordlist ( word_id mediumint(8) UNSIGNED NOT NULL auto_increment, - word_text varchar(252) /*!40101 CHARACTER SET utf8 */ BINARY DEFAULT '' NOT NULL, + word_text varchar(255) DEFAULT '' NOT NULL, word_common tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (word_id), UNIQUE wrd_txt (word_text) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_search_wordmatch' @@ -648,7 +648,7 @@ CREATE TABLE phpbb_search_wordmatch ( title_match tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, KEY word_id (word_id), KEY post_id (post_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_sessions' @@ -667,7 +667,7 @@ CREATE TABLE phpbb_sessions ( PRIMARY KEY (session_id), KEY session_time (session_time), KEY session_user_id (session_user_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_sessions_keys' @@ -678,7 +678,7 @@ CREATE TABLE phpbb_sessions_keys ( last_login int(11) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (key_id, user_id), KEY last_login (last_login) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_sitelist' @@ -688,7 +688,7 @@ CREATE TABLE phpbb_sitelist ( site_hostname varchar(255) DEFAULT '' NOT NULL, ip_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (site_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_smilies' @@ -697,19 +697,19 @@ CREATE TABLE phpbb_smilies ( code varchar(50) DEFAULT '' NOT NULL, emotion varchar(50) DEFAULT '' NOT NULL, smiley_url varchar(50) DEFAULT '' NOT NULL, - smiley_width tinyint(4) DEFAULT '0' NOT NULL, - smiley_height tinyint(4) DEFAULT '0' NOT NULL, + smiley_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + smiley_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL, smiley_order mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, display_on_posting tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, PRIMARY KEY (smiley_id), KEY display_on_post (display_on_posting) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_styles' CREATE TABLE phpbb_styles ( style_id tinyint(4) NOT NULL auto_increment, - style_name varchar(252) DEFAULT '' NOT NULL, + style_name varchar(255) DEFAULT '' NOT NULL, style_copyright varchar(255) DEFAULT '' NOT NULL, style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, template_id tinyint(4) DEFAULT '0' NOT NULL, @@ -720,52 +720,52 @@ CREATE TABLE phpbb_styles ( KEY template_id (template_id), KEY theme_id (theme_id), KEY imageset_id (imageset_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_styles_template' CREATE TABLE phpbb_styles_template ( template_id tinyint(4) NOT NULL auto_increment, - template_name varchar(252) DEFAULT '' NOT NULL, + template_name varchar(255) DEFAULT '' NOT NULL, template_copyright varchar(255) DEFAULT '' NOT NULL, template_path varchar(100) DEFAULT '' NOT NULL, - bbcode_bitfield varchar(252) DEFAULT 'kNg=' NOT NULL, + bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL, template_storedb tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (template_id), UNIQUE tmplte_nm (template_name) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_styles_template_data' CREATE TABLE phpbb_styles_template_data ( template_id tinyint(4) NOT NULL auto_increment, template_filename varchar(100) DEFAULT '' NOT NULL, - template_included text DEFAULT '' NOT NULL, + template_included text NOT NULL, template_mtime int(11) UNSIGNED DEFAULT '0' NOT NULL, - template_data mediumtext DEFAULT '' NOT NULL, + template_data mediumtext NOT NULL, KEY tid (template_id), KEY tfn (template_filename) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_styles_theme' CREATE TABLE phpbb_styles_theme ( theme_id tinyint(4) NOT NULL auto_increment, - theme_name varchar(252) DEFAULT '' NOT NULL, + theme_name varchar(255) DEFAULT '' NOT NULL, theme_copyright varchar(255) DEFAULT '' NOT NULL, theme_path varchar(100) DEFAULT '' NOT NULL, theme_storedb tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, theme_mtime int(11) UNSIGNED DEFAULT '0' NOT NULL, - theme_data mediumtext DEFAULT '' NOT NULL, + theme_data mediumtext NOT NULL, PRIMARY KEY (theme_id), UNIQUE theme_name (theme_name) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_styles_imageset' CREATE TABLE phpbb_styles_imageset ( imageset_id tinyint(4) NOT NULL auto_increment, - imageset_name varchar(252) DEFAULT '' NOT NULL, + imageset_name varchar(255) DEFAULT '' NOT NULL, imageset_copyright varchar(255) DEFAULT '' NOT NULL, imageset_path varchar(100) DEFAULT '' NOT NULL, site_logo varchar(200) DEFAULT '' NOT NULL, @@ -864,7 +864,7 @@ CREATE TABLE phpbb_styles_imageset ( user_icon10 varchar(200) DEFAULT '' NOT NULL, PRIMARY KEY (imageset_id), UNIQUE imgset_nm (imageset_name) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_topics' @@ -875,7 +875,7 @@ CREATE TABLE phpbb_topics ( topic_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, topic_approved tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, topic_reported tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - topic_title text DEFAULT '' NOT NULL, + topic_title varchar(100) DEFAULT '' NOT NULL, topic_poster mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, topic_time int(11) UNSIGNED DEFAULT '0' NOT NULL, topic_time_limit int(11) UNSIGNED DEFAULT '0' NOT NULL, @@ -886,15 +886,18 @@ CREATE TABLE phpbb_topics ( topic_type tinyint(3) DEFAULT '0' NOT NULL, topic_first_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, topic_first_poster_name varchar(255) DEFAULT '' NOT NULL, + topic_first_poster_colour varchar(6) DEFAULT '' NOT NULL, topic_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, topic_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, topic_last_poster_name varchar(255) DEFAULT '' NOT NULL, + topic_last_poster_colour varchar(6) DEFAULT '' NOT NULL, + topic_last_post_subject varchar(100) DEFAULT '' NOT NULL, topic_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL, topic_last_view_time int(11) UNSIGNED DEFAULT '0' NOT NULL, topic_moved_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, topic_bumped tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, topic_bumper mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - poll_title text DEFAULT '' NOT NULL, + poll_title varchar(100) DEFAULT '' NOT NULL, poll_start int(11) UNSIGNED DEFAULT '0' NOT NULL, poll_length int(11) UNSIGNED DEFAULT '0' NOT NULL, poll_max_options tinyint(4) DEFAULT '1' NOT NULL, @@ -904,8 +907,9 @@ CREATE TABLE phpbb_topics ( KEY forum_id (forum_id), KEY forum_id_type (forum_id, topic_type), KEY last_post_time (topic_last_post_time), + KEY topic_approved (topic_approved), KEY fid_time_moved (forum_id, topic_last_post_time, topic_moved_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_topics_track' @@ -916,7 +920,7 @@ CREATE TABLE phpbb_topics_track ( mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (user_id, topic_id), KEY forum_id (forum_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_topics_posted' @@ -925,7 +929,7 @@ CREATE TABLE phpbb_topics_posted ( topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, topic_posted tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (user_id, topic_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_topics_watch' @@ -936,7 +940,7 @@ CREATE TABLE phpbb_topics_watch ( KEY topic_id (topic_id), KEY user_id (user_id), KEY notify_stat (notify_status) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_user_group' @@ -948,7 +952,7 @@ CREATE TABLE phpbb_user_group ( KEY group_id (group_id), KEY user_id (user_id), KEY group_leader (group_leader) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_users' @@ -956,11 +960,12 @@ CREATE TABLE phpbb_users ( user_id mediumint(8) UNSIGNED NOT NULL auto_increment, user_type tinyint(2) DEFAULT '0' NOT NULL, group_id mediumint(8) UNSIGNED DEFAULT '3' NOT NULL, - user_permissions mediumtext DEFAULT '' NOT NULL, + user_permissions mediumtext NOT NULL, user_perm_from mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_ip varchar(40) DEFAULT '' NOT NULL, user_regdate int(11) UNSIGNED DEFAULT '0' NOT NULL, - username varchar(252) DEFAULT '' NOT NULL, + username varchar(255) DEFAULT '' NOT NULL, + username_clean varchar(255) DEFAULT '' NOT NULL, user_password varchar(40) DEFAULT '' NOT NULL, user_passchg int(11) UNSIGNED DEFAULT '0' NOT NULL, user_email varchar(100) DEFAULT '' NOT NULL, @@ -975,6 +980,8 @@ CREATE TABLE phpbb_users ( user_warnings tinyint(4) DEFAULT '0' NOT NULL, user_last_warning int(11) UNSIGNED DEFAULT '0' NOT NULL, user_login_attempts tinyint(4) DEFAULT '0' NOT NULL, + user_inactive_reason tinyint(2) DEFAULT '0' NOT NULL, + user_inactive_time int(11) UNSIGNED DEFAULT '0' NOT NULL, user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_lang varchar(30) DEFAULT '' NOT NULL, user_timezone decimal(5,2) DEFAULT '0' NOT NULL, @@ -999,18 +1006,17 @@ CREATE TABLE phpbb_users ( user_notify_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, user_notify_type tinyint(4) DEFAULT '0' NOT NULL, user_allow_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - user_allow_email tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, user_allow_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, user_allow_viewemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, user_allow_massemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, user_options int(11) UNSIGNED DEFAULT '893' NOT NULL, user_avatar varchar(255) DEFAULT '' NOT NULL, user_avatar_type tinyint(2) DEFAULT '0' NOT NULL, - user_avatar_width tinyint(4) DEFAULT '0' NOT NULL, - user_avatar_height tinyint(4) DEFAULT '0' NOT NULL, - user_sig mediumtext DEFAULT '' NOT NULL, + user_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + user_avatar_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + user_sig mediumtext NOT NULL, user_sig_bbcode_uid varchar(5) DEFAULT '' NOT NULL, - user_sig_bbcode_bitfield varchar(252) DEFAULT '' NOT NULL, + user_sig_bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, user_from varchar(100) DEFAULT '' NOT NULL, user_icq varchar(15) DEFAULT '' NOT NULL, user_aim varchar(255) DEFAULT '' NOT NULL, @@ -1019,15 +1025,15 @@ CREATE TABLE phpbb_users ( user_jabber varchar(255) DEFAULT '' NOT NULL, user_website varchar(200) DEFAULT '' NOT NULL, user_occ varchar(255) DEFAULT '' NOT NULL, - user_interests text DEFAULT '' NOT NULL, + user_interests text NOT NULL, user_actkey varchar(32) DEFAULT '' NOT NULL, user_newpasswd varchar(32) DEFAULT '' NOT NULL, PRIMARY KEY (user_id), KEY user_birthday (user_birthday), KEY user_email_hash (user_email_hash), KEY user_type (user_type), - KEY username (username) -); + KEY username_clean (username_clean) +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_warnings' @@ -1038,7 +1044,7 @@ CREATE TABLE phpbb_warnings ( log_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, warning_time int(11) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (warning_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_words' @@ -1047,7 +1053,7 @@ CREATE TABLE phpbb_words ( word varchar(255) DEFAULT '' NOT NULL, replacement varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (word_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; # Table: 'phpbb_zebra' @@ -1058,6 +1064,6 @@ CREATE TABLE phpbb_zebra ( foe tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, KEY user_id (user_id), KEY zebra_id (zebra_id) -); +) CHARACTER SET `utf8` COLLATE `utf8_bin`; diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index a5c0b9202e..890be4b783 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -51,6 +51,7 @@ CREATE TABLE phpbb_attachments ( topic_id number(8) DEFAULT '0' NOT NULL, in_message number(1) DEFAULT '0' NOT NULL, poster_id number(8) DEFAULT '0' NOT NULL, + is_orphan number(1) DEFAULT '1' NOT NULL, physical_filename varchar2(255) DEFAULT '' , real_filename varchar2(255) DEFAULT '' , download_count number(8) DEFAULT '0' NOT NULL, @@ -72,7 +73,7 @@ CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments (topic_id) / CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id) / -CREATE INDEX phpbb_attachments_filesize ON phpbb_attachments (filesize) +CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments (is_orphan) / CREATE SEQUENCE phpbb_attachments_seq @@ -145,7 +146,7 @@ END; */ CREATE TABLE phpbb_acl_roles ( role_id number(8) NOT NULL, - role_name varchar2(255) DEFAULT '' , + role_name varchar2(765) DEFAULT '' , role_description clob DEFAULT '' , role_type varchar2(10) DEFAULT '' , role_order number(4) DEFAULT '0' NOT NULL, @@ -210,7 +211,7 @@ CREATE TABLE phpbb_banlist ( ban_id number(8) NOT NULL, ban_userid number(8) DEFAULT '0' NOT NULL, ban_ip varchar2(40) DEFAULT '' , - ban_email varchar2(100) DEFAULT '' , + ban_email varchar2(300) DEFAULT '' , ban_start number(11) DEFAULT '0' NOT NULL, ban_end number(11) DEFAULT '0' NOT NULL, ban_exclude number(1) DEFAULT '0' NOT NULL, @@ -287,7 +288,7 @@ CREATE INDEX phpbb_bookmarks_topic_user_id ON phpbb_bookmarks (topic_id, user_id CREATE TABLE phpbb_bots ( bot_id number(8) NOT NULL, bot_active number(1) DEFAULT '1' NOT NULL, - bot_name varchar2(3000) DEFAULT '' , + bot_name varchar2(765) DEFAULT '' , user_id number(8) DEFAULT '0' NOT NULL, bot_agent varchar2(255) DEFAULT '' , bot_ip varchar2(255) DEFAULT '' , @@ -318,7 +319,7 @@ END; Table: 'phpbb_config' */ CREATE TABLE phpbb_config ( - config_name varchar2(252) DEFAULT '' , + config_name varchar2(255) DEFAULT '' , config_value varchar2(255) DEFAULT '' , is_dynamic number(1) DEFAULT '0' NOT NULL, CONSTRAINT pk_phpbb_config PRIMARY KEY (config_name) @@ -348,7 +349,7 @@ CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm (confirm_type) */ CREATE TABLE phpbb_disallow ( disallow_id number(8) NOT NULL, - disallow_username varchar2(252) DEFAULT '' , + disallow_username varchar2(765) DEFAULT '' , CONSTRAINT pk_phpbb_disallow PRIMARY KEY (disallow_id) ) / @@ -379,7 +380,7 @@ CREATE TABLE phpbb_drafts ( topic_id number(8) DEFAULT '0' NOT NULL, forum_id number(8) DEFAULT '0' NOT NULL, save_time number(11) DEFAULT '0' NOT NULL, - draft_subject varchar2(1000) DEFAULT '' , + draft_subject varchar2(300) DEFAULT '' , draft_message clob DEFAULT '' , CONSTRAINT pk_phpbb_drafts PRIMARY KEY (draft_id) ) @@ -437,7 +438,7 @@ END; */ CREATE TABLE phpbb_extension_groups ( group_id number(8) NOT NULL, - group_name varchar2(255) DEFAULT '' , + group_name varchar2(765) DEFAULT '' , cat_id number(2) DEFAULT '0' NOT NULL, allow_group number(1) DEFAULT '0' NOT NULL, download_mode number(1) DEFAULT '1' NOT NULL, @@ -475,19 +476,19 @@ CREATE TABLE phpbb_forums ( left_id number(8) DEFAULT '0' NOT NULL, right_id number(8) DEFAULT '0' NOT NULL, forum_parents clob DEFAULT '' , - forum_name varchar2(3000) DEFAULT '' , + forum_name varchar2(765) DEFAULT '' , forum_desc clob DEFAULT '' , - forum_desc_bitfield varchar2(252) DEFAULT '' , - forum_desc_options number(11) DEFAULT '0' NOT NULL, + forum_desc_bitfield varchar2(255) DEFAULT '' , + forum_desc_options number(11) DEFAULT '7' NOT NULL, forum_desc_uid varchar2(5) DEFAULT '' , - forum_link varchar2(255) DEFAULT '' , - forum_password varchar2(40) DEFAULT '' , + forum_link varchar2(765) DEFAULT '' , + forum_password varchar2(120) DEFAULT '' , forum_style number(4) DEFAULT '0' NOT NULL, forum_image varchar2(255) DEFAULT '' , forum_rules clob DEFAULT '' , - forum_rules_link varchar2(255) DEFAULT '' , - forum_rules_bitfield varchar2(252) DEFAULT '' , - forum_rules_options number(11) DEFAULT '0' NOT NULL, + forum_rules_link varchar2(765) DEFAULT '' , + forum_rules_bitfield varchar2(255) DEFAULT '' , + forum_rules_options number(11) DEFAULT '7' NOT NULL, forum_rules_uid varchar2(5) DEFAULT '' , forum_topics_per_page number(4) DEFAULT '0' NOT NULL, forum_type number(4) DEFAULT '0' NOT NULL, @@ -497,8 +498,10 @@ CREATE TABLE phpbb_forums ( forum_topics_real number(8) DEFAULT '0' NOT NULL, forum_last_post_id number(8) DEFAULT '0' NOT NULL, forum_last_poster_id number(8) DEFAULT '0' NOT NULL, + forum_last_post_subject varchar2(300) DEFAULT '' , forum_last_post_time number(11) DEFAULT '0' NOT NULL, - forum_last_poster_name varchar2(255) DEFAULT '' , + forum_last_poster_name varchar2(765) DEFAULT '' , + forum_last_poster_colour varchar2(6) DEFAULT '' , forum_flags number(4) DEFAULT '32' NOT NULL, display_on_index number(1) DEFAULT '1' NOT NULL, enable_indexing number(1) DEFAULT '1' NOT NULL, @@ -580,10 +583,10 @@ CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch (notify_status CREATE TABLE phpbb_groups ( group_id number(8) NOT NULL, group_type number(4) DEFAULT '1' NOT NULL, - group_name varchar2(252) DEFAULT '' , + group_name varchar2(255) DEFAULT '' , group_desc clob DEFAULT '' , - group_desc_bitfield varchar2(252) DEFAULT '' , - group_desc_options number(11) DEFAULT '0' NOT NULL, + group_desc_bitfield varchar2(255) DEFAULT '' , + group_desc_options number(11) DEFAULT '7' NOT NULL, group_desc_uid varchar2(5) DEFAULT '' , group_display number(1) DEFAULT '0' NOT NULL, group_avatar varchar2(255) DEFAULT '' , @@ -659,9 +662,9 @@ CREATE TABLE phpbb_lang ( lang_id number(4) NOT NULL, lang_iso varchar2(30) DEFAULT '' , lang_dir varchar2(30) DEFAULT '' , - lang_english_name varchar2(100) DEFAULT '' , - lang_local_name varchar2(255) DEFAULT '' , - lang_author varchar2(255) DEFAULT '' , + lang_english_name varchar2(300) DEFAULT '' , + lang_local_name varchar2(765) DEFAULT '' , + lang_author varchar2(765) DEFAULT '' , CONSTRAINT pk_phpbb_lang PRIMARY KEY (lang_id) ) / @@ -736,9 +739,9 @@ END; CREATE TABLE phpbb_moderator_cache ( forum_id number(8) DEFAULT '0' NOT NULL, user_id number(8) DEFAULT '0' NOT NULL, - username varchar2(252) DEFAULT '' , + username varchar2(765) DEFAULT '' , group_id number(8) DEFAULT '0' NOT NULL, - group_name varchar2(255) DEFAULT '' , + group_name varchar2(765) DEFAULT '' , display_on_index number(1) DEFAULT '1' NOT NULL ) / @@ -841,17 +844,16 @@ CREATE TABLE phpbb_posts ( enable_smilies number(1) DEFAULT '1' NOT NULL, enable_magic_url number(1) DEFAULT '1' NOT NULL, enable_sig number(1) DEFAULT '1' NOT NULL, - post_username varchar2(252) DEFAULT '' , - post_subject varchar2(1000) DEFAULT '' , + post_username varchar2(765) DEFAULT '' , + post_subject varchar2(300) DEFAULT '' , post_text clob DEFAULT '' , post_checksum varchar2(32) DEFAULT '' , - post_encoding varchar2(20) DEFAULT 'iso-8859-1' NOT NULL, post_attachment number(1) DEFAULT '0' NOT NULL, - bbcode_bitfield varchar2(252) DEFAULT '' , + bbcode_bitfield varchar2(255) DEFAULT '' , bbcode_uid varchar2(5) DEFAULT '' , post_postcount number(1) DEFAULT '1' NOT NULL, post_edit_time number(11) DEFAULT '0' NOT NULL, - post_edit_reason varchar2(3000) DEFAULT '' , + post_edit_reason varchar2(765) DEFAULT '' , post_edit_user number(8) DEFAULT '0' NOT NULL, post_edit_count number(4) DEFAULT '0' NOT NULL, post_edit_locked number(1) DEFAULT '0' NOT NULL, @@ -869,9 +871,7 @@ CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id) / CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved) / -CREATE INDEX phpbb_posts_post_postcount ON phpbb_posts (post_postcount) -/ -CREATE INDEX phpbb_posts_post_time ON phpbb_posts (post_time) +CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time) / CREATE SEQUENCE phpbb_posts_seq @@ -904,13 +904,12 @@ CREATE TABLE phpbb_privmsgs ( enable_smilies number(1) DEFAULT '1' NOT NULL, enable_magic_url number(1) DEFAULT '1' NOT NULL, enable_sig number(1) DEFAULT '1' NOT NULL, - message_subject varchar2(1000) DEFAULT '' , + message_subject varchar2(300) DEFAULT '' , message_text clob DEFAULT '' , - message_edit_reason varchar2(3000) DEFAULT '' , + message_edit_reason varchar2(765) DEFAULT '' , message_edit_user number(8) DEFAULT '0' NOT NULL, - message_encoding varchar2(20) DEFAULT 'iso-8859-1' NOT NULL, message_attachment number(1) DEFAULT '0' NOT NULL, - bbcode_bitfield varchar2(252) DEFAULT '' , + bbcode_bitfield varchar2(255) DEFAULT '' , bbcode_uid varchar2(5) DEFAULT '' , message_edit_time number(11) DEFAULT '0' NOT NULL, message_edit_count number(4) DEFAULT '0' NOT NULL, @@ -951,7 +950,7 @@ END; CREATE TABLE phpbb_privmsgs_folder ( folder_id number(8) NOT NULL, user_id number(8) DEFAULT '0' NOT NULL, - folder_name varchar2(255) DEFAULT '' , + folder_name varchar2(765) DEFAULT '' , pm_count number(8) DEFAULT '0' NOT NULL, CONSTRAINT pk_phpbb_privmsgs_folder PRIMARY KEY (folder_id) ) @@ -984,7 +983,7 @@ CREATE TABLE phpbb_privmsgs_rules ( user_id number(8) DEFAULT '0' NOT NULL, rule_check number(8) DEFAULT '0' NOT NULL, rule_connection number(8) DEFAULT '0' NOT NULL, - rule_string varchar2(255) DEFAULT '' , + rule_string varchar2(765) DEFAULT '' , rule_user_id number(8) DEFAULT '0' NOT NULL, rule_group_id number(8) DEFAULT '0' NOT NULL, rule_action number(8) DEFAULT '0' NOT NULL, @@ -1041,15 +1040,15 @@ CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to (user_id, folde */ CREATE TABLE phpbb_profile_fields ( field_id number(8) NOT NULL, - field_name varchar2(255) DEFAULT '' , + field_name varchar2(765) DEFAULT '' , field_type number(4) DEFAULT '0' NOT NULL, field_ident varchar2(20) DEFAULT '' , field_length varchar2(20) DEFAULT '' , field_minlen varchar2(255) DEFAULT '' , field_maxlen varchar2(255) DEFAULT '' , - field_novalue varchar2(255) DEFAULT '' , - field_default_value varchar2(255) DEFAULT '' , - field_validation varchar2(20) DEFAULT '' , + field_novalue varchar2(765) DEFAULT '' , + field_default_value varchar2(765) DEFAULT '' , + field_validation varchar2(60) DEFAULT '' , field_required number(1) DEFAULT '0' NOT NULL, field_show_on_reg number(1) DEFAULT '0' NOT NULL, field_hide number(1) DEFAULT '0' NOT NULL, @@ -1099,7 +1098,7 @@ CREATE TABLE phpbb_profile_fields_lang ( lang_id number(8) DEFAULT '0' NOT NULL, option_id number(8) DEFAULT '0' NOT NULL, field_type number(4) DEFAULT '0' NOT NULL, - lang_value varchar2(255) DEFAULT '' , + lang_value varchar2(765) DEFAULT '' , CONSTRAINT pk_phpbb_profile_fields_lang PRIMARY KEY (field_id, lang_id, option_id) ) / @@ -1111,9 +1110,9 @@ CREATE TABLE phpbb_profile_fields_lang ( CREATE TABLE phpbb_profile_lang ( field_id number(8) DEFAULT '0' NOT NULL, lang_id number(8) DEFAULT '0' NOT NULL, - lang_name varchar2(255) DEFAULT '' , + lang_name varchar2(765) DEFAULT '' , lang_explain clob DEFAULT '' , - lang_default_value varchar2(255) DEFAULT '' , + lang_default_value varchar2(765) DEFAULT '' , CONSTRAINT pk_phpbb_profile_lang PRIMARY KEY (field_id, lang_id) ) / @@ -1124,7 +1123,7 @@ CREATE TABLE phpbb_profile_lang ( */ CREATE TABLE phpbb_ranks ( rank_id number(8) NOT NULL, - rank_title varchar2(255) DEFAULT '' , + rank_title varchar2(765) DEFAULT '' , rank_min number(8) DEFAULT '0' NOT NULL, rank_special number(1) DEFAULT '0' NOT NULL, rank_image varchar2(255) DEFAULT '' , @@ -1187,7 +1186,7 @@ END; */ CREATE TABLE phpbb_reports_reasons ( reason_id number(4) NOT NULL, - reason_title varchar2(255) DEFAULT '' , + reason_title varchar2(765) DEFAULT '' , reason_description clob DEFAULT '' , reason_order number(4) DEFAULT '0' NOT NULL, CONSTRAINT pk_phpbb_reports_reasons PRIMARY KEY (reason_id) @@ -1229,7 +1228,7 @@ CREATE TABLE phpbb_search_results ( */ CREATE TABLE phpbb_search_wordlist ( word_id number(8) NOT NULL, - word_text nvarchar2(252) DEFAULT '' , + word_text varchar2(765) DEFAULT '' , word_common number(1) DEFAULT '0' NOT NULL, CONSTRAINT pk_phpbb_search_wordlist PRIMARY KEY (word_id), CONSTRAINT u_phpbb_wrd_txt UNIQUE (word_text) @@ -1279,7 +1278,7 @@ CREATE TABLE phpbb_sessions ( session_time number(11) DEFAULT '0' NOT NULL, session_ip varchar2(40) DEFAULT '' , session_browser varchar2(150) DEFAULT '' , - session_page varchar2(255) DEFAULT '' , + session_page varchar2(765) DEFAULT '' , session_viewonline number(1) DEFAULT '1' NOT NULL, session_autologin number(1) DEFAULT '0' NOT NULL, session_admin number(1) DEFAULT '0' NOT NULL, @@ -1341,8 +1340,8 @@ END; */ CREATE TABLE phpbb_smilies ( smiley_id number(8) NOT NULL, - code varchar2(50) DEFAULT '' , - emotion varchar2(50) DEFAULT '' , + code varchar2(150) DEFAULT '' , + emotion varchar2(150) DEFAULT '' , smiley_url varchar2(50) DEFAULT '' , smiley_width number(4) DEFAULT '0' NOT NULL, smiley_height number(4) DEFAULT '0' NOT NULL, @@ -1376,8 +1375,8 @@ END; */ CREATE TABLE phpbb_styles ( style_id number(4) NOT NULL, - style_name varchar2(252) DEFAULT '' , - style_copyright varchar2(255) DEFAULT '' , + style_name varchar2(765) DEFAULT '' , + style_copyright varchar2(765) DEFAULT '' , style_active number(1) DEFAULT '1' NOT NULL, template_id number(4) DEFAULT '0' NOT NULL, theme_id number(4) DEFAULT '0' NOT NULL, @@ -1415,10 +1414,10 @@ END; */ CREATE TABLE phpbb_styles_template ( template_id number(4) NOT NULL, - template_name varchar2(252) DEFAULT '' , - template_copyright varchar2(255) DEFAULT '' , + template_name varchar2(765) DEFAULT '' , + template_copyright varchar2(765) DEFAULT '' , template_path varchar2(100) DEFAULT '' , - bbcode_bitfield varchar2(252) DEFAULT 'kNg=' NOT NULL, + bbcode_bitfield varchar2(255) DEFAULT 'kNg=' NOT NULL, template_storedb number(1) DEFAULT '0' NOT NULL, CONSTRAINT pk_phpbb_styles_template PRIMARY KEY (template_id), CONSTRAINT u_phpbb_tmplte_nm UNIQUE (template_name) @@ -1480,8 +1479,8 @@ END; */ CREATE TABLE phpbb_styles_theme ( theme_id number(4) NOT NULL, - theme_name varchar2(252) DEFAULT '' , - theme_copyright varchar2(255) DEFAULT '' , + theme_name varchar2(765) DEFAULT '' , + theme_copyright varchar2(765) DEFAULT '' , theme_path varchar2(100) DEFAULT '' , theme_storedb number(1) DEFAULT '0' NOT NULL, theme_mtime number(11) DEFAULT '0' NOT NULL, @@ -1513,8 +1512,8 @@ END; */ CREATE TABLE phpbb_styles_imageset ( imageset_id number(4) NOT NULL, - imageset_name varchar2(252) DEFAULT '' , - imageset_copyright varchar2(255) DEFAULT '' , + imageset_name varchar2(765) DEFAULT '' , + imageset_copyright varchar2(765) DEFAULT '' , imageset_path varchar2(100) DEFAULT '' , site_logo varchar2(200) DEFAULT '' , upload_bar varchar2(200) DEFAULT '' , @@ -1642,7 +1641,7 @@ CREATE TABLE phpbb_topics ( topic_attachment number(1) DEFAULT '0' NOT NULL, topic_approved number(1) DEFAULT '1' NOT NULL, topic_reported number(1) DEFAULT '0' NOT NULL, - topic_title varchar2(1000) DEFAULT '' , + topic_title varchar2(300) DEFAULT '' , topic_poster number(8) DEFAULT '0' NOT NULL, topic_time number(11) DEFAULT '0' NOT NULL, topic_time_limit number(11) DEFAULT '0' NOT NULL, @@ -1652,16 +1651,19 @@ CREATE TABLE phpbb_topics ( topic_status number(3) DEFAULT '0' NOT NULL, topic_type number(3) DEFAULT '0' NOT NULL, topic_first_post_id number(8) DEFAULT '0' NOT NULL, - topic_first_poster_name varchar2(255) DEFAULT '' , + topic_first_poster_name varchar2(765) DEFAULT '' , + topic_first_poster_colour varchar2(6) DEFAULT '' , topic_last_post_id number(8) DEFAULT '0' NOT NULL, topic_last_poster_id number(8) DEFAULT '0' NOT NULL, - topic_last_poster_name varchar2(255) DEFAULT '' , + topic_last_poster_name varchar2(765) DEFAULT '' , + topic_last_poster_colour varchar2(6) DEFAULT '' , + topic_last_post_subject varchar2(300) DEFAULT '' , topic_last_post_time number(11) DEFAULT '0' NOT NULL, topic_last_view_time number(11) DEFAULT '0' NOT NULL, topic_moved_id number(8) DEFAULT '0' NOT NULL, topic_bumped number(1) DEFAULT '0' NOT NULL, topic_bumper number(8) DEFAULT '0' NOT NULL, - poll_title varchar2(1000) DEFAULT '' , + poll_title varchar2(300) DEFAULT '' , poll_start number(11) DEFAULT '0' NOT NULL, poll_length number(11) DEFAULT '0' NOT NULL, poll_max_options number(4) DEFAULT '1' NOT NULL, @@ -1677,6 +1679,8 @@ CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics (forum_id, topic_type) / CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics (topic_last_post_time) / +CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics (topic_approved) +/ CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id) / @@ -1769,26 +1773,29 @@ CREATE TABLE phpbb_users ( user_perm_from number(8) DEFAULT '0' NOT NULL, user_ip varchar2(40) DEFAULT '' , user_regdate number(11) DEFAULT '0' NOT NULL, - username varchar2(252) DEFAULT '' , - user_password varchar2(40) DEFAULT '' , + username varchar2(255) DEFAULT '' , + username_clean varchar2(255) DEFAULT '' , + user_password varchar2(120) DEFAULT '' , user_passchg number(11) DEFAULT '0' NOT NULL, - user_email varchar2(100) DEFAULT '' , + user_email varchar2(300) DEFAULT '' , user_email_hash number(20) DEFAULT '0' NOT NULL, user_birthday varchar2(10) DEFAULT '' , user_lastvisit number(11) DEFAULT '0' NOT NULL, user_lastmark number(11) DEFAULT '0' NOT NULL, user_lastpost_time number(11) DEFAULT '0' NOT NULL, - user_lastpage varchar2(200) DEFAULT '' , + user_lastpage varchar2(600) DEFAULT '' , user_last_confirm_key varchar2(10) DEFAULT '' , user_last_search number(11) DEFAULT '0' NOT NULL, user_warnings number(4) DEFAULT '0' NOT NULL, user_last_warning number(11) DEFAULT '0' NOT NULL, user_login_attempts number(4) DEFAULT '0' NOT NULL, + user_inactive_reason number(2) DEFAULT '0' NOT NULL, + user_inactive_time number(11) DEFAULT '0' NOT NULL, user_posts number(8) DEFAULT '0' NOT NULL, user_lang varchar2(30) DEFAULT '' , user_timezone number(5, 2) DEFAULT '0' NOT NULL, user_dst number(1) DEFAULT '0' NOT NULL, - user_dateformat varchar2(30) DEFAULT 'd M Y H:i' NOT NULL, + user_dateformat varchar2(90) DEFAULT 'd M Y H:i' NOT NULL, user_style number(4) DEFAULT '0' NOT NULL, user_rank number(8) DEFAULT '0' NOT NULL, user_colour varchar2(6) DEFAULT '' , @@ -1808,7 +1815,6 @@ CREATE TABLE phpbb_users ( user_notify_pm number(1) DEFAULT '1' NOT NULL, user_notify_type number(4) DEFAULT '0' NOT NULL, user_allow_pm number(1) DEFAULT '1' NOT NULL, - user_allow_email number(1) DEFAULT '1' NOT NULL, user_allow_viewonline number(1) DEFAULT '1' NOT NULL, user_allow_viewemail number(1) DEFAULT '1' NOT NULL, user_allow_massemail number(1) DEFAULT '1' NOT NULL, @@ -1819,18 +1825,18 @@ CREATE TABLE phpbb_users ( user_avatar_height number(4) DEFAULT '0' NOT NULL, user_sig clob DEFAULT '' , user_sig_bbcode_uid varchar2(5) DEFAULT '' , - user_sig_bbcode_bitfield varchar2(252) DEFAULT '' , - user_from varchar2(100) DEFAULT '' , + user_sig_bbcode_bitfield varchar2(255) DEFAULT '' , + user_from varchar2(300) DEFAULT '' , user_icq varchar2(15) DEFAULT '' , - user_aim varchar2(255) DEFAULT '' , - user_yim varchar2(255) DEFAULT '' , - user_msnm varchar2(255) DEFAULT '' , - user_jabber varchar2(255) DEFAULT '' , - user_website varchar2(200) DEFAULT '' , - user_occ varchar2(255) DEFAULT '' , + user_aim varchar2(765) DEFAULT '' , + user_yim varchar2(765) DEFAULT '' , + user_msnm varchar2(765) DEFAULT '' , + user_jabber varchar2(765) DEFAULT '' , + user_website varchar2(600) DEFAULT '' , + user_occ varchar2(765) DEFAULT '' , user_interests clob DEFAULT '' , user_actkey varchar2(32) DEFAULT '' , - user_newpasswd varchar2(32) DEFAULT '' , + user_newpasswd varchar2(96) DEFAULT '' , CONSTRAINT pk_phpbb_users PRIMARY KEY (user_id) ) / @@ -1841,7 +1847,7 @@ CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash) / CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type) / -CREATE INDEX phpbb_users_username ON phpbb_users (username) +CREATE INDEX phpbb_users_username_clean ON phpbb_users (username_clean) / CREATE SEQUENCE phpbb_users_seq @@ -1895,8 +1901,8 @@ END; */ CREATE TABLE phpbb_words ( word_id number(8) NOT NULL, - word varchar2(255) DEFAULT '' , - replacement varchar2(255) DEFAULT '' , + word varchar2(765) DEFAULT '' , + replacement varchar2(765) DEFAULT '' , CONSTRAINT pk_phpbb_words PRIMARY KEY (word_id) ) / diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index de2f314171..11a0a7a958 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -10,7 +10,7 @@ BEGIN; /* Domain definition */ -CREATE DOMAIN varchar_ci AS varchar(252) NOT NULL DEFAULT ''::character varying; +CREATE DOMAIN varchar_ci AS varchar(255) NOT NULL DEFAULT ''::character varying; /* Operation Functions @@ -93,10 +93,11 @@ CREATE TABLE phpbb_attachments ( topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0), in_message INT2 DEFAULT '0' NOT NULL CHECK (in_message >= 0), poster_id INT4 DEFAULT '0' NOT NULL CHECK (poster_id >= 0), + is_orphan INT2 DEFAULT '1' NOT NULL CHECK (is_orphan >= 0), physical_filename varchar(255) DEFAULT '' NOT NULL, real_filename varchar(255) DEFAULT '' NOT NULL, download_count INT4 DEFAULT '0' NOT NULL CHECK (download_count >= 0), - attach_comment varchar(8000) DEFAULT '' NOT NULL, + attach_comment varchar(4000) DEFAULT '' NOT NULL, extension varchar(100) DEFAULT '' NOT NULL, mimetype varchar(100) DEFAULT '' NOT NULL, filesize INT4 DEFAULT '0' NOT NULL CHECK (filesize >= 0), @@ -109,7 +110,7 @@ CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments (filetime); CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments (post_msg_id); CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments (topic_id); CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id); -CREATE INDEX phpbb_attachments_filesize ON phpbb_attachments (filesize); +CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments (is_orphan); /* Table: 'phpbb_acl_groups' @@ -149,7 +150,7 @@ CREATE SEQUENCE phpbb_acl_roles_seq; CREATE TABLE phpbb_acl_roles ( role_id INT4 DEFAULT nextval('phpbb_acl_roles_seq'), role_name varchar(255) DEFAULT '' NOT NULL, - role_description varchar(8000) DEFAULT '' NOT NULL, + role_description varchar(4000) DEFAULT '' NOT NULL, role_type varchar(10) DEFAULT '' NOT NULL, role_order INT2 DEFAULT '0' NOT NULL CHECK (role_order >= 0), PRIMARY KEY (role_id) @@ -214,7 +215,7 @@ CREATE TABLE phpbb_bbcodes ( bbcode_tag varchar(16) DEFAULT '' NOT NULL, bbcode_helpline varchar(255) DEFAULT '' NOT NULL, display_on_posting INT2 DEFAULT '0' NOT NULL CHECK (display_on_posting >= 0), - bbcode_match varchar(8000) DEFAULT '' NOT NULL, + bbcode_match varchar(4000) DEFAULT '' NOT NULL, bbcode_tpl TEXT DEFAULT '' NOT NULL, first_pass_match TEXT DEFAULT '' NOT NULL, first_pass_replace TEXT DEFAULT '' NOT NULL, @@ -245,7 +246,7 @@ CREATE SEQUENCE phpbb_bots_seq; CREATE TABLE phpbb_bots ( bot_id INT4 DEFAULT nextval('phpbb_bots_seq'), bot_active INT2 DEFAULT '1' NOT NULL CHECK (bot_active >= 0), - bot_name varchar(3000) DEFAULT '' NOT NULL, + bot_name varchar(255) DEFAULT '' NOT NULL, user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), bot_agent varchar(255) DEFAULT '' NOT NULL, bot_ip varchar(255) DEFAULT '' NOT NULL, @@ -258,7 +259,7 @@ CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active); Table: 'phpbb_config' */ CREATE TABLE phpbb_config ( - config_name varchar(252) DEFAULT '' NOT NULL, + config_name varchar(255) DEFAULT '' NOT NULL, config_value varchar(255) DEFAULT '' NOT NULL, is_dynamic INT2 DEFAULT '0' NOT NULL CHECK (is_dynamic >= 0), PRIMARY KEY (config_name) @@ -286,7 +287,7 @@ CREATE SEQUENCE phpbb_disallow_seq; CREATE TABLE phpbb_disallow ( disallow_id INT4 DEFAULT nextval('phpbb_disallow_seq'), - disallow_username varchar(252) DEFAULT '' NOT NULL, + disallow_username varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (disallow_id) ); @@ -302,7 +303,7 @@ CREATE TABLE phpbb_drafts ( topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0), forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0), save_time INT4 DEFAULT '0' NOT NULL CHECK (save_time >= 0), - draft_subject varchar(1000) DEFAULT '' NOT NULL, + draft_subject varchar(100) DEFAULT '' NOT NULL, draft_message TEXT DEFAULT '' NOT NULL, PRIMARY KEY (draft_id) ); @@ -352,19 +353,19 @@ CREATE TABLE phpbb_forums ( left_id INT4 DEFAULT '0' NOT NULL CHECK (left_id >= 0), right_id INT4 DEFAULT '0' NOT NULL CHECK (right_id >= 0), forum_parents TEXT DEFAULT '' NOT NULL, - forum_name varchar(3000) DEFAULT '' NOT NULL, - forum_desc varchar(8000) DEFAULT '' NOT NULL, - forum_desc_bitfield varchar(252) DEFAULT '' NOT NULL, - forum_desc_options INT4 DEFAULT '0' NOT NULL CHECK (forum_desc_options >= 0), + forum_name varchar(255) DEFAULT '' NOT NULL, + forum_desc varchar(4000) DEFAULT '' NOT NULL, + forum_desc_bitfield varchar(255) DEFAULT '' NOT NULL, + forum_desc_options INT4 DEFAULT '7' NOT NULL CHECK (forum_desc_options >= 0), forum_desc_uid varchar(5) DEFAULT '' NOT NULL, forum_link varchar(255) DEFAULT '' NOT NULL, forum_password varchar(40) DEFAULT '' NOT NULL, forum_style INT2 DEFAULT '0' NOT NULL, forum_image varchar(255) DEFAULT '' NOT NULL, - forum_rules varchar(8000) DEFAULT '' NOT NULL, + forum_rules varchar(4000) DEFAULT '' NOT NULL, forum_rules_link varchar(255) DEFAULT '' NOT NULL, - forum_rules_bitfield varchar(252) DEFAULT '' NOT NULL, - forum_rules_options INT4 DEFAULT '0' NOT NULL CHECK (forum_rules_options >= 0), + forum_rules_bitfield varchar(255) DEFAULT '' NOT NULL, + forum_rules_options INT4 DEFAULT '7' NOT NULL CHECK (forum_rules_options >= 0), forum_rules_uid varchar(5) DEFAULT '' NOT NULL, forum_topics_per_page INT2 DEFAULT '0' NOT NULL, forum_type INT2 DEFAULT '0' NOT NULL, @@ -374,8 +375,10 @@ CREATE TABLE phpbb_forums ( forum_topics_real INT4 DEFAULT '0' NOT NULL CHECK (forum_topics_real >= 0), forum_last_post_id INT4 DEFAULT '0' NOT NULL CHECK (forum_last_post_id >= 0), forum_last_poster_id INT4 DEFAULT '0' NOT NULL CHECK (forum_last_poster_id >= 0), + forum_last_post_subject varchar(100) DEFAULT '' NOT NULL, forum_last_post_time INT4 DEFAULT '0' NOT NULL CHECK (forum_last_post_time >= 0), forum_last_poster_name varchar(255) DEFAULT '' NOT NULL, + forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL, forum_flags INT2 DEFAULT '32' NOT NULL, display_on_index INT2 DEFAULT '1' NOT NULL CHECK (display_on_index >= 0), enable_indexing INT2 DEFAULT '1' NOT NULL CHECK (enable_indexing >= 0), @@ -435,9 +438,9 @@ CREATE TABLE phpbb_groups ( group_id INT4 DEFAULT nextval('phpbb_groups_seq'), group_type INT2 DEFAULT '1' NOT NULL, group_name varchar_ci DEFAULT '' NOT NULL, - group_desc varchar(8000) DEFAULT '' NOT NULL, - group_desc_bitfield varchar(252) DEFAULT '' NOT NULL, - group_desc_options INT4 DEFAULT '0' NOT NULL CHECK (group_desc_options >= 0), + group_desc varchar(4000) DEFAULT '' NOT NULL, + group_desc_bitfield varchar(255) DEFAULT '' NOT NULL, + group_desc_options INT4 DEFAULT '7' NOT NULL CHECK (group_desc_options >= 0), group_desc_uid varchar(5) DEFAULT '' NOT NULL, group_display INT2 DEFAULT '0' NOT NULL CHECK (group_display >= 0), group_avatar varchar(255) DEFAULT '' NOT NULL, @@ -503,7 +506,7 @@ CREATE TABLE phpbb_log ( reportee_id INT4 DEFAULT '0' NOT NULL CHECK (reportee_id >= 0), log_ip varchar(40) DEFAULT '' NOT NULL, log_time INT4 DEFAULT '0' NOT NULL CHECK (log_time >= 0), - log_operation varchar(8000) DEFAULT '' NOT NULL, + log_operation varchar(4000) DEFAULT '' NOT NULL, log_data TEXT DEFAULT '' NOT NULL, PRIMARY KEY (log_id) ); @@ -520,7 +523,7 @@ CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id); CREATE TABLE phpbb_moderator_cache ( forum_id INT4 DEFAULT '0' NOT NULL CHECK (forum_id >= 0), user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), - username varchar(252) DEFAULT '' NOT NULL, + username varchar(255) DEFAULT '' NOT NULL, group_id INT4 DEFAULT '0' NOT NULL CHECK (group_id >= 0), group_name varchar(255) DEFAULT '' NOT NULL, display_on_index INT2 DEFAULT '1' NOT NULL CHECK (display_on_index >= 0) @@ -559,7 +562,7 @@ CREATE INDEX phpbb_modules_class_left_id ON phpbb_modules (module_class, left_id CREATE TABLE phpbb_poll_options ( poll_option_id INT2 DEFAULT '0' NOT NULL, topic_id INT4 DEFAULT '0' NOT NULL CHECK (topic_id >= 0), - poll_option_text varchar(8000) DEFAULT '' NOT NULL, + poll_option_text varchar(4000) DEFAULT '' NOT NULL, poll_option_total INT4 DEFAULT '0' NOT NULL CHECK (poll_option_total >= 0) ); @@ -599,17 +602,16 @@ CREATE TABLE phpbb_posts ( enable_smilies INT2 DEFAULT '1' NOT NULL CHECK (enable_smilies >= 0), enable_magic_url INT2 DEFAULT '1' NOT NULL CHECK (enable_magic_url >= 0), enable_sig INT2 DEFAULT '1' NOT NULL CHECK (enable_sig >= 0), - post_username varchar(252) DEFAULT '' NOT NULL, - post_subject varchar(1000) DEFAULT '' NOT NULL, + post_username varchar(255) DEFAULT '' NOT NULL, + post_subject varchar(100) DEFAULT '' NOT NULL, post_text TEXT DEFAULT '' NOT NULL, post_checksum varchar(32) DEFAULT '' NOT NULL, - post_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, post_attachment INT2 DEFAULT '0' NOT NULL CHECK (post_attachment >= 0), - bbcode_bitfield varchar(252) DEFAULT '' NOT NULL, + bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, bbcode_uid varchar(5) DEFAULT '' NOT NULL, post_postcount INT2 DEFAULT '1' NOT NULL CHECK (post_postcount >= 0), post_edit_time INT4 DEFAULT '0' NOT NULL CHECK (post_edit_time >= 0), - post_edit_reason varchar(3000) DEFAULT '' NOT NULL, + post_edit_reason varchar(255) DEFAULT '' NOT NULL, post_edit_user INT4 DEFAULT '0' NOT NULL CHECK (post_edit_user >= 0), post_edit_count INT2 DEFAULT '0' NOT NULL CHECK (post_edit_count >= 0), post_edit_locked INT2 DEFAULT '0' NOT NULL CHECK (post_edit_locked >= 0), @@ -621,8 +623,7 @@ CREATE INDEX phpbb_posts_topic_id ON phpbb_posts (topic_id); CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip); CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id); CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved); -CREATE INDEX phpbb_posts_post_postcount ON phpbb_posts (post_postcount); -CREATE INDEX phpbb_posts_post_time ON phpbb_posts (post_time); +CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time); /* Table: 'phpbb_privmsgs' @@ -640,18 +641,17 @@ CREATE TABLE phpbb_privmsgs ( enable_smilies INT2 DEFAULT '1' NOT NULL CHECK (enable_smilies >= 0), enable_magic_url INT2 DEFAULT '1' NOT NULL CHECK (enable_magic_url >= 0), enable_sig INT2 DEFAULT '1' NOT NULL CHECK (enable_sig >= 0), - message_subject varchar(1000) DEFAULT '' NOT NULL, + message_subject varchar(100) DEFAULT '' NOT NULL, message_text TEXT DEFAULT '' NOT NULL, - message_edit_reason varchar(3000) DEFAULT '' NOT NULL, + message_edit_reason varchar(255) DEFAULT '' NOT NULL, message_edit_user INT4 DEFAULT '0' NOT NULL CHECK (message_edit_user >= 0), - message_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, message_attachment INT2 DEFAULT '0' NOT NULL CHECK (message_attachment >= 0), - bbcode_bitfield varchar(252) DEFAULT '' NOT NULL, + bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, bbcode_uid varchar(5) DEFAULT '' NOT NULL, message_edit_time INT4 DEFAULT '0' NOT NULL CHECK (message_edit_time >= 0), message_edit_count INT2 DEFAULT '0' NOT NULL CHECK (message_edit_count >= 0), - to_address varchar(8000) DEFAULT '' NOT NULL, - bcc_address varchar(8000) DEFAULT '' NOT NULL, + to_address varchar(4000) DEFAULT '' NOT NULL, + bcc_address varchar(4000) DEFAULT '' NOT NULL, PRIMARY KEY (msg_id) ); @@ -772,7 +772,7 @@ CREATE TABLE phpbb_profile_lang ( field_id INT4 DEFAULT '0' NOT NULL CHECK (field_id >= 0), lang_id INT4 DEFAULT '0' NOT NULL CHECK (lang_id >= 0), lang_name varchar(255) DEFAULT '' NOT NULL, - lang_explain varchar(8000) DEFAULT '' NOT NULL, + lang_explain varchar(4000) DEFAULT '' NOT NULL, lang_default_value varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (field_id, lang_id) ); @@ -844,7 +844,7 @@ CREATE SEQUENCE phpbb_search_wordlist_seq; CREATE TABLE phpbb_search_wordlist ( word_id INT4 DEFAULT nextval('phpbb_search_wordlist_seq'), - word_text varchar(252) DEFAULT '' NOT NULL, + word_text varchar(255) DEFAULT '' NOT NULL, word_common INT2 DEFAULT '0' NOT NULL CHECK (word_common >= 0), PRIMARY KEY (word_id) ); @@ -921,8 +921,8 @@ CREATE TABLE phpbb_smilies ( code varchar(50) DEFAULT '' NOT NULL, emotion varchar(50) DEFAULT '' NOT NULL, smiley_url varchar(50) DEFAULT '' NOT NULL, - smiley_width INT2 DEFAULT '0' NOT NULL, - smiley_height INT2 DEFAULT '0' NOT NULL, + smiley_width INT2 DEFAULT '0' NOT NULL CHECK (smiley_width >= 0), + smiley_height INT2 DEFAULT '0' NOT NULL CHECK (smiley_height >= 0), smiley_order INT4 DEFAULT '0' NOT NULL CHECK (smiley_order >= 0), display_on_posting INT2 DEFAULT '1' NOT NULL CHECK (display_on_posting >= 0), PRIMARY KEY (smiley_id) @@ -937,7 +937,7 @@ CREATE SEQUENCE phpbb_styles_seq; CREATE TABLE phpbb_styles ( style_id INT2 DEFAULT nextval('phpbb_styles_seq'), - style_name varchar(252) DEFAULT '' NOT NULL, + style_name varchar(255) DEFAULT '' NOT NULL, style_copyright varchar(255) DEFAULT '' NOT NULL, style_active INT2 DEFAULT '1' NOT NULL CHECK (style_active >= 0), template_id INT2 DEFAULT '0' NOT NULL, @@ -958,10 +958,10 @@ CREATE SEQUENCE phpbb_styles_template_seq; CREATE TABLE phpbb_styles_template ( template_id INT2 DEFAULT nextval('phpbb_styles_template_seq'), - template_name varchar(252) DEFAULT '' NOT NULL, + template_name varchar(255) DEFAULT '' NOT NULL, template_copyright varchar(255) DEFAULT '' NOT NULL, template_path varchar(100) DEFAULT '' NOT NULL, - bbcode_bitfield varchar(252) DEFAULT 'kNg=' NOT NULL, + bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL, template_storedb INT2 DEFAULT '0' NOT NULL CHECK (template_storedb >= 0), PRIMARY KEY (template_id) ); @@ -991,7 +991,7 @@ CREATE SEQUENCE phpbb_styles_theme_seq; CREATE TABLE phpbb_styles_theme ( theme_id INT2 DEFAULT nextval('phpbb_styles_theme_seq'), - theme_name varchar(252) DEFAULT '' NOT NULL, + theme_name varchar(255) DEFAULT '' NOT NULL, theme_copyright varchar(255) DEFAULT '' NOT NULL, theme_path varchar(100) DEFAULT '' NOT NULL, theme_storedb INT2 DEFAULT '0' NOT NULL CHECK (theme_storedb >= 0), @@ -1009,7 +1009,7 @@ CREATE SEQUENCE phpbb_styles_imageset_seq; CREATE TABLE phpbb_styles_imageset ( imageset_id INT2 DEFAULT nextval('phpbb_styles_imageset_seq'), - imageset_name varchar(252) DEFAULT '' NOT NULL, + imageset_name varchar(255) DEFAULT '' NOT NULL, imageset_copyright varchar(255) DEFAULT '' NOT NULL, imageset_path varchar(100) DEFAULT '' NOT NULL, site_logo varchar(200) DEFAULT '' NOT NULL, @@ -1123,7 +1123,7 @@ CREATE TABLE phpbb_topics ( topic_attachment INT2 DEFAULT '0' NOT NULL CHECK (topic_attachment >= 0), topic_approved INT2 DEFAULT '1' NOT NULL CHECK (topic_approved >= 0), topic_reported INT2 DEFAULT '0' NOT NULL CHECK (topic_reported >= 0), - topic_title varchar(1000) DEFAULT '' NOT NULL, + topic_title varchar(100) DEFAULT '' NOT NULL, topic_poster INT4 DEFAULT '0' NOT NULL CHECK (topic_poster >= 0), topic_time INT4 DEFAULT '0' NOT NULL CHECK (topic_time >= 0), topic_time_limit INT4 DEFAULT '0' NOT NULL CHECK (topic_time_limit >= 0), @@ -1134,15 +1134,18 @@ CREATE TABLE phpbb_topics ( topic_type INT2 DEFAULT '0' NOT NULL, topic_first_post_id INT4 DEFAULT '0' NOT NULL CHECK (topic_first_post_id >= 0), topic_first_poster_name varchar(255) DEFAULT '' NOT NULL, + topic_first_poster_colour varchar(6) DEFAULT '' NOT NULL, topic_last_post_id INT4 DEFAULT '0' NOT NULL CHECK (topic_last_post_id >= 0), topic_last_poster_id INT4 DEFAULT '0' NOT NULL CHECK (topic_last_poster_id >= 0), topic_last_poster_name varchar(255) DEFAULT '' NOT NULL, + topic_last_poster_colour varchar(6) DEFAULT '' NOT NULL, + topic_last_post_subject varchar(100) DEFAULT '' NOT NULL, topic_last_post_time INT4 DEFAULT '0' NOT NULL CHECK (topic_last_post_time >= 0), topic_last_view_time INT4 DEFAULT '0' NOT NULL CHECK (topic_last_view_time >= 0), topic_moved_id INT4 DEFAULT '0' NOT NULL CHECK (topic_moved_id >= 0), topic_bumped INT2 DEFAULT '0' NOT NULL CHECK (topic_bumped >= 0), topic_bumper INT4 DEFAULT '0' NOT NULL CHECK (topic_bumper >= 0), - poll_title varchar(1000) DEFAULT '' NOT NULL, + poll_title varchar(100) DEFAULT '' NOT NULL, poll_start INT4 DEFAULT '0' NOT NULL CHECK (poll_start >= 0), poll_length INT4 DEFAULT '0' NOT NULL CHECK (poll_length >= 0), poll_max_options INT2 DEFAULT '1' NOT NULL, @@ -1154,6 +1157,7 @@ CREATE TABLE phpbb_topics ( CREATE INDEX phpbb_topics_forum_id ON phpbb_topics (forum_id); CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics (forum_id, topic_type); CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics (topic_last_post_time); +CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics (topic_approved); CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id); /* @@ -1221,6 +1225,7 @@ CREATE TABLE phpbb_users ( user_ip varchar(40) DEFAULT '' NOT NULL, user_regdate INT4 DEFAULT '0' NOT NULL CHECK (user_regdate >= 0), username varchar_ci DEFAULT '' NOT NULL, + username_clean varchar_ci DEFAULT '' NOT NULL, user_password varchar(40) DEFAULT '' NOT NULL, user_passchg INT4 DEFAULT '0' NOT NULL CHECK (user_passchg >= 0), user_email varchar(100) DEFAULT '' NOT NULL, @@ -1235,6 +1240,8 @@ CREATE TABLE phpbb_users ( user_warnings INT2 DEFAULT '0' NOT NULL, user_last_warning INT4 DEFAULT '0' NOT NULL CHECK (user_last_warning >= 0), user_login_attempts INT2 DEFAULT '0' NOT NULL, + user_inactive_reason INT2 DEFAULT '0' NOT NULL, + user_inactive_time INT4 DEFAULT '0' NOT NULL CHECK (user_inactive_time >= 0), user_posts INT4 DEFAULT '0' NOT NULL CHECK (user_posts >= 0), user_lang varchar(30) DEFAULT '' NOT NULL, user_timezone decimal(5,2) DEFAULT '0' NOT NULL, @@ -1259,18 +1266,17 @@ CREATE TABLE phpbb_users ( user_notify_pm INT2 DEFAULT '1' NOT NULL CHECK (user_notify_pm >= 0), user_notify_type INT2 DEFAULT '0' NOT NULL, user_allow_pm INT2 DEFAULT '1' NOT NULL CHECK (user_allow_pm >= 0), - user_allow_email INT2 DEFAULT '1' NOT NULL CHECK (user_allow_email >= 0), user_allow_viewonline INT2 DEFAULT '1' NOT NULL CHECK (user_allow_viewonline >= 0), user_allow_viewemail INT2 DEFAULT '1' NOT NULL CHECK (user_allow_viewemail >= 0), user_allow_massemail INT2 DEFAULT '1' NOT NULL CHECK (user_allow_massemail >= 0), user_options INT4 DEFAULT '893' NOT NULL CHECK (user_options >= 0), user_avatar varchar(255) DEFAULT '' NOT NULL, user_avatar_type INT2 DEFAULT '0' NOT NULL, - user_avatar_width INT2 DEFAULT '0' NOT NULL, - user_avatar_height INT2 DEFAULT '0' NOT NULL, + user_avatar_width INT2 DEFAULT '0' NOT NULL CHECK (user_avatar_width >= 0), + user_avatar_height INT2 DEFAULT '0' NOT NULL CHECK (user_avatar_height >= 0), user_sig TEXT DEFAULT '' NOT NULL, user_sig_bbcode_uid varchar(5) DEFAULT '' NOT NULL, - user_sig_bbcode_bitfield varchar(252) DEFAULT '' NOT NULL, + user_sig_bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, user_from varchar(100) DEFAULT '' NOT NULL, user_icq varchar(15) DEFAULT '' NOT NULL, user_aim varchar(255) DEFAULT '' NOT NULL, @@ -1279,7 +1285,7 @@ CREATE TABLE phpbb_users ( user_jabber varchar(255) DEFAULT '' NOT NULL, user_website varchar(200) DEFAULT '' NOT NULL, user_occ varchar(255) DEFAULT '' NOT NULL, - user_interests varchar(8000) DEFAULT '' NOT NULL, + user_interests varchar(4000) DEFAULT '' NOT NULL, user_actkey varchar(32) DEFAULT '' NOT NULL, user_newpasswd varchar(32) DEFAULT '' NOT NULL, PRIMARY KEY (user_id) @@ -1288,7 +1294,7 @@ CREATE TABLE phpbb_users ( CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday); CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash); CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type); -CREATE INDEX phpbb_users_username ON phpbb_users (username); +CREATE INDEX phpbb_users_username_clean ON phpbb_users (username_clean); /* Table: 'phpbb_warnings' diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index c2dd6babfe..50bfe9db3a 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -22,11 +22,13 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_name_chars', INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_namechange', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_nocensors', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_pm_attach', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_post_links', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_privmsg', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_bbcode', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_flash', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_img', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_links', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_pm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_smilies', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_smilies', '1'); @@ -57,6 +59,9 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('browser_check', '1 INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_interval', '10'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_type', 'd'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('cache_gc', '7200'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_noise', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('check_dnsbl', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('chg_passforce', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_domain', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_name', 'phpbb3'); @@ -71,6 +76,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_style', '1 INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_edited', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_order', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_check_mx', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_function_name', 'mail'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '50'); @@ -95,6 +101,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_imagick', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_link_height', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_link_width', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_height', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_thumb_width', '400'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_width', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_min_thumb_filesize', '12000'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_check', '3'); @@ -111,19 +118,19 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_server', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_uid', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_load', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_search_load', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_anon_lastread', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_birthdays', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_memberlist', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewprofile', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewtopic', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_db_lastread', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_anon_lastread', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_db_track', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_onlinetrack', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jumpbox', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_moderators', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_guests', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_time', '5'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_onlinetrack', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_search', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_tplcompile', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_user_activity', '1'); @@ -158,19 +165,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('pass_complex', '.* INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_edit_time', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_boxes', '4'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_msgs', '50'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('policy_overlap', '0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('policy_overlap_noise_pixel', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('policy_overlap_noise_line', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('policy_entropy', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('policy_entropy_noise_pixel', '2'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('policy_entropy_noise_line', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('policy_shape', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('policy_shape_noise_pixel', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('policy_shape_noise_line', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('policy_3dbitmap', '0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('policy_cells', '0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('policy_stencil', '0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('policy_composite', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('posts_per_page', '10'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('print_pm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('queue_interval', '600'); @@ -205,7 +199,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.B2'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.B3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); @@ -219,6 +213,7 @@ INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_po INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_topics', '1', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_users', '1', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('rand_seed', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('rand_seed_last_update', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_date', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_users', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('search_last_gc', '0', 1); @@ -242,10 +237,10 @@ INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_ignoreflood', 1 INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_img', 1); INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_list', 1); INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_noapprove', 1); -INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_print', 1); INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_poll', 1); INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_post', 1); INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_postcount', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_print', 1); INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_read', 1); INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_reply', 1); INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_report', 1); @@ -320,38 +315,37 @@ INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_words', 1); # -- User related auth options INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sendemail', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_readpm', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sendpm', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_masspm', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sendim', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_ignoreflood', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_hideonline', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_viewonline', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_viewprofile', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_attach', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgavatar', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chggrp', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgcensors', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgemail', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chggrp', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgname', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgpasswd', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgcensors', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_search', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_savedrafts', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_download', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_attach', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sig', 1); - +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_hideonline', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_ignoreflood', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_masspm', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_attach', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_bbcode', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_smilies', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_delete', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_download', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_edit', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_printpm', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_emailpm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_flash', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_forward', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_delete', 1); INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_img', 1); -INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_flash', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_printpm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_smilies', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_readpm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_savedrafts', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_search', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sendemail', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sendim', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sendpm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sig', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_viewonline', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_viewprofile', 1); # -- standard auth roles @@ -368,21 +362,22 @@ INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Standard Moderator', 'ROLE_DESCRIPTION_MOD_STANDARD', 'm_', 1); INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Simple Moderator', 'ROLE_DESCRIPTION_MOD_SIMPLE', 'm_', 2); INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Queue Moderator', 'ROLE_DESCRIPTION_MOD_QUEUE', 'm_', 4); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Full Access', 'ROLE_DESCRIPTION_FORUM_FULL', 'f_', 6); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Standard Access', 'ROLE_DESCRIPTION_FORUM_STANDARD', 'f_', 4); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Full Access', 'ROLE_DESCRIPTION_FORUM_FULL', 'f_', 7); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Standard Access', 'ROLE_DESCRIPTION_FORUM_STANDARD', 'f_', 5); INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('No Access', 'ROLE_DESCRIPTION_FORUM_NOACCESS', 'f_', 1); INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Read Only Access', 'ROLE_DESCRIPTION_FORUM_READONLY', 'f_', 2); INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Limited Access', 'ROLE_DESCRIPTION_FORUM_LIMITED', 'f_', 3); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Bot Access', 'ROLE_DESCRIPTION_FORUM_BOT', 'f_', 8); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('On Moderation Queue', 'ROLE_DESCRIPTION_FORUM_ONQUEUE', 'f_', 7); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Standard Access + Polls', 'ROLE_DESCRIPTION_FORUM_POLLS', 'f_', 5); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Bot Access', 'ROLE_DESCRIPTION_FORUM_BOT', 'f_', 9); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('On Moderation Queue', 'ROLE_DESCRIPTION_FORUM_ONQUEUE', 'f_', 8); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Standard Access + Polls', 'ROLE_DESCRIPTION_FORUM_POLLS', 'f_', 6); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Limited Access + Polls', 'ROLE_DESCRIPTION_FORUM_LIMITED_POLLS', 'f_', 4); # -- phpbb_styles INSERT INTO phpbb_styles (style_name, style_copyright, template_id, theme_id, imageset_id) VALUES ('subSilver', '© phpBB Group', 1, 1, 1); # -- phpbb_styles_imageset -INSERT INTO phpbb_styles_imageset (imageset_name, imageset_copyright, imageset_path, site_logo, upload_bar, poll_left, poll_center, poll_right, icon_friend, icon_foe, forum_link, forum_read, forum_read_locked, forum_read_subforum, forum_unread, forum_unread_locked, forum_unread_subforum, topic_moved, topic_read, topic_read_mine, topic_read_hot, topic_read_hot_mine, topic_read_locked, topic_read_locked_mine, topic_unread, topic_unread_mine, topic_unread_hot, topic_unread_hot_mine, topic_unread_locked, topic_unread_locked_mine, sticky_read, sticky_read_mine, sticky_read_locked, sticky_read_locked_mine, sticky_unread, sticky_unread_mine, sticky_unread_locked, sticky_unread_locked_mine, announce_read, announce_read_mine, announce_read_locked, announce_read_locked_mine, announce_unread, announce_unread_mine, announce_unread_locked, announce_unread_locked_mine, global_read, global_read_mine, global_read_locked, global_read_locked_mine, global_unread, global_unread_mine, global_unread_locked, global_unread_locked_mine, pm_read, pm_unread, icon_contact_aim, icon_contact_email, icon_contact_icq, icon_contact_jabber, icon_contact_msnm, icon_contact_pm, icon_contact_yahoo, icon_contact_www, icon_post_delete, icon_post_edit, icon_post_info, icon_post_quote, icon_post_report, icon_post_target, icon_post_target_unread, icon_topic_attach, icon_topic_latest, icon_topic_newest, icon_topic_reported, icon_topic_unapproved, icon_user_online, icon_user_offline, icon_user_profile, icon_user_search, icon_user_warn, button_pm_forward, button_pm_new, button_pm_reply, button_topic_locked, button_topic_new, button_topic_reply, user_icon1, user_icon2, user_icon3, user_icon4, user_icon5, user_icon6, user_icon7, user_icon8, user_icon9, user_icon10) VALUES ('subSilver', '© phpBB Group, 2003', 'subSilver', 'site_logo.gif*94*170', 'upload_bar.gif*16*280', 'poll_left.gif*12*4', 'poll_center.gif*12*', 'poll_right.gif*12*4', '', '', 'forum_link.gif*25*46', 'forum_read.gif*25*46', 'forum_read_locked.gif*25*46', 'forum_read_subforum.gif*25*46', 'forum_unread.gif*25*46', 'forum_unread_locked.gif*25*46', 'forum_unread_subforum.gif*25*46', 'topic_moved.gif*18*19', 'topic_read.gif*18*19', 'topic_read_mine.gif*18*19', 'topic_read_hot.gif*18*19', 'topic_read_hot_mine.gif*18*19', 'topic_read_locked.gif*18*19', 'topic_read_locked_mine.gif*18*19', 'topic_unread.gif*18*19', 'topic_unread_mine.gif*18*19', 'topic_unread_hot.gif*18*19', 'topic_unread_hot_mine.gif*18*19', 'topic_unread_locked.gif*18*19', 'topic_unread_locked_mine.gif*18*19', 'sticky_read.gif*18*19', 'sticky_read_mine.gif*18*19', 'sticky_read_locked.gif*18*19', 'sticky_read_locked_mine.gif*18*19', 'sticky_unread.gif*18*19', 'sticky_unread_mine.gif*18*19', 'sticky_unread_locked.gif*18*19', 'sticky_unread_locked_mine.gif*18*19', 'announce_read.gif*18*19', 'announce_read_mine.gif*18*19', 'announce_read_locked.gif*18*19', 'announce_read_locked_mine.gif*18*19', 'announce_unread.gif*18*19', 'announce_unread_mine.gif*18*19', 'announce_unread_locked.gif*18*19', 'announce_unread_locked_mine.gif*18*19', 'announce_read.gif*18*19', 'announce_read_mine.gif*18*19', 'announce_read_locked.gif*18*19', 'announce_read_locked_mine.gif*18*19', 'announce_unread.gif*18*19', 'announce_unread_mine.gif*18*19', 'announce_unread_locked.gif*18*19', 'announce_unread_locked_mine.gif*18*19', 'topic_read.gif*18*19', 'topic_unread.gif*18*19', '{LANG}/icon_contact_aim.gif*20*72', '{LANG}/icon_contact_email.gif*20*72', '{LANG}/icon_contact_icq.gif*20*72', '{LANG}/icon_contact_jabber.gif*20*72', '{LANG}/icon_contact_msnm.gif*20*72', '{LANG}/icon_contact_pm.gif*20*72', '{LANG}/icon_contanct_yahoo.gif*20*72', '{LANG}/icon_contact_www.gif*20*72', '{LANG}/icon_post_delete.gif*20*20', '{LANG}/icon_post_edit.gif*20*90', '{LANG}/icon_post_info.gif*20*20', '{LANG}/icon_post_quote.gif*20*90', '{LANG}/icon_post_report.gif*20*20', 'icon_post_target.gif*9*12', 'icon_post_target_unread.gif*9*12', 'icon_topic_attach.gif*18*14', 'icon_topic_latest.gif*9*18', 'icon_topic_newest.gif*9*18', 'icon_topic_reported.gif*18*19', 'icon_topic_unapproved.gif*18*19', '{LANG}/icon_user_online.gif*20*72', '{LANG}/icon_user_offline.gif*20*72', '{LANG}/icon_user_profile.gif*20*72', '{LANG}/icon_user_search.gif*20*72', '{LANG}/icon_user_warn.gif*20*20', '', '{LANG}/button_pm_new.gif*27*97', '{LANG}/button_pm_reply.gif*20*90', '{LANG}/button_topic_locked.gif*27*97', '{LANG}/button_topic_new.gif*27*97', '{LANG}/button_topic_reply.gif*27*97', '', '', '', '', '', '', '', '', '', ''); +INSERT INTO phpbb_styles_imageset (imageset_name, imageset_copyright, imageset_path, site_logo, upload_bar, poll_left, poll_center, poll_right, icon_friend, icon_foe, forum_link, forum_read, forum_read_locked, forum_read_subforum, forum_unread, forum_unread_locked, forum_unread_subforum, topic_moved, topic_read, topic_read_mine, topic_read_hot, topic_read_hot_mine, topic_read_locked, topic_read_locked_mine, topic_unread, topic_unread_mine, topic_unread_hot, topic_unread_hot_mine, topic_unread_locked, topic_unread_locked_mine, sticky_read, sticky_read_mine, sticky_read_locked, sticky_read_locked_mine, sticky_unread, sticky_unread_mine, sticky_unread_locked, sticky_unread_locked_mine, announce_read, announce_read_mine, announce_read_locked, announce_read_locked_mine, announce_unread, announce_unread_mine, announce_unread_locked, announce_unread_locked_mine, global_read, global_read_mine, global_read_locked, global_read_locked_mine, global_unread, global_unread_mine, global_unread_locked, global_unread_locked_mine, pm_read, pm_unread, icon_contact_aim, icon_contact_email, icon_contact_icq, icon_contact_jabber, icon_contact_msnm, icon_contact_pm, icon_contact_yahoo, icon_contact_www, icon_post_delete, icon_post_edit, icon_post_info, icon_post_quote, icon_post_report, icon_post_target, icon_post_target_unread, icon_topic_attach, icon_topic_latest, icon_topic_newest, icon_topic_reported, icon_topic_unapproved, icon_user_online, icon_user_offline, icon_user_profile, icon_user_search, icon_user_warn, button_pm_forward, button_pm_new, button_pm_reply, button_topic_locked, button_topic_new, button_topic_reply, user_icon1, user_icon2, user_icon3, user_icon4, user_icon5, user_icon6, user_icon7, user_icon8, user_icon9, user_icon10) VALUES ('subSilver', '© phpBB Group, 2003', 'subSilver', 'site_logo.gif*94*170', 'upload_bar.gif*16*280', 'poll_left.gif*12*4', 'poll_center.gif*12*', 'poll_right.gif*12*4', '', '', 'forum_link.gif*25*46', 'forum_read.gif*25*46', 'forum_read_locked.gif*25*46', 'forum_read_subforum.gif*25*46', 'forum_unread.gif*25*46', 'forum_unread_locked.gif*25*46', 'forum_unread_subforum.gif*25*46', 'topic_moved.gif*18*19', 'topic_read.gif*18*19', 'topic_read_mine.gif*18*19', 'topic_read_hot.gif*18*19', 'topic_read_hot_mine.gif*18*19', 'topic_read_locked.gif*18*19', 'topic_read_locked_mine.gif*18*19', 'topic_unread.gif*18*19', 'topic_unread_mine.gif*18*19', 'topic_unread_hot.gif*18*19', 'topic_unread_hot_mine.gif*18*19', 'topic_unread_locked.gif*18*19', 'topic_unread_locked_mine.gif*18*19', 'sticky_read.gif*18*19', 'sticky_read_mine.gif*18*19', 'sticky_read_locked.gif*18*19', 'sticky_read_locked_mine.gif*18*19', 'sticky_unread.gif*18*19', 'sticky_unread_mine.gif*18*19', 'sticky_unread_locked.gif*18*19', 'sticky_unread_locked_mine.gif*18*19', 'announce_read.gif*18*19', 'announce_read_mine.gif*18*19', 'announce_read_locked.gif*18*19', 'announce_read_locked_mine.gif*18*19', 'announce_unread.gif*18*19', 'announce_unread_mine.gif*18*19', 'announce_unread_locked.gif*18*19', 'announce_unread_locked_mine.gif*18*19', 'announce_read.gif*18*19', 'announce_read_mine.gif*18*19', 'announce_read_locked.gif*18*19', 'announce_read_locked_mine.gif*18*19', 'announce_unread.gif*18*19', 'announce_unread_mine.gif*18*19', 'announce_unread_locked.gif*18*19', 'announce_unread_locked_mine.gif*18*19', 'topic_read.gif*18*19', 'topic_unread.gif*18*19', '{LANG}/icon_contact_aim.gif*20*72', '{LANG}/icon_contact_email.gif*20*72', '{LANG}/icon_contact_icq.gif*20*72', '{LANG}/icon_contact_jabber.gif*20*72', '{LANG}/icon_contact_msnm.gif*20*72', '{LANG}/icon_contact_pm.gif*20*72', '{LANG}/icon_contact_yahoo.gif*20*72', '{LANG}/icon_contact_www.gif*20*72', '{LANG}/icon_post_delete.gif*20*20', '{LANG}/icon_post_edit.gif*20*90', '{LANG}/icon_post_info.gif*20*20', '{LANG}/icon_post_quote.gif*20*90', '{LANG}/icon_post_report.gif*20*20', 'icon_post_target.gif*9*12', 'icon_post_target_unread.gif*9*12', 'icon_topic_attach.gif*18*14', 'icon_topic_latest.gif*9*18', 'icon_topic_newest.gif*9*18', 'icon_topic_reported.gif*18*19', 'icon_topic_unapproved.gif*18*19', '{LANG}/icon_user_online.gif*20*72', '{LANG}/icon_user_offline.gif*20*72', '{LANG}/icon_user_profile.gif*20*72', '{LANG}/icon_user_search.gif*20*72', '{LANG}/icon_user_warn.gif*20*20', '', '{LANG}/button_pm_new.gif*27*97', '{LANG}/button_pm_reply.gif*20*90', '{LANG}/button_topic_locked.gif*27*97', '{LANG}/button_topic_new.gif*27*97', '{LANG}/button_topic_reply.gif*27*97', '', '', '', '', '', '', '', '', '', ''); # -- phpbb_styles_template INSERT INTO phpbb_styles_template (template_name, template_copyright, template_path) VALUES ('subSilver', '© phpBB Group', 'subSilver'); @@ -391,20 +386,18 @@ INSERT INTO phpbb_styles_template (template_name, template_copyright, template_p INSERT INTO phpbb_styles_theme (theme_name, theme_copyright, theme_path, theme_data) VALUES ('subSilver', '© phpBB Group', 'subSilver', ''); # -- Forums -INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed) VALUES ('My first Category', '', 1, 4, 0, 0, 1, 1, 1, 1, 2, 'Admin', 972086460, '', '', '', '', '', '', '', 0, 0); +INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents) VALUES ('My first Category', '', 1, 4, 0, 0, 1, 1, 1, 1, 2, 'Admin', 'AA0000', 972086460, '', '', '', '', '', '', '', 0, 0, ''); -INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed) VALUES ('Test Forum 1', 'This is just a test forum.', 2, 3, 1, 1, 1, 1, 1, 1, 2, 'Admin', 972086460, '', '', '', '', '', '', '', 0, 0); +INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_subject, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents) VALUES ('Test Forum 1', 'This is just a test forum.', 2, 3, 1, 1, 1, 1, 1, 1, 2, 'Admin', 'AA0000', 'Welcome to phpBB 3', 972086460, '', '', '', '', '', '', '', 0, 0, ''); # -- Users / Anonymous user -INSERT INTO phpbb_users (user_type, group_id, username, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd) VALUES (2, 1, 'Anonymous', 0, '', '', 'en', 1, 0, '', 0, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); +INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd) VALUES (2, 1, 'Anonymous', 'anonymous', 0, '', '', 'en', 1, 0, '', 0, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); # -- username: Admin password: admin (change this or remove it once everything is working!) -INSERT INTO phpbb_users (user_type, group_id, username, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd) VALUES (3, 7, 'Admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); +INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin', 'admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); # -- Groups INSERT INTO phpbb_groups (group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('GUESTS', 3, '', 0, '', '', ''); -INSERT INTO phpbb_groups (group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('INACTIVE', 3, '', 0, '', '', ''); -INSERT INTO phpbb_groups (group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('INACTIVE_COPPA', 3, '', 0, '', '', ''); INSERT INTO phpbb_groups (group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('REGISTERED', 3, '', 0, '', '', ''); INSERT INTO phpbb_groups (group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('REGISTERED_COPPA', 3, '', 0, '', '', ''); INSERT INTO phpbb_groups (group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('GLOBAL_MODERATORS', 3, '00AA00', 1, '', '', ''); @@ -413,9 +406,9 @@ INSERT INTO phpbb_groups (group_name, group_type, group_colour, group_legend, gr # -- User -> Group INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (1, 1, 0, 0); +INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (2, 2, 0, 0); INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (4, 2, 0, 0); -INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (6, 2, 0, 0); -INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (7, 2, 0, 1); +INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (5, 2, 0, 1); # -- Ranks INSERT INTO phpbb_ranks (rank_title, rank_min, rank_special, rank_image) VALUES ('Site Admin', 0, 1, ''); @@ -455,7 +448,7 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 10, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%'; # Standard Moderator (m_) -INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 11, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option NOT IN ('m_approve', 'm_ban', 'm_chgposter', 'm_delete'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 11, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option NOT IN ('m_ban', 'm_chgposter'); # Simple Moderator (m_) INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 12, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option IN ('m_', 'm_approve', 'm_delete', 'm_edit', 'm_info', 'm_report', 'm_warn'); @@ -488,61 +481,62 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT # Standard Access + Polls (f_) INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 21, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_delete', 'f_ignoreflood', 'f_sticky', 'f_user_lock'); +# Limited Access + Polls (f_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 22, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_sticky', 'f_user_lock', 'f_votechg'); # Permissions +# GUESTS - u_download and u_search ability +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) SELECT 1, 0, auth_option_id, 0, 1 FROM phpbb_acl_options WHERE auth_option IN ('u_', 'u_download', 'u_search'); + # Admin user - full user features INSERT INTO phpbb_acl_users (user_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 0, 0, 5, 0); # ADMINISTRATOR Group - full user features -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (7, 0, 0, 5, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 0, 0, 5, 0); # ADMINISTRATOR Group - standard admin -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (7, 0, 0, 1, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 0, 0, 1, 0); # REGISTERED and REGISTERED_COPPA having standard user features -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 0, 0, 6, 0); -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 0, 0, 6, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 0, 0, 6, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (3, 0, 0, 6, 0); # GLOBAL_MODERATORS having full user features -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (6, 0, 0, 5, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 0, 0, 5, 0); # GLOBAL_MODERATORS having full global moderator access -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (6, 0, 0, 10, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 0, 0, 10, 0); # Giving all groups read only access to the first category # since administrators and moderators are already within the registered users group we do not need to set them here INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (1, 1, 0, 17, 0); INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 1, 0, 17, 0); INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (3, 1, 0, 17, 0); -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 1, 0, 17, 0); -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 1, 0, 17, 0); -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (8, 1, 0, 17, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (6, 1, 0, 17, 0); # Giving access to the first forum -# guests, inactive and inactive_coppa having read only access +# guests having read only access INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (1, 2, 0, 17, 0); -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 2, 0, 17, 0); -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (3, 2, 0, 17, 0); # registered and registered_coppa having standard access -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 2, 0, 15, 0); -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 2, 0, 15, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 2, 0, 15, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (3, 2, 0, 15, 0); # global moderators having standard access + polls -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (6, 2, 0, 21, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 2, 0, 21, 0); # administrators having full forum and full moderator access -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (7, 2, 0, 14, 0); -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (7, 2, 0, 10, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 2, 0, 14, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 2, 0, 10, 0); # Bots having bot access -INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (8, 2, 0, 19, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (6, 2, 0, 19, 0); # -- Demo Topic -INSERT INTO phpbb_topics (topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_replies_real, forum_id, topic_status, topic_type, topic_first_post_id, topic_first_poster_name, topic_last_post_id, topic_last_poster_id, topic_last_poster_name, topic_last_post_time, topic_last_view_time, poll_title) VALUES ('Welcome to phpBB 3', 2, 972086460, 0, 0, 0, 2, 0, 0, 1, 'Admin', 1, 2, 'Admin', 972086460, 972086460, ''); +INSERT INTO phpbb_topics (topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_replies_real, forum_id, topic_status, topic_type, topic_first_post_id, topic_first_poster_name, topic_first_poster_colour, topic_last_post_id, topic_last_poster_id, topic_last_poster_name, topic_last_poster_colour, topic_last_post_subject, topic_last_post_time, topic_last_view_time, poll_title) VALUES ('Welcome to phpBB 3', 2, 972086460, 0, 0, 0, 2, 0, 0, 1, 'Admin', 'AA0000', 1, 2, 'Admin', 'AA0000', 'Welcome to phpBB 3', 972086460, 972086460, ''); # -- Demo Post INSERT INTO phpbb_posts (topic_id, forum_id, poster_id, icon_id, post_time, post_username, poster_ip, post_subject, post_text, post_checksum, bbcode_uid) VALUES (1, 2, 2, 1, 972086460, '', '127.0.0.1', 'Welcome to phpBB 3', 'This is an example post in your phpBB 3.0 installation. You may delete this post, this topic and even this forum if you like since everything seems to be working!', '5dd683b17f641daf84c040bfefc58ce9', ''); @@ -630,8 +624,11 @@ INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mo INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Archives', 0, 1, 1, '', 0, ''); INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Plain Text', 0, 0, 1, '', 0, ''); INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Documents', 0, 0, 1, '', 0, ''); -INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Real Media', 3, 0, 2, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Real Media', 3, 0, 1, '', 0, ''); INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Windows Media', 2, 0, 1, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Flash Files', 5, 0, 1, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Quicktime Media', 6, 0, 1, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('Downloadable Files', 0, 0, 1, '', 0, ''); # -- extensions INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'gif'); @@ -639,19 +636,32 @@ INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'png'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'jpeg'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'jpg'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'tif'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'tiff'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'tga'); + INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'gtar'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'gz'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'tar'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'zip'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'rar'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'ace'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'torrent'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'tgz'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'bz2'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, '7z'); + INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'txt'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'c'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'h'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'cpp'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'hpp'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'diz'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'csv'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'ini'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'log'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'js'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'xml'); + INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'xls'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'doc'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'dot'); @@ -659,8 +669,32 @@ INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'pdf'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ai'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ps'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ppt'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'odg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'odp'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ods'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'odt'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'rtf'); + INSERT INTO phpbb_extensions (group_id, extension) VALUES (5, 'rm'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (5, 'ram'); + INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'wma'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'wmv'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (7, 'swf'); + +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'mov'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'm4v'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'm4a'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'mp4'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, '3gp'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, '3g2'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'qt'); + +INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mpeg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mpg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mp3'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogm'); + # POSTGRES COMMIT #
\ No newline at end of file diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 112c502803..916c9bb5e6 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -13,6 +13,7 @@ CREATE TABLE phpbb_attachments ( topic_id INTEGER UNSIGNED NOT NULL DEFAULT '0', in_message INTEGER UNSIGNED NOT NULL DEFAULT '0', poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0', + is_orphan INTEGER UNSIGNED NOT NULL DEFAULT '1', physical_filename varchar(255) NOT NULL DEFAULT '', real_filename varchar(255) NOT NULL DEFAULT '', download_count INTEGER UNSIGNED NOT NULL DEFAULT '0', @@ -28,7 +29,7 @@ CREATE INDEX phpbb_attachments_filetime ON phpbb_attachments (filetime); CREATE INDEX phpbb_attachments_post_msg_id ON phpbb_attachments (post_msg_id); CREATE INDEX phpbb_attachments_topic_id ON phpbb_attachments (topic_id); CREATE INDEX phpbb_attachments_poster_id ON phpbb_attachments (poster_id); -CREATE INDEX phpbb_attachments_filesize ON phpbb_attachments (filesize); +CREATE INDEX phpbb_attachments_is_orphan ON phpbb_attachments (is_orphan); # Table: 'phpbb_acl_groups' CREATE TABLE phpbb_acl_groups ( @@ -145,7 +146,7 @@ CREATE INDEX phpbb_bots_bot_active ON phpbb_bots (bot_active); # Table: 'phpbb_config' CREATE TABLE phpbb_config ( - config_name varchar(252) NOT NULL DEFAULT '', + config_name varchar(255) NOT NULL DEFAULT '', config_value varchar(255) NOT NULL DEFAULT '', is_dynamic INTEGER UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (config_name) @@ -167,7 +168,7 @@ CREATE INDEX phpbb_confirm_confirm_type ON phpbb_confirm (confirm_type); # Table: 'phpbb_disallow' CREATE TABLE phpbb_disallow ( disallow_id INTEGER PRIMARY KEY NOT NULL , - disallow_username varchar(252) NOT NULL DEFAULT '' + disallow_username varchar(255) NOT NULL DEFAULT '' ); @@ -215,8 +216,8 @@ CREATE TABLE phpbb_forums ( forum_parents mediumtext(16777215) NOT NULL DEFAULT '', forum_name text(65535) NOT NULL DEFAULT '', forum_desc text(65535) NOT NULL DEFAULT '', - forum_desc_bitfield varchar(252) NOT NULL DEFAULT '', - forum_desc_options INTEGER UNSIGNED NOT NULL DEFAULT '0', + forum_desc_bitfield varchar(255) NOT NULL DEFAULT '', + forum_desc_options INTEGER UNSIGNED NOT NULL DEFAULT '7', forum_desc_uid varchar(5) NOT NULL DEFAULT '', forum_link varchar(255) NOT NULL DEFAULT '', forum_password varchar(40) NOT NULL DEFAULT '', @@ -224,8 +225,8 @@ CREATE TABLE phpbb_forums ( forum_image varchar(255) NOT NULL DEFAULT '', forum_rules text(65535) NOT NULL DEFAULT '', forum_rules_link varchar(255) NOT NULL DEFAULT '', - forum_rules_bitfield varchar(252) NOT NULL DEFAULT '', - forum_rules_options INTEGER UNSIGNED NOT NULL DEFAULT '0', + forum_rules_bitfield varchar(255) NOT NULL DEFAULT '', + forum_rules_options INTEGER UNSIGNED NOT NULL DEFAULT '7', forum_rules_uid varchar(5) NOT NULL DEFAULT '', forum_topics_per_page tinyint(4) NOT NULL DEFAULT '0', forum_type tinyint(4) NOT NULL DEFAULT '0', @@ -235,8 +236,10 @@ CREATE TABLE phpbb_forums ( forum_topics_real INTEGER UNSIGNED NOT NULL DEFAULT '0', forum_last_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0', forum_last_poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0', + forum_last_post_subject text(65535) NOT NULL DEFAULT '', forum_last_post_time INTEGER UNSIGNED NOT NULL DEFAULT '0', forum_last_poster_name varchar(255) NOT NULL DEFAULT '', + forum_last_poster_colour varchar(6) NOT NULL DEFAULT '', forum_flags tinyint(4) NOT NULL DEFAULT '32', display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1', enable_indexing INTEGER UNSIGNED NOT NULL DEFAULT '1', @@ -284,10 +287,10 @@ CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch (notify_status CREATE TABLE phpbb_groups ( group_id INTEGER PRIMARY KEY NOT NULL , group_type tinyint(4) NOT NULL DEFAULT '1', - group_name varchar(252) NOT NULL DEFAULT '', + group_name varchar(255) NOT NULL DEFAULT '', group_desc text(65535) NOT NULL DEFAULT '', - group_desc_bitfield varchar(252) NOT NULL DEFAULT '', - group_desc_options INTEGER UNSIGNED NOT NULL DEFAULT '0', + group_desc_bitfield varchar(255) NOT NULL DEFAULT '', + group_desc_options INTEGER UNSIGNED NOT NULL DEFAULT '7', group_desc_uid varchar(5) NOT NULL DEFAULT '', group_display INTEGER UNSIGNED NOT NULL DEFAULT '0', group_avatar varchar(255) NOT NULL DEFAULT '', @@ -352,7 +355,7 @@ CREATE INDEX phpbb_log_user_id ON phpbb_log (user_id); CREATE TABLE phpbb_moderator_cache ( forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0', user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', - username varchar(252) NOT NULL DEFAULT '', + username varchar(255) NOT NULL DEFAULT '', group_id INTEGER UNSIGNED NOT NULL DEFAULT '0', group_name varchar(255) NOT NULL DEFAULT '', display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1' @@ -418,13 +421,12 @@ CREATE TABLE phpbb_posts ( enable_smilies INTEGER UNSIGNED NOT NULL DEFAULT '1', enable_magic_url INTEGER UNSIGNED NOT NULL DEFAULT '1', enable_sig INTEGER UNSIGNED NOT NULL DEFAULT '1', - post_username varchar(252) NOT NULL DEFAULT '', + post_username varchar(255) NOT NULL DEFAULT '', post_subject text(65535) NOT NULL DEFAULT '', post_text mediumtext(16777215) NOT NULL DEFAULT '', post_checksum varchar(32) NOT NULL DEFAULT '', - post_encoding varchar(20) NOT NULL DEFAULT 'iso-8859-1', post_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0', - bbcode_bitfield varchar(252) NOT NULL DEFAULT '', + bbcode_bitfield varchar(255) NOT NULL DEFAULT '', bbcode_uid varchar(5) NOT NULL DEFAULT '', post_postcount INTEGER UNSIGNED NOT NULL DEFAULT '1', post_edit_time INTEGER UNSIGNED NOT NULL DEFAULT '0', @@ -439,8 +441,7 @@ CREATE INDEX phpbb_posts_topic_id ON phpbb_posts (topic_id); CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip); CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id); CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved); -CREATE INDEX phpbb_posts_post_postcount ON phpbb_posts (post_postcount); -CREATE INDEX phpbb_posts_post_time ON phpbb_posts (post_time); +CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time); # Table: 'phpbb_privmsgs' CREATE TABLE phpbb_privmsgs ( @@ -458,9 +459,8 @@ CREATE TABLE phpbb_privmsgs ( message_text mediumtext(16777215) NOT NULL DEFAULT '', message_edit_reason text(65535) NOT NULL DEFAULT '', message_edit_user INTEGER UNSIGNED NOT NULL DEFAULT '0', - message_encoding varchar(20) NOT NULL DEFAULT 'iso-8859-1', message_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0', - bbcode_bitfield varchar(252) NOT NULL DEFAULT '', + bbcode_bitfield varchar(255) NOT NULL DEFAULT '', bbcode_uid varchar(5) NOT NULL DEFAULT '', message_edit_time INTEGER UNSIGNED NOT NULL DEFAULT '0', message_edit_count INTEGER UNSIGNED NOT NULL DEFAULT '0', @@ -613,7 +613,7 @@ CREATE TABLE phpbb_search_results ( # Table: 'phpbb_search_wordlist' CREATE TABLE phpbb_search_wordlist ( word_id INTEGER PRIMARY KEY NOT NULL , - word_text nvarchar(252) NOT NULL DEFAULT '', + word_text varchar(255) NOT NULL DEFAULT '', word_common INTEGER UNSIGNED NOT NULL DEFAULT '0' ); @@ -674,8 +674,8 @@ CREATE TABLE phpbb_smilies ( code varchar(50) NOT NULL DEFAULT '', emotion varchar(50) NOT NULL DEFAULT '', smiley_url varchar(50) NOT NULL DEFAULT '', - smiley_width tinyint(4) NOT NULL DEFAULT '0', - smiley_height tinyint(4) NOT NULL DEFAULT '0', + smiley_width INTEGER UNSIGNED NOT NULL DEFAULT '0', + smiley_height INTEGER UNSIGNED NOT NULL DEFAULT '0', smiley_order INTEGER UNSIGNED NOT NULL DEFAULT '0', display_on_posting INTEGER UNSIGNED NOT NULL DEFAULT '1' ); @@ -685,7 +685,7 @@ CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting) # Table: 'phpbb_styles' CREATE TABLE phpbb_styles ( style_id INTEGER PRIMARY KEY NOT NULL , - style_name varchar(252) NOT NULL DEFAULT '', + style_name varchar(255) NOT NULL DEFAULT '', style_copyright varchar(255) NOT NULL DEFAULT '', style_active INTEGER UNSIGNED NOT NULL DEFAULT '1', template_id tinyint(4) NOT NULL DEFAULT '0', @@ -701,10 +701,10 @@ CREATE INDEX phpbb_styles_imageset_id ON phpbb_styles (imageset_id); # Table: 'phpbb_styles_template' CREATE TABLE phpbb_styles_template ( template_id INTEGER PRIMARY KEY NOT NULL , - template_name varchar(252) NOT NULL DEFAULT '', + template_name varchar(255) NOT NULL DEFAULT '', template_copyright varchar(255) NOT NULL DEFAULT '', template_path varchar(100) NOT NULL DEFAULT '', - bbcode_bitfield varchar(252) NOT NULL DEFAULT 'kNg=', + bbcode_bitfield varchar(255) NOT NULL DEFAULT 'kNg=', template_storedb INTEGER UNSIGNED NOT NULL DEFAULT '0' ); @@ -725,7 +725,7 @@ CREATE INDEX phpbb_styles_template_data_tfn ON phpbb_styles_template_data (templ # Table: 'phpbb_styles_theme' CREATE TABLE phpbb_styles_theme ( theme_id INTEGER PRIMARY KEY NOT NULL , - theme_name varchar(252) NOT NULL DEFAULT '', + theme_name varchar(255) NOT NULL DEFAULT '', theme_copyright varchar(255) NOT NULL DEFAULT '', theme_path varchar(100) NOT NULL DEFAULT '', theme_storedb INTEGER UNSIGNED NOT NULL DEFAULT '0', @@ -738,7 +738,7 @@ CREATE UNIQUE INDEX phpbb_styles_theme_theme_name ON phpbb_styles_theme (theme_n # Table: 'phpbb_styles_imageset' CREATE TABLE phpbb_styles_imageset ( imageset_id INTEGER PRIMARY KEY NOT NULL , - imageset_name varchar(252) NOT NULL DEFAULT '', + imageset_name varchar(255) NOT NULL DEFAULT '', imageset_copyright varchar(255) NOT NULL DEFAULT '', imageset_path varchar(100) NOT NULL DEFAULT '', site_logo varchar(200) NOT NULL DEFAULT '', @@ -858,9 +858,12 @@ CREATE TABLE phpbb_topics ( topic_type tinyint(3) NOT NULL DEFAULT '0', topic_first_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0', topic_first_poster_name varchar(255) NOT NULL DEFAULT '', + topic_first_poster_colour varchar(6) NOT NULL DEFAULT '', topic_last_post_id INTEGER UNSIGNED NOT NULL DEFAULT '0', topic_last_poster_id INTEGER UNSIGNED NOT NULL DEFAULT '0', topic_last_poster_name varchar(255) NOT NULL DEFAULT '', + topic_last_poster_colour varchar(6) NOT NULL DEFAULT '', + topic_last_post_subject text(65535) NOT NULL DEFAULT '', topic_last_post_time INTEGER UNSIGNED NOT NULL DEFAULT '0', topic_last_view_time INTEGER UNSIGNED NOT NULL DEFAULT '0', topic_moved_id INTEGER UNSIGNED NOT NULL DEFAULT '0', @@ -877,6 +880,7 @@ CREATE TABLE phpbb_topics ( CREATE INDEX phpbb_topics_forum_id ON phpbb_topics (forum_id); CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics (forum_id, topic_type); CREATE INDEX phpbb_topics_last_post_time ON phpbb_topics (topic_last_post_time); +CREATE INDEX phpbb_topics_topic_approved ON phpbb_topics (topic_approved); CREATE INDEX phpbb_topics_fid_time_moved ON phpbb_topics (forum_id, topic_last_post_time, topic_moved_id); # Table: 'phpbb_topics_track' @@ -931,7 +935,8 @@ CREATE TABLE phpbb_users ( user_perm_from INTEGER UNSIGNED NOT NULL DEFAULT '0', user_ip varchar(40) NOT NULL DEFAULT '', user_regdate INTEGER UNSIGNED NOT NULL DEFAULT '0', - username varchar(252) NOT NULL DEFAULT '', + username varchar(255) NOT NULL DEFAULT '', + username_clean varchar(255) NOT NULL DEFAULT '', user_password varchar(40) NOT NULL DEFAULT '', user_passchg INTEGER UNSIGNED NOT NULL DEFAULT '0', user_email varchar(100) NOT NULL DEFAULT '', @@ -946,6 +951,8 @@ CREATE TABLE phpbb_users ( user_warnings tinyint(4) NOT NULL DEFAULT '0', user_last_warning INTEGER UNSIGNED NOT NULL DEFAULT '0', user_login_attempts tinyint(4) NOT NULL DEFAULT '0', + user_inactive_reason tinyint(2) NOT NULL DEFAULT '0', + user_inactive_time INTEGER UNSIGNED NOT NULL DEFAULT '0', user_posts INTEGER UNSIGNED NOT NULL DEFAULT '0', user_lang varchar(30) NOT NULL DEFAULT '', user_timezone decimal(5,2) NOT NULL DEFAULT '0', @@ -970,18 +977,17 @@ CREATE TABLE phpbb_users ( user_notify_pm INTEGER UNSIGNED NOT NULL DEFAULT '1', user_notify_type tinyint(4) NOT NULL DEFAULT '0', user_allow_pm INTEGER UNSIGNED NOT NULL DEFAULT '1', - user_allow_email INTEGER UNSIGNED NOT NULL DEFAULT '1', user_allow_viewonline INTEGER UNSIGNED NOT NULL DEFAULT '1', user_allow_viewemail INTEGER UNSIGNED NOT NULL DEFAULT '1', user_allow_massemail INTEGER UNSIGNED NOT NULL DEFAULT '1', user_options INTEGER UNSIGNED NOT NULL DEFAULT '893', user_avatar varchar(255) NOT NULL DEFAULT '', user_avatar_type tinyint(2) NOT NULL DEFAULT '0', - user_avatar_width tinyint(4) NOT NULL DEFAULT '0', - user_avatar_height tinyint(4) NOT NULL DEFAULT '0', + user_avatar_width INTEGER UNSIGNED NOT NULL DEFAULT '0', + user_avatar_height INTEGER UNSIGNED NOT NULL DEFAULT '0', user_sig mediumtext(16777215) NOT NULL DEFAULT '', user_sig_bbcode_uid varchar(5) NOT NULL DEFAULT '', - user_sig_bbcode_bitfield varchar(252) NOT NULL DEFAULT '', + user_sig_bbcode_bitfield varchar(255) NOT NULL DEFAULT '', user_from varchar(100) NOT NULL DEFAULT '', user_icq varchar(15) NOT NULL DEFAULT '', user_aim varchar(255) NOT NULL DEFAULT '', @@ -998,7 +1004,7 @@ CREATE TABLE phpbb_users ( CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday); CREATE INDEX phpbb_users_user_email_hash ON phpbb_users (user_email_hash); CREATE INDEX phpbb_users_user_type ON phpbb_users (user_type); -CREATE INDEX phpbb_users_username ON phpbb_users (username); +CREATE INDEX phpbb_users_username_clean ON phpbb_users (username_clean); # Table: 'phpbb_warnings' CREATE TABLE phpbb_warnings ( diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php index 4d49e1c8c3..4f8167f13a 100644 --- a/phpBB/language/en/acp/attachments.php +++ b/phpBB/language/en/acp/attachments.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -29,76 +31,80 @@ if (empty($lang) || !is_array($lang)) // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine $lang = array_merge($lang, array( - 'ACP_ATTACHMENT_SETTINGS_EXPLAIN' => 'Here you can configure the Main Settings for Attachments and the associated Special Categories.', - 'ACP_EXTENSION_GROUPS_EXPLAIN' => 'Here you can add, delete and modify your Extension Groups, you can disable Extension Groups, assign a special Category to them, change the download mechanism and you can define an Upload Icon which will be displayed in front of an Attachment belonging to the Group.', - 'ACP_MANAGE_EXTENSIONS_EXPLAIN' => 'Here you can manage your allowed extensions. To activate your Extensions, please refer to the extension groups management panel. We strongly recommend not to allow scripting extensions (such as php, php3, php4, phtml, pl, cgi, asp, aspx...)', - 'ACP_ORPHAN_ATTACHMENTS_EXPLAIN' => 'Here you are able to see files within the Attachments upload directory but not assigned to posts. This happens mostly if users are attaching files but not submitting the post. You are able to delete the files or attach them to existing posts. Attaching to posts requires a valid post id, you have to determine this id by yourself, this feature is mainly for those people wanting to upload files with another program and assigning those (mostly large) files to an existing post.', + 'ACP_ATTACHMENT_SETTINGS_EXPLAIN' => 'Here you can configure the main settings for attachments and the associated special categories.', + 'ACP_EXTENSION_GROUPS_EXPLAIN' => 'Here you can add, delete, modify or disable your extension groups. Further options include the assignment of a special category to them, changing the download mechanism and defining an upload icon which will be displayed in front of the attachment which belongs to the group.', + 'ACP_MANAGE_EXTENSIONS_EXPLAIN' => 'Here you can manage your allowed extensions. To activate your extensions, please refer to the extension groups management panel. We strongly recommend not to allow scripting extensions (such as <code>php</code>, <code>php3</code>, <code>php4</code>, <code>phtml</code>, <code>pl</code>, <code>cgi</code>, <code>py</code>, <code>rb</code>, <code>asp</code>, <code>aspx</code>, and so forth…)', + 'ACP_ORPHAN_ATTACHMENTS_EXPLAIN' => 'Here you are able to see files within the attachments upload directory but not assigned to posts. This happens mostly if users are attaching files but not submitting the post. You are able to delete the files or attach them to existing posts. Attaching to posts requires a valid post ID, you have to determine this id by yourself, this feature is mainly for those people wanting to upload files with another program and assigning those (mostly large) files to an existing post.', 'ADD_EXTENSION' => 'Add extension', - 'ADD_EXTENSION_GROUP' => 'Add Extension Group', + 'ADD_EXTENSION_GROUP' => 'Add extension group', 'ADMIN_UPLOAD_ERROR' => 'Errors while trying to attach file: %s', - 'ALLOWED_FORUMS' => 'Allowed Forums', + 'ALLOWED_FORUMS' => 'Allowed forums', 'ALLOWED_FORUMS_EXPLAIN' => 'Able to post the assigned extensions at the selected (or all if selected) forums', - 'ALLOW_ATTACHMENTS' => 'Allow Attachments', - 'ALLOW_ALL_FORUMS' => 'Allow All Forums', + 'ALLOW_ATTACHMENTS' => 'Allow attachments', + 'ALLOW_ALL_FORUMS' => 'Allow all forums', 'ALLOW_IN_PM' => 'Allowed in private messaging', - 'ALLOW_PM_ATTACHMENTS' => 'Allow Attachments in Private Messages', - 'ALLOW_SELECTED_FORUMS' => 'Only Forums selected below', - 'ASSIGNED_EXTENSIONS' => 'Assigned Extensions', - 'ASSIGNED_GROUP' => 'Assigned Group', + 'ALLOW_PM_ATTACHMENTS' => 'Allow attachments in private messages', + 'ALLOW_SELECTED_FORUMS' => 'Only forums selected below', + 'ASSIGNED_EXTENSIONS' => 'Assigned extensions', + 'ASSIGNED_GROUP' => 'Assigned extension group', 'ATTACH_EXTENSIONS_URL' => 'Extensions', - 'ATTACH_EXT_GROUPS_URL' => 'Extension Groups', + 'ATTACH_EXT_GROUPS_URL' => 'Extension groups', 'ATTACH_MAX_FILESIZE' => 'Maximum filesize', 'ATTACH_MAX_FILESIZE_EXPLAIN' => 'Maximum size of each file, 0 is unlimited.', 'ATTACH_MAX_PM_FILESIZE' => 'Maximum filesize messaging', 'ATTACH_MAX_PM_FILESIZE_EXPLAIN' => 'Maximum drive space available per user for private message attachments, 0 is unlimited.', - 'ATTACH_ORPHAN_URL' => 'Orphan Attachments', + 'ATTACH_ORPHAN_URL' => 'Orphan attachments', 'ATTACH_POST_ID' => 'Post ID', 'ATTACH_QUOTA' => 'Total attachment quota', 'ATTACH_QUOTA_EXPLAIN' => 'Maximum drive space available for attachments in total, 0 is unlimited.', 'ATTACH_TO_POST' => 'Attach file to post', + 'CAT_FLASH_FILES' => 'Flash Files', 'CAT_IMAGES' => 'Images', + 'CAT_QUICKTIME_FILES' => 'Quicktime Media', 'CAT_RM_FILES' => 'Real Media Streams', - 'CAT_WM_FILES' => 'Win Media Streams', + 'CAT_WM_FILES' => 'Window Media Streams', 'CREATE_GROUP' => 'Create new group', 'CREATE_THUMBNAIL' => 'Create thumbnail', 'CREATE_THUMBNAIL_EXPLAIN' => 'Create a thumbnail in all possible situations.', - 'DEFINE_ALLOWED_IPS' => 'Define allowed IPs/Hostnames', - 'DEFINE_DISALLOWED_IPS' => 'Define disallowed IPs/Hostnames', - 'DOWNLOAD_ADD_IPS_EXPLAIN' => 'To specify several different IP\'s or hostnames enter each on a new line. To specify a range of IP addresses separate the start and end with a hyphen (-), to specify a wildcard use *', - 'DOWNLOAD_MODE' => 'Download Mode', - 'DOWNLOAD_MODE_EXPLAIN' => 'If you experience problems downloading files, set this to "physical", the user will be directed to the file directly. Do not set it to physical if not really needed, it discloses the filename.', - 'DOWNLOAD_REMOVE_IPS_EXPLAIN' => 'You can remove (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IP\'s have a blue background.', + 'DEFINE_ALLOWED_IPS' => 'Define allowed IPs/hostnames', + 'DEFINE_DISALLOWED_IPS' => 'Define disallowed IPs/hostnames', + 'DOWNLOAD_ADD_IPS_EXPLAIN' => 'To specify several different IPs or hostnames enter each on a new line. To specify a range of IP addresses separate the start and end with a hyphen (-), to specify a wildcard use *', + 'DOWNLOAD_MODE' => 'Download mode', + 'DOWNLOAD_MODE_EXPLAIN' => 'If you experience problems downloading files, set this to “physicalâ€, the user will be directed to the file directly. Do not set it to physical if not really needed, it discloses the filename.', + 'DOWNLOAD_REMOVE_IPS_EXPLAIN' => 'You can remove (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IPs have a blue background.', 'DISPLAY_INLINED' => 'Display images inline', 'DISPLAY_INLINED_EXPLAIN' => 'If set to No image attachments will show as a link.', - 'DISPLAY_ORDER' => 'Attachment Display Order', + 'DISPLAY_ORDER' => 'Attachment display order', 'DISPLAY_ORDER_EXPLAIN' => 'Display attachments ordered by time.', - 'EDIT_EXTENSION_GROUP' => 'Edit Extension Group', - 'EXCLUDE_ENTERED_IP' => 'Enable this to exclude the entered IP/Hostname.', - 'EXCLUDE_FROM_ALLOWED_IP' => 'Exclude IP from allowed IPs/Hostnames', - 'EXCLUDE_FROM_DISALLOWED_IP' => 'Exclude IP from disallowed IPs/Hostnames', + 'EDIT_EXTENSION_GROUP' => 'Edit extension group', + 'EXCLUDE_ENTERED_IP' => 'Enable this to exclude the entered IP/hostname.', + 'EXCLUDE_FROM_ALLOWED_IP' => 'Exclude IP from allowed IPs/hostnames', + 'EXCLUDE_FROM_DISALLOWED_IP' => 'Exclude IP from disallowed IPs/hostnames', 'EXTENSIONS_UPDATED' => 'Extensions successfully updated', - 'EXTENSION_EXIST' => 'The Extension %s already exist', - 'EXTENSION_GROUP' => 'Extension Group', - 'EXTENSION_GROUPS' => 'Extension Groups', - 'EXTENSION_GROUP_DELETED' => 'Extension Group successfully deleted', - 'EXTENSION_GROUP_EXIST' => 'The Extension Group %s already exist', + 'EXTENSION_EXIST' => 'The extension %s already exist', + 'EXTENSION_GROUP' => 'Extension group', + 'EXTENSION_GROUPS' => 'Extension groups', + 'EXTENSION_GROUP_DELETED' => 'Extension group successfully deleted.', + 'EXTENSION_GROUP_EXIST' => 'The extension group %s already exist', - 'GO_TO_EXTENSIONS' => 'Go to Extension Management Screen', + 'GO_TO_EXTENSIONS' => 'Go to extension management screen', 'GROUP_NAME' => 'Group name', - 'IMAGE_LINK_SIZE' => 'Image Link Dimensions', + 'IMAGE_LINK_SIZE' => 'Image link dimensions', 'IMAGE_LINK_SIZE_EXPLAIN' => 'Display image attachment as link if image is larger than this, set to 0px by 0px to disable.', 'IMAGICK_PATH' => 'Imagemagick path', - 'IMAGICK_PATH_EXPLAIN' => 'Full path to the imagemagick convert application, e.g. /usr/bin/', + 'IMAGICK_PATH_EXPLAIN' => 'Full path to the imagemagick convert application, e.g. <samp>/usr/bin/</samp>', 'MAX_ATTACHMENTS' => 'Max attachments per post', 'MAX_ATTACHMENTS_PM' => 'Max attachments per message', - 'MAX_EXTGROUP_FILESIZE' => 'Maximum Filesize', - 'MAX_IMAGE_SIZE' => 'Maximum Image Dimensions', + 'MAX_EXTGROUP_FILESIZE' => 'Maximum filesize', + 'MAX_IMAGE_SIZE' => 'Maximum image dimensions', 'MAX_IMAGE_SIZE_EXPLAIN' => 'Maximum size of image attachments, 0px by 0px disables image attachments.', + 'MAX_THUMB_WIDTH' => 'Maximum thumbnail width in pixel', + 'MAX_THUMB_WIDTH_EXPLAIN' => 'A generated thumbnail will not exceed the width set here', 'MIN_THUMB_FILESIZE' => 'Minimum thumbnail filesize', 'MIN_THUMB_FILESIZE_EXPLAIN' => 'Do not create a thumbnail for images smaller than this.', 'MODE_INLINE' => 'Inline', @@ -107,10 +113,10 @@ $lang = array_merge($lang, array( 'NOT_ALLOWED_IN_PM' => 'Not allowed in private messages', 'NOT_ASSIGNED' => 'Not assigned', 'NO_EXT_GROUP' => 'None', - 'NO_EXT_GROUP_NAME' => 'No Group Name entered', - 'NO_EXT_GROUP_SPECIFIED' => 'No Extension Group specified', + 'NO_EXT_GROUP_NAME' => 'No group name entered', + 'NO_EXT_GROUP_SPECIFIED' => 'No extension group specified.', 'NO_FILE_CAT' => 'None', - 'NO_IMAGE' => 'No Image', + 'NO_IMAGE' => 'No image', 'NO_THUMBNAIL_SUPPORT' => 'Thumbnail support has been disabled because there is no supported GD library available and the imagemagick executable could not be found.', 'NO_UPLOAD_DIR' => 'The upload directory you specified does not exist.', 'NO_WRITE_UPLOAD' => 'The upload directory you specified cannot be written to. Please alter the permissions to allow the webserver to write to it.', @@ -118,31 +124,31 @@ $lang = array_merge($lang, array( 'ORDER_ALLOW_DENY' => 'Allow', 'ORDER_DENY_ALLOW' => 'Deny', - 'REMOVE_ALLOWED_IPS' => 'Remove or Un-exclude allowed IPs/Hostnames', - 'REMOVE_DISALLOWED_IPS' => 'Remove or Un-exclude disallowed IPs/Hostnames', + 'REMOVE_ALLOWED_IPS' => 'Remove or un-exclude allowed IPs/hostnames', + 'REMOVE_DISALLOWED_IPS' => 'Remove or un-exclude disallowed IPs/hostnames', 'SEARCH_IMAGICK' => 'Search for Imagemagick', - 'SECURE_ALLOW_DENY' => 'Allow/Deny List', + 'SECURE_ALLOW_DENY' => 'Allow/Deny list', 'SECURE_ALLOW_DENY_EXPLAIN' => 'Allow or Deny the list of addresses, this setting only applies to downloading files', 'SECURE_DOWNLOADS' => 'Enable secure downloads', - 'SECURE_DOWNLOADS_EXPLAIN' => 'With this option enabled, downloads are limited to IP\'s/hostnames you defined.', + 'SECURE_DOWNLOADS_EXPLAIN' => 'With this option enabled, downloads are limited to IP’s/hostnames you defined.', 'SECURE_DOWNLOAD_NOTICE' => 'Secure Downloads are not enabled. The settings below will be applied after enabling secure downloads.', - 'SECURE_DOWNLOAD_UPDATE_SUCCESS'=> 'The IP list has been updated successfully', + 'SECURE_DOWNLOAD_UPDATE_SUCCESS'=> 'The IP list has been updated successfully.', 'SECURE_EMPTY_REFERRER' => 'Allow empty referrer', 'SECURE_EMPTY_REFERRER_EXPLAIN' => 'Secure downloads are based on referrers. Do you want to allow downloads for those ommitting the referrer?', 'SETTINGS_CAT_IMAGES' => 'Image category settings', 'SPECIAL_CATEGORY' => 'Special Category', 'SPECIAL_CATEGORY_EXPLAIN' => 'Special Categories differ between the way presented within posts.', 'SUCCESSFULLY_UPLOADED' => 'Succeessfully uploaded', - 'SUCCESS_EXTENSION_GROUP_ADD' => 'Extension Group successfully added', - 'SUCCESS_EXTENSION_GROUP_EDIT' => 'Extension Group successfully updated', + 'SUCCESS_EXTENSION_GROUP_ADD' => 'Extension group successfully added', + 'SUCCESS_EXTENSION_GROUP_EDIT' => 'Extension group successfully updated', - 'UPLOADING_FILES' => 'Uploading Files', - 'UPLOADING_FILE_TO' => 'Uploading File "%1$s" to Post Number %2$d...', - 'UPLOAD_DENIED_FORUM' => 'You do not have the permission to upload files to forum "%s"', - 'UPLOAD_DIR' => 'Upload Directory', - 'UPLOAD_DIR_EXPLAIN' => 'Storage Path for Attachments.', - 'UPLOAD_ICON' => 'Upload Icon', + 'UPLOADING_FILES' => 'Uploading files', + 'UPLOADING_FILE_TO' => 'Uploading file “%1$s†to Post Number %2$d…', + 'UPLOAD_DENIED_FORUM' => 'You do not have the permission to upload files to forum “%sâ€', + 'UPLOAD_DIR' => 'Upload directory', + 'UPLOAD_DIR_EXPLAIN' => 'Storage path for attachments.', + 'UPLOAD_ICON' => 'Upload icon', 'UPLOAD_NOT_DIR' => 'The upload location you specified does not appear to be a directory.', )); diff --git a/phpBB/language/en/acp/ban.php b/phpBB/language/en/acp/ban.php index 51df843158..278171ccdd 100644 --- a/phpBB/language/en/acp/ban.php +++ b/phpBB/language/en/acp/ban.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -30,9 +32,9 @@ if (empty($lang) || !is_array($lang)) // Banning $lang = array_merge($lang, array( - '1_HOUR' => '1 Hour', - '30_MINS' => '30 Minutes', - '6_HOURS' => '6 Hours', + '1_HOUR' => '1 hour', + '30_MINS' => '30 minutes', + '6_HOURS' => '6 hours', 'ACP_BAN_EXPLAIN' => 'Here you can control the banning of users by name, IP or email address. These methods prevent a user reaching any part of the board. You can give a short (255 character) reason for the ban if you wish. This will be displayed in the admin log. The length of a ban can also be specified. If you want the ban to end on a specific date rather than after a set time period select <u>Until</u> for the ban length and enter a date in yyyy-mm-dd format.', @@ -40,29 +42,29 @@ $lang = array_merge($lang, array( 'BAN_LENGTH' => 'Length of ban', 'BAN_REASON' => 'Reason for ban', 'BAN_GIVE_REASON' => 'Reason shown to the banned', - 'BAN_UPDATE_SUCCESSFUL' => 'The banlist has been updated successfully', + 'BAN_UPDATE_SUCCESSFUL' => 'The banlist has been updated successfully.', 'EMAIL_BAN' => 'Ban one or more email addresses', 'EMAIL_BAN_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered email address from all current bans.', - 'EMAIL_BAN_EXPLAIN' => 'To specify more than one email address enter each on a new line. To match partial addresses use * as the wildcard, e.g. *@hotmail.com, *@*.domain.tld, etc.', + 'EMAIL_BAN_EXPLAIN' => 'To specify more than one email address enter each on a new line. To match partial addresses use * as the wildcard, e.g. <samp>*@hotmail.com</samp>, <samp>*@*.domain.tld</samp>, etc.', 'EMAIL_NO_BANNED' => 'No banned email addresses', - 'EMAIL_UNBAN' => 'Un-ban or Un-exclude Emails', + 'EMAIL_UNBAN' => 'Un-ban or un-exclude emails', 'EMAIL_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple email addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded email addresses have a marked background.', - 'IP_BAN' => 'Ban one or more ips', + 'IP_BAN' => 'Ban one or more IPs', 'IP_BAN_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered IP from all current bans.', - 'IP_BAN_EXPLAIN' => 'To specify several different IP\'s or hostnames enter each on a new line. To specify a range of IP addresses separate the start and end with a hyphen (-), to specify a wildcard use *', + 'IP_BAN_EXPLAIN' => 'To specify several different IPs or hostnames enter each on a new line. To specify a range of IP addresses separate the start and end with a hyphen (-), to specify a wildcard use *', 'IP_HOSTNAME' => 'IP addresses or hostnames', 'IP_NO_BANNED' => 'No banned IP addresses', 'IP_UNBAN' => 'Un-ban or Un-exclude IPs', - 'IP_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IP\'s have a marked background.', + 'IP_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IPs have a marked background.', '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.', - 'USER_BAN_EXPLAIN' => 'You can ban multiple users in one go by entering each name on a new line. Use the <u>Find a Username</u> facility to look up and add one or more users automatically.', + 'USER_BAN_EXPLAIN' => 'You can ban multiple users in one go by entering each name on a new line. Use the <u>Find a member</u> facility to look up and add one or more users automatically.', '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 have a marked background.', diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index bf47c1e709..e2d2f30e6b 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -32,11 +32,11 @@ if (empty($lang) || !is_array($lang)) $lang = array_merge($lang, array( 'ACP_BOARD_SETTINGS_EXPLAIN' => 'Here you can determine the basic operation of your board, from the site name through user registration to private messaging.', - 'CUSTOM_DATEFORMAT' => 'Custom...', + 'CUSTOM_DATEFORMAT' => 'Custom…', 'DEFAULT_DATE_FORMAT' => 'Date Format', - 'DEFAULT_DATE_FORMAT_EXPLAIN' => 'The date format is the same as the PHP date function.', - 'DEFAULT_LANGUAGE' => 'Default Language', - 'DEFAULT_STYLE' => 'Default Style', + 'DEFAULT_DATE_FORMAT_EXPLAIN' => 'The date format is the same as the PHP <code>date</code> function.', + 'DEFAULT_LANGUAGE' => 'Default language', + 'DEFAULT_STYLE' => 'Default style', 'DISABLE_BOARD' => 'Disable board', 'DISABLE_BOARD_EXPLAIN' => 'This will make the board unavailable to users. You can also enter a short (255 character) message to display if you wish.', 'OVERRIDE_STYLE' => 'Override user style', @@ -45,32 +45,34 @@ $lang = array_merge($lang, array( 'SITE_DESC' => 'Site description', 'SITE_NAME' => 'Site name', 'SYSTEM_DST' => 'Enable Daylight Savings Time', - 'SYSTEM_TIMEZONE' => 'System Timezone', + 'SYSTEM_TIMEZONE' => 'System timezone', 'WARNINGS_EXPIRE' => 'Warning duration', - 'WARNINGS_EXPIRE_EXPLAIN' => 'Number of days after it is issued before a warning will expire from a user\'s record', + 'WARNINGS_EXPIRE_EXPLAIN' => 'Number of days after it is issued before a warning will expire from a user’s record', )); // Board Features $lang = array_merge($lang, array( 'ACP_BOARD_FEATURES_EXPLAIN' => 'Here you can enable/disable several board features', - 'ALLOW_ATTACHMENTS' => 'Allow Attachments', + 'ALLOW_ATTACHMENTS' => 'Allow attachments', 'ALLOW_BOOKMARKS' => 'Allow bookmarking topics', 'ALLOW_BOOKMARKS_EXPLAIN' => 'User is able to store personal bookmarks', 'ALLOW_BBCODE' => 'Allow BBCode', - 'ALLOW_FORUM_NOTIFY' => 'Allow Forum Watching', - 'ALLOW_NAME_CHANGE' => 'Allow Username changes', - 'ALLOW_NO_CENSORS' => 'Allow Disable of Censors', + 'ALLOW_FORUM_NOTIFY' => 'Allow forum watching', + 'ALLOW_NAME_CHANGE' => 'Allow username changes', + 'ALLOW_NO_CENSORS' => 'Allow disable of censors', 'ALLOW_NO_CENSORS_EXPLAIN' => 'User can disable word censoring.', - 'ALLOW_PM_ATTACHMENTS' => 'Allow Attachments in Private Messages', - 'ALLOW_SIG' => 'Allow Signatures', + 'ALLOW_PM_ATTACHMENTS' => 'Allow attachments in private messages', + 'ALLOW_SIG' => 'Allow signatures', 'ALLOW_SIG_BBCODE' => 'Allow BBCode in user signatures', - 'ALLOW_SIG_FLASH' => 'Allow use of FLASH BBCode Tag in user signatures', - 'ALLOW_SIG_IMG' => 'Allow use of IMG BBCode Tag in user signatures', + 'ALLOW_SIG_FLASH' => 'Allow use of <code>[FLASH]</code> BBCode tag in user signatures', + 'ALLOW_SIG_IMG' => 'Allow use of <code>[IMG]</code> BBCode tag in user signatures', + 'ALLOW_SIG_LINKS' => 'Allow use of links in user signatures', + 'ALLOW_SIG_LINKS_EXPLAIN' => 'If disallowed the <code>[URL]</code> bbcode tag and automatic/magic URLs are disabled.', 'ALLOW_SIG_SMILIES' => 'Allow use of smilies in user signatures', - 'ALLOW_SMILIES' => 'Allow Smilies', - 'ALLOW_TOPIC_NOTIFY' => 'Allow Topic Watching', - 'BOARD_PM' => 'Private Messaging', + 'ALLOW_SMILIES' => 'Allow smilies', + 'ALLOW_TOPIC_NOTIFY' => 'Allow topic watching', + 'BOARD_PM' => 'Private messaging', 'BOARD_PM_EXPLAIN' => 'Enable or disable private messaging for all users.', )); @@ -82,15 +84,15 @@ $lang = array_merge($lang, array( 'ALLOW_REMOTE' => 'Enable remote avatars', 'ALLOW_REMOTE_EXPLAIN' => 'Avatars linked to from another website', 'ALLOW_UPLOAD' => 'Enable avatar uploading', - 'AVATAR_GALLERY_PATH' => 'Avatar Gallery Path', - 'AVATAR_GALLERY_PATH_EXPLAIN' => 'Path under your phpBB root dir for pre-loaded images, e.g. images/avatars/gallery', - 'AVATAR_STORAGE_PATH' => 'Avatar Storage Path', - 'AVATAR_STORAGE_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/avatars/upload', - 'MAX_AVATAR_SIZE' => 'Maximum Avatar Dimensions', + 'AVATAR_GALLERY_PATH' => 'Avatar gallery path', + 'AVATAR_GALLERY_PATH_EXPLAIN' => 'Path under your phpBB root dir for pre-loaded images, e.g. <samp>images/avatars/gallery</samp>', + 'AVATAR_STORAGE_PATH' => 'Avatar storage path', + 'AVATAR_STORAGE_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. <samp>images/avatars/upload</samp>', + 'MAX_AVATAR_SIZE' => 'Maximum avatar dimensions', 'MAX_AVATAR_SIZE_EXPLAIN' => '(Height x Width in pixels)', - 'MAX_FILESIZE' => 'Maximum Avatar File Size', + 'MAX_FILESIZE' => 'Maximum avatar file size', 'MAX_FILESIZE_EXPLAIN' => 'For uploaded avatar files', - 'MIN_AVATAR_SIZE' => 'Minimum Avatar Dimensions', + 'MIN_AVATAR_SIZE' => 'Minimum avatar dimensions', 'MIN_AVATAR_SIZE_EXPLAIN' => '(Height x Width in pixels)', )); @@ -99,9 +101,9 @@ $lang = array_merge($lang, array( 'ACP_MESSAGE_SETTINGS_EXPLAIN' => 'Here you can set all default settings for private messaging', 'ALLOW_BBCODE_PM' => 'Allow BBCode in private messages', - 'ALLOW_FLASH_PM' => 'Allow use of FLASH BBCode Tag', + 'ALLOW_FLASH_PM' => 'Allow use of <code>[FLASH]</code> BBCode tag', 'ALLOW_FORWARD_PM' => 'Allow forwarding of private messages', - 'ALLOW_IMG_PM' => 'Allow use of IMG BBCode Tag', + 'ALLOW_IMG_PM' => 'Allow use of <code>[IMG]</code> BBCode tag', 'ALLOW_MASS_PM' => 'Allow sending of private messages to multiple users and groups', 'ALLOW_PRINT_PM' => 'Allow print view in private messaging', 'ALLOW_QUOTE_PM' => 'Allow quotes in private messages', @@ -113,7 +115,7 @@ $lang = array_merge($lang, array( 'BOXES_MAX_EXPLAIN' => 'By default users may create this many personal folders for private messages.', 'ENABLE_PM_ICONS' => 'Enable use of topic icons in private messages', 'FULL_FOLDER_ACTION' => 'Full folder default action', - 'FULL_FOLDER_ACTION_EXPLAIN'=> 'Default Action to take if an users folder is full and if the users folder action set is not applicable. For the "sent messages" folder the default action is always deleting old messages.', + 'FULL_FOLDER_ACTION_EXPLAIN'=> 'Default Action to take if a user’s folder is full and if the users folder action set is not applicable. For the “sent messages†folder the default action is always deleting old messages.', 'HOLD_NEW_MESSAGES' => 'Hold new messages', 'PM_EDIT_TIME' => 'Limit editing time', 'PM_EDIT_TIME_EXPLAIN' => 'Limits the time available to edit a private message not already delivered, zero equals infinity', @@ -122,6 +124,8 @@ $lang = array_merge($lang, array( // Post Settings $lang = array_merge($lang, array( 'ACP_POST_SETTINGS_EXPLAIN' => 'Here you can set all default settings for posting', + 'ALLOW_POST_LINKS' => 'Allow links in posts/private messages', + 'ALLOW_POST_LINKS_EXPLAIN' => 'If disallowed the URL bbcode tag and automatic/magic urls are disabled.', '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.', @@ -181,16 +185,17 @@ $lang = array_merge($lang, array( 'ACC_NONE' => 'None', 'ACC_USER' => 'User', // 'ACC_USER_ADMIN' => 'User + Admin', - 'ALLOW_EMAIL_REUSE' => 'Allow Email address re-use', + 'ALLOW_EMAIL_REUSE' => 'Allow email address re-use', 'ALLOW_EMAIL_REUSE_EXPLAIN' => 'Different users can register with the same email address.', 'COPPA' => 'Coppa', - 'COPPA_FAX' => 'COPPA Fax Number', - 'COPPA_MAIL' => 'COPPA Mailing Address', + 'COPPA_FAX' => 'COPPA fax number', + 'COPPA_MAIL' => 'COPPA mailing address', 'COPPA_MAIL_EXPLAIN' => 'This is the mailing address where parents will send COPPA registration forms', 'ENABLE_COPPA' => 'Enable COPPA', - 'ENABLE_COPPA_EXPLAIN' => 'This requires users to declare whether they are 13 or over for compliance with the U.S. COPPA act. If this is disabled the COPPA specific groups will no longer be displayed.', + 'ENABLE_COPPA_EXPLAIN' => 'This requires users to declare whether they are 13 or over for compliance with the U.S. COPPA Act. If this is disabled the COPPA specific groups will no longer be displayed.', 'MAX_CHARS' => 'Max', 'MIN_CHARS' => 'Min', + 'NO_AUTH_PLUGIN' => 'No suitable auth plugin found.', 'PASSWORD_LENGTH' => 'Password length', 'PASSWORD_LENGTH_EXPLAIN' => 'Minimum and maximum number of characters in passwords.', 'REG_LIMIT' => 'Registration attempts', @@ -208,28 +213,10 @@ $lang = array_merge($lang, array( $lang = array_merge($lang, array( 'ACP_VC_SETTINGS_EXPLAIN' => 'Here you are able to define visual confirmation defaults and captcha settings.', - 'BAD_POLICY' => 'The policy you selected is invalid.', - 'CAPTCHA_3DBITMAP' => '3D Bitmap', - 'CAPTCHA_CELLS' => 'Cells', - 'CAPTCHA_COMPOSITE' => 'Composite', - 'CAPTCHA_ENTROPY' => 'Entropy', - 'CAPTCHA_OPTIONS' => 'Captcha Options', - 'CAPTCHA_OVERLAP' => 'Overlap', - 'CAPTCHA_SHAPE' => 'Shape', - 'CAPTCHA_STENCIL' => 'Stencil', - 'CAPTCHA_EXPLAIN' => 'Click %shere%s to preview this CAPTCHA policy.', - 'ENTROPY_NOISE_LINE' => 'Entropy line noise', - 'ENTROPY_NOISE_PIXEL' => 'Entropy pixel noise', - 'HEAVY' => 'Heavy', - 'LIGHT' => 'Light', - 'MEDIUM' => 'Medium', - 'NO_GD' => 'The server does not support GD, an extension required to enable the advanced CAPTCHA policies. A fall-back method will be used if you decide to enable Visual Confirmation features.', - 'NO_NOISE' => 'None', - 'NO_TTF' => 'The policy you selected requires TTF enabled, the server has TTF disabled. If this policy is enabled, it will be skipped and another policy will be used in its place. If no valid policies are enabled, a fall-back method will be used if you decide to enable Visual Confirmation features.', - 'OVERLAP_NOISE_LINE' => 'Overlap line noise', - 'OVERLAP_NOISE_PIXEL' => 'Overlap pixel noise', - 'SHAPE_NOISE_LINE' => 'Shape line noise', - 'SHAPE_NOISE_PIXEL' => 'Shape pixel noise', + 'CAPTCHA_GD' => 'GD CAPTCHA', + 'CAPTCHA_GD_NOISE' => 'GD CAPTCHA Noise', + 'CAPTCHA_GD_EXPLAIN' => 'Use GD to make a more advanced CAPTCHA', + 'CAPTCHA_GD_NOISE_EXPLAIN' => 'Use noise to make the GD based CAPTCHA harder', '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', @@ -240,11 +227,11 @@ $lang = array_merge($lang, array( $lang = array_merge($lang, array( 'ACP_COOKIE_SETTINGS_EXPLAIN' => 'These details define the data used to send cookies to your users browsers. In most cases the default values for the cookie settings should be sufficient. If you do need to change any do so with care, incorrect settings can prevent users logging in.', - 'COOKIE_DOMAIN' => 'Cookie domain', - 'COOKIE_NAME' => 'Cookie name', - 'COOKIE_PATH' => 'Cookie path', - 'COOKIE_SECURE' => 'Cookie secure', - 'COOKIE_SECURE_EXPLAIN' => 'If your server is running via SSL set this to enabled else leave as disabled. Having this enabled and not running via SSL will result in server errors during redirects.', + 'COOKIE_DOMAIN' => 'Cookie domain', + 'COOKIE_NAME' => 'Cookie name', + 'COOKIE_PATH' => 'Cookie path', + 'COOKIE_SECURE' => 'Cookie secure', + 'COOKIE_SECURE_EXPLAIN' => 'If your server is running via SSL set this to enabled else leave as disabled. Having this enabled and not running via SSL will result in server errors during redirects.', 'ONLINE_LENGTH' => 'View online time span', 'ONLINE_LENGTH_EXPLAIN' => 'Time in minutes after which inactive users will not appear in viewonline listings, lower equals less processing.', 'SESSION_LENGTH' => 'Session length', @@ -255,7 +242,7 @@ $lang = array_merge($lang, array( $lang = array_merge($lang, array( 'ACP_LOAD_SETTINGS_EXPLAIN' => 'Here you can enable and disable certain board functions to reduce the amount of processing required. On most servers there is no need to disable any functions. However on certain systems or in shared hosting environments it may be beneficial to disable capabilities you do not really need. You can also specify limits for system load and active sessions beyond which the board will go offline.', - 'CUSTOM_PROFILE_FIELDS' => 'Custom Profile Fields', + 'CUSTOM_PROFILE_FIELDS' => 'Custom profile fields', 'LIMIT_LOAD' => 'Limit system load', 'LIMIT_LOAD_EXPLAIN' => 'If the 1 minute system load exceeds this value the board will go offline, 1.0 equals ~100% utilisation of one processor. This only functions on UNIX based servers.', 'LIMIT_SESSIONS' => 'Limit sessions', @@ -292,16 +279,16 @@ $lang = array_merge($lang, array( 'APACHE_SETUP_BEFORE_USE' => 'You have to setup apache authentication before you switch phpBB to this authentication method. Keep in mind that the username you use for apache authentication has to be the same as your phpBB username.', - 'LDAP_DN' => 'LDAP base dn', - 'LDAP_DN_EXPLAIN' => 'This is the Distinguished Name, locating the user information, e.g. o=My Company,c=US', + 'LDAP_DN' => 'LDAP base <var>dn</var>', + 'LDAP_DN_EXPLAIN' => 'This is the Distinguished Name, locating the user information, e.g. <samp>o=My Company,c=US</samp>', 'LDAP_EMAIL' => 'LDAP email attribute', 'LDAP_EMAIL_EXPLAIN' => 'Set this to the name of your user entry email attribute (if one exists) in order to automatically set the email address for new users. Leaving this empty results in empty email address for users who log in for the first time.', 'LDAP_NO_EMAIL' => 'The specified email attribute does not exist.', 'LDAP_NO_IDENTITY' => 'Could not find a login identity for %s', 'LDAP_SERVER' => 'LDAP server name', 'LDAP_SERVER_EXPLAIN' => 'If using LDAP this is the name or IP address of the server.', - 'LDAP_UID' => 'LDAP uid', - 'LDAP_UID_EXPLAIN' => 'This is the key under which to search for a given login identity, e.g. uid, sn, etc.', + 'LDAP_UID' => 'LDAP <var>uid</var>', + 'LDAP_UID_EXPLAIN' => 'This is the key under which to search for a given login identity, e.g. <var>uid</var>, <var>sn</var>, etc.', )); // Server Settings @@ -309,26 +296,26 @@ $lang = array_merge($lang, array( 'ACP_SERVER_SETTINGS_EXPLAIN' => 'Here you define server and domain dependant settings. Please ensure the data you enter is accurate, errors will result in emails 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', - 'FORCE_SERVER_VARS' => 'Force server url settings', - 'FORCE_SERVER_VARS_EXPLAIN' => 'If set to yes the server settings defined here will be used in favor of the automatically determined values', + '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', - 'ICONS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/icons', - 'PATH_SETTINGS' => 'Path Settings', + 'ICONS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. <samp>images/icons</samp>', + 'PATH_SETTINGS' => 'Path settings', 'RANKS_PATH' => 'Rank image storage path', - 'RANKS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/ranks', - 'SEND_ENCODING' => 'Send Encoding', + 'RANKS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. <samp>images/ranks</samp>', + 'SEND_ENCODING' => 'Send encoding', 'SEND_ENCODING_EXPLAIN' => 'Send the file encoding from phpBB via HTTP overriding the webserver configuration', - 'SERVER_NAME' => 'Domain Name', - 'SERVER_NAME_EXPLAIN' => 'The domain name this board runs from (for example: www.foo.bar)', + 'SERVER_NAME' => 'Domain name', + 'SERVER_NAME_EXPLAIN' => 'The domain name this board runs from (for example: <samp>www.foo.bar</samp>)', 'SERVER_PORT' => 'Server Port', 'SERVER_PORT_EXPLAIN' => 'The port your server is running on, usually 80, only change if different', - 'SERVER_PROTOCOL' => 'Server Protocol', - 'SERVER_PROTOCOL_EXPLAIN' => 'This is used as the server protocol if these settings are forced. If empty or not forced the protocol is determined by the cookie secure settings (http:// or https://)', - 'SERVER_URL_SETTINGS' => 'Server URL Settings', + 'SERVER_PROTOCOL' => 'Server protocol', + 'SERVER_PROTOCOL_EXPLAIN' => 'This is used as the server protocol if these settings are forced. If empty or not forced the protocol is determined by the cookie secure settings (<samp>http://</samp> or <samp>https://</samp>)', + 'SERVER_URL_SETTINGS' => 'Server URL settings', 'SMILIES_PATH' => 'Smilies storage path', - 'SMILIES_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/smilies', + 'SMILIES_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. <samp>images/smilies</samp>', 'UPLOAD_ICONS_PATH' => 'Extension group icons storage path', - 'UPLOAD_ICONS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/upload_icons', + 'UPLOAD_ICONS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. <samp>images/upload_icons</samp>', )); // Security Settings @@ -338,16 +325,20 @@ $lang = array_merge($lang, array( 'ALL' => 'All', 'ALLOW_AUTOLOGIN' => 'Allow persistent logins', 'ALLOW_AUTOLOGIN_EXPLAIN' => 'Determines whether users can autologin when they visit the board.', - 'AUTOLOGIN_LENGTH' => 'Persistent login key expiry days', + 'AUTOLOGIN_LENGTH' => 'Persistent login key expiration length (in days)', 'AUTOLOGIN_LENGTH_EXPLAIN' => 'Number of days after which persistent login keys are removed or zero to disable.', 'BROWSER_VALID' => 'Validate browser', 'BROWSER_VALID_EXPLAIN' => 'Enables browser validation for each session improving security.', + 'CHECK_DNSBL' => 'Check IP against DNS Blackhole List', + 'CHECK_DNSBL_EXPLAIN' => 'If enabled the IP is checked against the following DNSBL services on registration and posting: <a href="http://spamcop.net">spamcop.net</a>, <a href="http://dsbl.org">dsbl.org</a> and <a href="http://spamhaus.org">spamhaus.org</a>. This lookup may take a bit, depending on the servers configuration. If slowdowns are experienced or too much false positives reported it is recommended to disable this check.', 'CLASS_B' => 'A.B', 'CLASS_C' => 'A.B.C', + 'EMAIL_CHECK_MX' => 'Check email domain for valid MX Record', + 'EMAIL_CHECK_MX_EXPLAIN' => 'If enabled, the email domain provided on registration and profile changes is checked for a valid MX record.', 'FORCE_PASS_CHANGE' => 'Force password change', 'FORCE_PASS_CHANGE_EXPLAIN' => 'Require user to change their password after a set number of days or zero to disable.', 'IP_VALID' => 'Session IP validation', - 'IP_VALID_EXPLAIN' => 'Determines how much of the users IP is used to validate a session; All compares the complete address, A.B.C the first x.x.x, A.B the first x.x, None disables checking.', + 'IP_VALID_EXPLAIN' => 'Determines how much of the users IP is used to validate a session; <samp>All</samp> compares the complete address, <samp>A.B.C</samp> the first x.x.x, <samp>A.B</samp> the first x.x, <samp>None</samp> disables checking.', 'MAX_LOGIN_ATTEMPTS' => 'Maximum number of login attempts', 'MAX_LOGIN_ATTEMPTS_EXPLAIN' => 'After this number of failed logins the user needs to additionally confirm his login visually (visual confirmation)', 'NO_IP_VALIDATION' => 'None', @@ -358,14 +349,14 @@ $lang = array_merge($lang, array( 'PASS_TYPE_CASE' => 'Must be mixed case', 'PASS_TYPE_SYMBOL' => 'Must contain symbols', 'TPL_ALLOW_PHP' => 'Allow php in templates', - 'TPL_ALLOW_PHP_EXPLAIN' => 'If this option is enabled, PHP and INCLUDEPHP statements will be recognized and parsed in templates.', + 'TPL_ALLOW_PHP_EXPLAIN' => 'If this option is enabled, <code>PHP</code> and <code>INCLUDEPHP</code> statements will be recognized and parsed in templates.', )); // Email Settings $lang = array_merge($lang, array( 'ACP_EMAIL_SETTINGS_EXPLAIN' => 'This information is used when the board sends emails to your users. Please ensure the email address you specify is valid, any bounced or undeliverable messages will likely be sent to that address. If your host does not provide a native (PHP based) email service you can instead send messages directly using SMTP. This requires the address of an appropriate server (ask your provider if necessary), do not specify any old name here! If the server requires authentication (and only if it does) enter the necessary username and password. Please note only basic authentication is offered, different authentication implementations are not currently supported.', - 'ADMIN_EMAIL' => 'Return Email Address', + 'ADMIN_EMAIL' => 'Return email address', 'ADMIN_EMAIL_EXPLAIN' => 'This will be used as the return address on all emails.', 'BOARD_EMAIL_FORM' => 'Users send email via board', 'BOARD_EMAIL_FORM_EXPLAIN' => 'Instead of showing the users email address users are able to send emails via the board.', @@ -373,11 +364,11 @@ $lang = array_merge($lang, array( 'BOARD_HIDE_EMAILS_EXPLAIN' => 'This function keeps email addresses completely private.', 'CONTACT_EMAIL' => 'Contact email address', 'CONTACT_EMAIL_EXPLAIN' => 'This address will be used whenever a specific contact point is needed, e.g. spam, error output, etc.', - 'EMAIL_FUNCTION_NAME' => 'Email Function Name', + 'EMAIL_FUNCTION_NAME' => 'Email function name', 'EMAIL_FUNCTION_NAME_EXPLAIN' => 'The email function used to send mails through PHP.', - 'EMAIL_PACKAGE_SIZE' => 'Email Package Size', + 'EMAIL_PACKAGE_SIZE' => 'Email package size', 'EMAIL_PACKAGE_SIZE_EXPLAIN' => 'This is the number of emails sent in one package.', - 'EMAIL_SIG' => 'Email Signature', + 'EMAIL_SIG' => 'Email signature', 'EMAIL_SIG_EXPLAIN' => 'This text will be attached to all emails the board sends.', 'ENABLE_EMAIL' => 'Enable board-wide emails', 'ENABLE_EMAIL_EXPLAIN' => 'If this is set to disabled no emails will be sent by the board at all.', @@ -387,7 +378,7 @@ $lang = array_merge($lang, array( 'SMTP_DIGEST_MD5' => 'DIGEST-MD5', 'SMTP_LOGIN' => 'LOGIN', 'SMTP_PASSWORD' => 'SMTP Password', - 'SMTP_PASSWORD_EXPLAIN' => 'Only enter a password if your smtp server requires it.', + 'SMTP_PASSWORD_EXPLAIN' => 'Only enter a password if your SMTP server requires it.', 'SMTP_PLAIN' => 'PLAIN', 'SMTP_POP_BEFORE_SMTP' => 'POP-BEFORE-SMTP', 'SMTP_PORT' => 'SMTP Server Port', @@ -395,37 +386,37 @@ $lang = array_merge($lang, array( 'SMTP_SERVER' => 'SMTP Server Address', 'SMTP_SETTINGS' => 'SMTP Settings', 'SMTP_USERNAME' => 'SMTP Username', - 'SMTP_USERNAME_EXPLAIN' => 'Only enter a username if your smtp server requires it.', + 'SMTP_USERNAME_EXPLAIN' => 'Only enter a username if your SMTP server requires it.', 'USE_SMTP' => 'Use SMTP Server for email', - 'USE_SMTP_EXPLAIN' => 'Say yes if you want or have to send email via a named server instead of the local mail function.', + 'USE_SMTP_EXPLAIN' => 'Select “Yes†if you want or have to send email via a named server instead of the local mail function.', )); // Jabber settings $lang = array_merge($lang, array( 'ACP_JABBER_SETTINGS_EXPLAIN' => 'Here you can enable and control the use Jabber for instant messaging and board notices. Jabber is an opensource protocol and therefore available for use by anyone. Some Jabber servers include gateways or transports which allow you to contact users on other networks. Not all servers offer all transports and changes in protocols can prevent transports from operating. Note that it may take several seconds to update Jabber account details, do not stop the script till completed!', - 'ERR_JAB_AUTH' => 'Could not authorise on Jabber server', - 'ERR_JAB_CONNECT' => 'Could not connect to Jabber server', - 'ERR_JAB_PASSCHG' => 'Could not change password', - 'ERR_JAB_PASSFAIL' => 'Password update failed, %s', - 'ERR_JAB_REGISTER' => 'An error occured trying to register this account, %s', + 'ERR_JAB_AUTH' => 'Could not authorise on Jabber server.', + 'ERR_JAB_CONNECT' => 'Could not connect to Jabber server.', + 'ERR_JAB_PASSCHG' => 'Could not change password.', + 'ERR_JAB_PASSFAIL' => 'Password update failed, %s.', + 'ERR_JAB_REGISTER' => 'An error occured trying to register this account, %s.', 'ERR_JAB_USERNAME' => 'The username specified already exists, please choose an alternative.', - 'JAB_CHANGED' => 'Jabber account changed successfully', + 'JAB_CHANGED' => 'Jabber account changed successfully.', 'JAB_ENABLE' => 'Enable Jabber', 'JAB_ENABLE_EXPLAIN' => 'Enables use of jabber messaging and notifications', - 'JAB_PACKAGE_SIZE' => 'Jabber Package Size', + 'JAB_PACKAGE_SIZE' => 'Jabber package size', 'JAB_PACKAGE_SIZE_EXPLAIN' => 'This is the number of messages sent in one package. If set to 0 the message is sent immediatly and gets not queued for later sending.', 'JAB_PASSWORD' => 'Jabber password', - 'JAB_PASS_CHANGED' => 'Jabber password changed successfully', + 'JAB_PASS_CHANGED' => 'Jabber password changed successfully.', 'JAB_PORT' => 'Jabber port', - 'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not 5222', - 'JAB_REGISTERED' => 'New account registered successfully', + 'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not port 5222', + 'JAB_REGISTERED' => 'New account registered successfully.', 'JAB_RESOURCE' => 'Jabber resource', 'JAB_RESOURCE_EXPLAIN' => 'The resource locates this particular connection, e.g. board, home, etc.', 'JAB_SERVER' => 'Jabber server', 'JAB_SERVER_EXPLAIN' => 'See %sjabber.org%s for a list of servers', - 'JAB_SETTINGS_CHANGED' => 'Jabber settings changed successfully', + 'JAB_SETTINGS_CHANGED' => 'Jabber settings changed successfully.', 'JAB_USERNAME' => 'Jabber username', 'JAB_USERNAME_EXPLAIN' => 'If this user is not registered it will be created if possible.', )); diff --git a/phpBB/language/en/acp/bots.php b/phpBB/language/en/acp/bots.php index 45bbdfbad9..dda1dcf73f 100644 --- a/phpBB/language/en/acp/bots.php +++ b/phpBB/language/en/acp/bots.php @@ -30,16 +30,16 @@ if (empty($lang) || !is_array($lang)) // Bot settings $lang = array_merge($lang, array( - 'BOTS' => 'Manage Bots', + 'BOTS' => 'Manage bots', 'BOTS_EXPLAIN' => 'Bots or crawlers are automated agents most commonly used by search engines to update their databases. Since they rarely make proper use of sessions they can distort visitor counts, increase load and sometimes fail to index sites correctly. Here you can define a special type of user to overcome these problems.', 'BOT_ACTIVATE' => 'Activate', 'BOT_ACTIVE' => 'Bot active', 'BOT_ADD' => 'Add bot', - 'BOT_ADDED' => 'New bot successfully added', + 'BOT_ADDED' => 'New bot successfully added.', 'BOT_AGENT' => 'Agent match', 'BOT_AGENT_EXPLAIN' => 'A string matching the bots browser agent, partial matches are allowed.', 'BOT_DEACTIVATE' => 'Deactivate', - 'BOT_DELETED' => 'Bot deleted successfully', + 'BOT_DELETED' => 'Bot deleted successfully.', 'BOT_EDIT' => 'Edit bots', 'BOT_EDIT_EXPLAIN' => 'Here you can add or edit an existing bot entry. You may define an agent string and/or one or more IP addresses (or range of addresses) to match. Be careful when defining matching agent strings or addresses. You may also specify a style and language that the bot will view the board using. This may allow you to reduce bandwidth use by setting a simple style for bots. Remember to set appropriate permissions for the special Bot usergroup.', 'BOT_LANG' => 'Bot language', @@ -52,14 +52,16 @@ $lang = array_merge($lang, array( 'BOT_NEVER' => 'Never', 'BOT_STYLE' => 'Bot style', 'BOT_STYLE_EXPLAIN' => 'The style used for the board by the bot.', - 'BOT_UPDATED' => 'Existing bot updated successfully', + 'BOT_UPDATED' => 'Existing bot updated successfully.', 'BOT_VIS' => 'Bot visible', 'BOT_VIS_EXPLAIN' => 'Allow bot to be seen by all users in online lists.', - 'ERR_BOT_NO_IP' => 'The IP addresses you supplied were invalid or the hostname could not be resolved.', - 'ERR_BOT_NO_MATCHES' => 'You must supply at least one of an agent or IP for this bot match.', + 'ERR_BOT_AGENT_MATCHES_UA' => 'The bot agent you supplied is similar to the one you are currently using. Please adjust the agent for this bot.', + 'ERR_BOT_NO_IP' => 'The IP addresses you supplied were invalid or the hostname could not be resolved.', + 'ERR_BOT_NO_MATCHES' => 'You must supply at least one of an agent or IP for this bot match.', - 'NO_BOT' => 'Found no bot with the specified ID', + 'NO_BOT' => 'Found no bot with the specified ID.', + 'NO_BOT_GROUP' => 'Unable to find special bot group.', )); ?>
\ No newline at end of file diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 0847ff44c9..77b9a5d5a1 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -31,26 +31,26 @@ if (empty($lang) || !is_array($lang)) // Common $lang = array_merge($lang, array( 'ACP_ADMINISTRATORS' => 'Administrators', - 'ACP_ADMIN_LOGS' => 'Admin Log', - 'ACP_ADMIN_ROLES' => 'Admin Roles', + 'ACP_ADMIN_LOGS' => 'Admin log', + 'ACP_ADMIN_ROLES' => 'Admin roles', 'ACP_ATTACHMENTS' => 'Attachments', - 'ACP_ATTACHMENT_SETTINGS' => 'Attachment Settings', + 'ACP_ATTACHMENT_SETTINGS' => 'Attachment settings', 'ACP_AUTH_SETTINGS' => 'Authentication', 'ACP_AUTOMATION' => 'Automation', - 'ACP_AVATAR_SETTINGS' => 'Avatar Settings', + 'ACP_AVATAR_SETTINGS' => 'Avatar settings', 'ACP_BACKUP' => 'Backup', 'ACP_BAN' => 'Banning', - 'ACP_BAN_EMAILS' => 'Ban Emails', + 'ACP_BAN_EMAILS' => 'Ban emails', 'ACP_BAN_IPS' => 'Ban IPs', - 'ACP_BAN_USERNAMES' => 'Ban Usernames', - 'ACP_BASIC_PERMISSIONS' => 'Basic Permissions', + 'ACP_BAN_USERNAMES' => 'Ban usernames', + 'ACP_BASIC_PERMISSIONS' => 'Basic permissions', 'ACP_BBCODES' => 'BBCodes', - 'ACP_BOARD_CONFIGURATION' => 'Board Configuration', - 'ACP_BOARD_DEFAULTS' => 'Board Defaults', - 'ACP_BOARD_FEATURES' => 'Board Features', - 'ACP_BOARD_MANAGEMENT' => 'Board Management', - 'ACP_BOARD_SETTINGS' => 'Board Settings', + 'ACP_BOARD_CONFIGURATION' => 'Board configuration', + 'ACP_BOARD_DEFAULTS' => 'Board defaults', + 'ACP_BOARD_FEATURES' => 'Board features', + 'ACP_BOARD_MANAGEMENT' => 'Board management', + 'ACP_BOARD_SETTINGS' => 'Board settings', 'ACP_BOTS' => 'Spiders/Robots', 'ACP_CAPTCHA' => 'CAPTCHA', @@ -64,161 +64,165 @@ $lang = array_merge($lang, array( 'ACP_CAT_POSTING' => 'Posting', 'ACP_CAT_STYLES' => 'Styles', 'ACP_CAT_SYSTEM' => 'System', - 'ACP_CAT_USERGROUP' => 'Users and Groups', + 'ACP_CAT_USERGROUP' => 'Users and groups', 'ACP_CAT_USERS' => 'Users', - 'ACP_CLIENT_COMMUNICATION' => 'Client Communication', - 'ACP_COOKIE_SETTINGS' => 'Cookie Settings', - 'ACP_CRITICAL_LOGS' => 'Error Log', - 'ACP_CUSTOM_PROFILE_FIELDS' => 'Custom Profile Fields', + 'ACP_CLIENT_COMMUNICATION' => 'Client communication', + 'ACP_COOKIE_SETTINGS' => 'Cookie settings', + 'ACP_CRITICAL_LOGS' => 'Error log', + 'ACP_CUSTOM_PROFILE_FIELDS' => 'Custom profile fields', - 'ACP_DATABASE' => 'Database Management', + 'ACP_DATABASE' => 'Database management', 'ACP_DISALLOW' => 'Disallow', - 'ACP_DISALLOW_USERNAMES' => 'Disallow Usernames', + 'ACP_DISALLOW_USERNAMES' => 'Disallow usernames', - 'ACP_EMAIL_SETTINGS' => 'Email Settings', - 'ACP_EXTENSION_GROUPS' => 'Manage Extension Groups', + 'ACP_EMAIL_SETTINGS' => 'Email settings', + 'ACP_EXTENSION_GROUPS' => 'Manage extension groups', - 'ACP_FORUM_BASED_PERMISSIONS' => 'Forum Based Permissions', - 'ACP_FORUM_LOGS' => 'Forum Logs', - 'ACP_FORUM_MANAGEMENT' => 'Forum Management', - 'ACP_FORUM_MODERATORS' => 'Forum Moderators', - 'ACP_FORUM_PERMISSIONS' => 'Forum Permissions', - 'ACP_FORUM_ROLES' => 'Forum Roles', - - 'ACP_GENERAL_CONFIGURATION' => 'General Configuration', - 'ACP_GENERAL_TASKS' => 'General Tasks', - 'ACP_GLOBAL_MODERATORS' => 'Global Moderators', - 'ACP_GLOBAL_PERMISSIONS' => 'Global Permissions', + 'ACP_FORUM_BASED_PERMISSIONS' => 'Forum based permissions', + 'ACP_FORUM_LOGS' => 'Forum logs', + 'ACP_FORUM_MANAGEMENT' => 'Forum management', + 'ACP_FORUM_MODERATORS' => 'Forum moderators', + 'ACP_FORUM_PERMISSIONS' => 'Forum permissions', + 'ACP_FORUM_ROLES' => 'Forum roles', + + 'ACP_GENERAL_CONFIGURATION' => 'General configuration', + 'ACP_GENERAL_TASKS' => 'General tasks', + 'ACP_GLOBAL_MODERATORS' => 'Global moderators', + 'ACP_GLOBAL_PERMISSIONS' => 'Global permissions', 'ACP_GROUPS' => 'Groups', - 'ACP_GROUPS_FORUM_PERMISSIONS' => 'Groups Forum Permissions', - 'ACP_GROUPS_MANAGE' => 'Manage Groups', - 'ACP_GROUPS_MANAGEMENT' => 'Group Management', - 'ACP_GROUPS_PERMISSIONS' => 'Groups Permissions', + 'ACP_GROUPS_FORUM_PERMISSIONS' => 'Groups forum permissions', + 'ACP_GROUPS_MANAGE' => 'Manage groups', + 'ACP_GROUPS_MANAGEMENT' => 'Group management', + 'ACP_GROUPS_PERMISSIONS' => 'Groups permissions', - 'ACP_ICONS' => 'Topic Icons', - 'ACP_ICONS_SMILIES' => 'Topic Icons/Smilies', + 'ACP_ICONS' => 'Topic icons', + 'ACP_ICONS_SMILIES' => 'Topic icons/smilies', 'ACP_IMAGESETS' => 'Imagesets', + 'ACP_INACTIVE_USERS' => 'Inactive users', 'ACP_INDEX' => 'Admin index', - 'ACP_JABBER_SETTINGS' => 'Jabber Settings', + 'ACP_JABBER_SETTINGS' => 'Jabber settings', - 'ACP_LANGUAGE' => 'Language Management', - 'ACP_LANGUAGE_PACKS' => 'Language Packs', - 'ACP_LOAD_SETTINGS' => 'Load Settings', + 'ACP_LANGUAGE' => 'Language management', + 'ACP_LANGUAGE_PACKS' => 'Language packs', + 'ACP_LOAD_SETTINGS' => 'Load settings', 'ACP_LOGGING' => 'Logging', 'ACP_MAIN' => 'Admin index', - 'ACP_MANAGE_EXTENSIONS' => 'Manage Extensions', - 'ACP_MANAGE_FORUMS' => 'Manage Forums', - 'ACP_MANAGE_RANKS' => 'Manage Ranks', - 'ACP_MANAGE_REASONS' => 'Manage Report/Denial Reasons', - 'ACP_MANAGE_USERS' => 'Manage Users', - 'ACP_MASS_EMAIL' => 'Mass Email', + 'ACP_MANAGE_EXTENSIONS' => 'Manage extensions', + 'ACP_MANAGE_FORUMS' => 'Manage forums', + 'ACP_MANAGE_RANKS' => 'Manage ranks', + 'ACP_MANAGE_REASONS' => 'Manage report/denial reasons', + 'ACP_MANAGE_USERS' => 'Manage users', + 'ACP_MASS_EMAIL' => 'Mass email', 'ACP_MESSAGES' => 'Messages', - 'ACP_MESSAGE_SETTINGS' => 'Private Message Settings', - 'ACP_MODULE_MANAGEMENT' => 'Module Management', - 'ACP_MOD_LOGS' => 'Moderator Log', - 'ACP_MOD_ROLES' => 'Moderator Roles', + 'ACP_MESSAGE_SETTINGS' => 'Private message settings', + 'ACP_MODULE_MANAGEMENT' => 'Module management', + 'ACP_MOD_LOGS' => 'Moderator log', + 'ACP_MOD_ROLES' => 'Moderator roles', - 'ACP_ORPHAN_ATTACHMENTS' => 'Orphan Attachments', + 'ACP_ORPHAN_ATTACHMENTS' => 'Orphaned attachments', 'ACP_PERMISSIONS' => 'Permissions', - 'ACP_PERMISSION_MASKS' => 'Permission Masks', - 'ACP_PERMISSION_ROLES' => 'Permission Roles', - 'ACP_PERMISSION_SETTINGS' => 'Permission Settings', - 'ACP_PERMISSION_TRACE' => 'Permission Trace', - 'ACP_PHP_INFO' => 'PHP Information', - 'ACP_POST_SETTINGS' => 'Post Settings', - 'ACP_PRUNE_FORUMS' => 'Prune Forums', - 'ACP_PRUNE_USERS' => 'Prune Users', + 'ACP_PERMISSION_MASKS' => 'Permission masks', + 'ACP_PERMISSION_ROLES' => 'Permission roles', + 'ACP_PERMISSION_SETTINGS' => 'Permission settings', + 'ACP_PERMISSION_TRACE' => 'Permission trace', + 'ACP_PHP_INFO' => 'PHP information', + 'ACP_POST_SETTINGS' => 'Post settings', + 'ACP_PRUNE_FORUMS' => 'Prune forums', + 'ACP_PRUNE_USERS' => 'Prune users', 'ACP_PRUNING' => 'Pruning', - 'ACP_QUICK_ACCESS' => 'Quick Access', + 'ACP_QUICK_ACCESS' => 'Quick access', 'ACP_RANKS' => 'Ranks', - 'ACP_REASONS' => 'Report/Denial Reasons', - 'ACP_REGISTER_SETTINGS' => 'User Registration Settings', + 'ACP_REASONS' => 'Report/Denial reasons', + 'ACP_REGISTER_SETTINGS' => 'User registration settings', 'ACP_RESTORE' => 'Restore', - 'ACP_SEARCH' => 'Search Configuration', - 'ACP_SEARCH_INDEX' => 'Search Index', - 'ACP_SEARCH_SETTINGS' => 'Search Settings', + 'ACP_SEARCH' => 'Search configuration', + 'ACP_SEARCH_INDEX' => 'Search index', + 'ACP_SEARCH_SETTINGS' => 'Search settings', - 'ACP_SECURITY_SETTINGS' => 'Security Settings', - 'ACP_SERVER_CONFIGURATION' => 'Server Configuration', - 'ACP_SERVER_SETTINGS' => 'Server Settings', - 'ACP_SIGNATURE_SETTINGS' => 'Signature Settings', + 'ACP_SECURITY_SETTINGS' => 'Security settings', + 'ACP_SERVER_CONFIGURATION' => 'Server configuration', + 'ACP_SERVER_SETTINGS' => 'Server settings', + 'ACP_SIGNATURE_SETTINGS' => 'Signature settings', 'ACP_SMILIES' => 'Smilies', - 'ACP_SPECIAL_PERMISSIONS' => 'Special Permissions', - 'ACP_STYLE_COMPONENTS' => 'Style Components', - 'ACP_STYLE_MANAGEMENT' => 'Style Management', + 'ACP_SPECIAL_PERMISSIONS' => 'Special permissions', + 'ACP_STYLE_COMPONENTS' => 'Style components', + 'ACP_STYLE_MANAGEMENT' => 'Style management', 'ACP_STYLES' => 'Styles', 'ACP_TEMPLATES' => 'Templates', 'ACP_THEMES' => 'Themes', 'ACP_UPDATE' => 'Updating', - 'ACP_USERS_FORUM_PERMISSIONS' => 'Users Forum Permissions', - 'ACP_USERS_LOGS' => 'User Logs', - 'ACP_USERS_PERMISSIONS' => 'Users Permissions', + 'ACP_USERS_FORUM_PERMISSIONS' => 'Users forum permissions', + 'ACP_USERS_LOGS' => 'User logs', + 'ACP_USERS_PERMISSIONS' => 'Users permissions', 'ACP_USER_ATTACH' => 'Attachments', 'ACP_USER_AVATAR' => 'Avatar', 'ACP_USER_FEEDBACK' => 'Feedback', 'ACP_USER_GROUPS' => 'Groups', - 'ACP_USER_MANAGEMENT' => 'User Management', + 'ACP_USER_MANAGEMENT' => 'User management', 'ACP_USER_OVERVIEW' => 'Overview', 'ACP_USER_PERM' => 'Permissions', 'ACP_USER_PREFS' => 'Preferences', 'ACP_USER_PROFILE' => 'Profile', 'ACP_USER_RANK' => 'Rank', - 'ACP_USER_ROLES' => 'User Roles', - 'ACP_USER_SECURITY' => 'User Security', + 'ACP_USER_ROLES' => 'User roles', + 'ACP_USER_SECURITY' => 'User security', 'ACP_USER_SIG' => 'Signature', - 'ACP_VC_SETTINGS' => 'Visual Confirmation Settings', - 'ACP_VC_CAPTCHA_DISPLAY' => 'CAPTCHA Image Preview', - 'ACP_VERSION_CHECK' => 'Check for Updates', - 'ACP_VIEW_ADMIN_PERMISSIONS' => 'View Admin Permissions', - 'ACP_VIEW_FORUM_MOD_PERMISSIONS' => 'View Forum Moderator Permissions', - 'ACP_VIEW_FORUM_PERMISSIONS' => 'View Forum Permissions', - 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS' => 'View Global Moderator Permissions', - 'ACP_VIEW_USER_PERMISSIONS' => 'View User Permissions', + 'ACP_VC_SETTINGS' => 'Visual confirmation settings', + 'ACP_VC_CAPTCHA_DISPLAY' => 'CAPTCHA image preview', + 'ACP_VERSION_CHECK' => 'Check for updates', + 'ACP_VIEW_ADMIN_PERMISSIONS' => 'View administrative permissions', + 'ACP_VIEW_FORUM_MOD_PERMISSIONS' => 'View forum moderation permissions', + 'ACP_VIEW_FORUM_PERMISSIONS' => 'View forum-based permissions', + 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS' => 'View global moderatoration permissions', + 'ACP_VIEW_USER_PERMISSIONS' => 'View user-based permissions', - 'ACP_WORDS' => 'Word Censoring', + 'ACP_WORDS' => 'Word censoring', 'ACTION' => 'Action', 'ACTIONS' => 'Actions', 'ACTIVATE' => 'Activate', 'ADD' => 'Add', 'ADMIN' => 'Administration', - 'ADMIN_INDEX' => 'Admin Index', + 'ADMIN_INDEX' => 'Admin index', 'ADMIN_PANEL' => 'Administration Control Panel', 'BACK' => 'Back', 'COLOUR_SWATCH' => 'Web-safe colour swatch', - 'CONFIG_UPDATED' => 'Configuration updated successfully', + 'CONFIG_UPDATED' => 'Configuration updated successfully.', 'CONFIRM_OPERATION' => 'Are you sure you wish to carry out this operation?', 'DEACTIVATE' => 'Deactivate', 'DIMENSIONS' => 'Dimensions', + 'DIRECTORY_DOES_NOT_EXIST' => 'The entered path "%s" does not exist.', + 'DIRECTORY_NOT_DIR' => 'The entered path "%s" is not a directory.', + 'DIRECTORY_NOT_WRITEABLE' => 'The entered path "%s" is not writeable.', 'DISABLE' => 'Disable', 'DOWNLOAD' => 'Download', 'DOWNLOAD_AS' => 'Download as', - 'DOWNLOAD_STORE' => 'Download or Store file', - 'DOWNLOAD_STORE_EXPLAIN' => 'You may directly download the file or save it in your store/ folder.', + 'DOWNLOAD_STORE' => 'Download or store file', + 'DOWNLOAD_STORE_EXPLAIN' => 'You may directly download the file or save it in your <samp>store/</samp> folder.', 'EDIT' => 'Edit', 'ENABLE' => 'Enable', 'EXPORT_DOWNLOAD' => 'Download', 'EXPORT_STORE' => 'Store', - 'FORUM_INDEX' => 'Forum Index', + 'FORUM_INDEX' => 'Forum index', - 'GENERAL_OPTIONS' => 'General Options', - 'GENERAL_SETTINGS' => 'General Settings', - 'GLOBAL_MASK' => 'Global Permission Mask', + 'GENERAL_OPTIONS' => 'General options', + 'GENERAL_SETTINGS' => 'General settings', + 'GLOBAL_MASK' => 'Global permission mask', 'INSTALL' => 'Install', 'IP' => 'User IP', @@ -228,27 +232,30 @@ $lang = array_merge($lang, array( 'LOGIN_ADMIN' => 'To administer the board you must be an authenticated user.', 'LOGIN_ADMIN_CONFIRM' => 'To administer the board you must re-authenticate yourself.', 'LOGIN_ADMIN_SUCCESS' => 'You have successfully authenticated and will now be redirected to the Administration Control Panel', - 'LOOK_UP_FORUM' => 'Select a Forum', + 'LOOK_UP_FORUM' => 'Select a forum', 'MANAGE' => 'Manage', - 'MOVE_DOWN' => 'Move Down', - 'MOVE_UP' => 'Move Up', + 'MOVE_DOWN' => 'Move down', + 'MOVE_UP' => 'Move up', 'NOTIFY' => 'Notification', - 'NO_ADMIN' => 'You are not authorised to administer this board.', + 'NO_ADMIN' => 'You are not authorised to administrate this board.', 'NO_EMAILS_DEFINED' => 'No valid email addresses found', - 'OFF' => 'OFF', - 'ON' => 'ON', + 'OFF' => 'Off', + 'ON' => 'On', - 'PARSE_BBCODE' => 'Parse BBCode', - 'PARSE_SMILIES' => 'Parse Smilies', - 'PARSE_URLS' => 'Parse Links', - 'PROCEED_TO_ACP' => '%sProceed to the ACP%s', - 'REMIND' => 'Remind', - 'REORDER' => 'Reorder', - 'RESYNC' => 'Sync', - 'RETURN_TO' => 'Return to ...', + 'PARSE_BBCODE' => 'Parse BBCode', + 'PARSE_SMILIES' => 'Parse smilies', + 'PARSE_URLS' => 'Parse links', + 'PERMISSIONS_TRANSFERED' => 'Permissions transfered', + 'PERMISSIONS_TRANSFERED_EXPLAIN' => 'You are currently having the permissions from %1$s. You are able to browse the forum with the users permissions but not access the administration control panel since admin permissions were not transfered. You are able to <a href="%2$s"><strong>revert to your permission set</strong></a> at any time.', + 'PROCEED_TO_ACP' => '%sProceed to the ACP%s', + + 'REMIND' => 'Remind', + 'REORDER' => 'Reorder', + 'RESYNC' => 'Resyncronise', + 'RETURN_TO' => 'Return to…', 'SELECT_ANONYMOUS' => 'Select Anonymous User', 'SELECT_OPTION' => 'Select option', @@ -258,8 +265,6 @@ $lang = array_merge($lang, array( 'USER_CONTROL_PANEL' => 'User Control Panel', 'WARNING' => 'Warning', - - 'DEBUG_EXTRA_WARNING' => 'The DEBUG_EXTRA constant is defined which is only meant for development purposes by the developers.<br />The board is running additional code to display sql reports, which slows down the board in a significant manner. Additionally sql errors are always displayed with a full backtrace to all users instead of displaying it solely to administrators, which is the default setting.<br /><br />With this said, please be aware that you are currently running your installation in <b>Debug Mode</b> and should you take this board live, please remove the constant from the config file.', )); // PHP info @@ -297,311 +302,330 @@ $lang = array_merge($lang, array( 'DATABASE_SIZE' => 'Database size', 'FILES_PER_DAY' => 'Attachments per day', - 'FORUM_STATS' => 'Forum Statistics', - - 'GZIP_COMPRESSION' => 'Gzip compression', + 'FORUM_STATS' => 'Forum statistics', - 'INACTIVE_USERS' => 'Inactive Users', - 'INACTIVE_USERS_EXPLAIN' => 'This is a list of users who have registered but whos accounts are inactive. You can activate, delete or remind (by sending an email) these users if you wish.', + 'GZIP_COMPRESSION' => 'GZip compression', - 'NO_INACTIVE_USERS' => 'No inactive users', 'NOT_AVAILABLE' => 'Not available', - 'NUMBER_FILES' => 'Number of Attachments', + 'NUMBER_FILES' => 'Number of attachments', 'NUMBER_POSTS' => 'Number of posts', 'NUMBER_TOPICS' => 'Number of topics', 'NUMBER_USERS' => 'Number of users', + 'NUMBER_ORPHAN' => 'Orphan attachments', 'POSTS_PER_DAY' => 'Posts per day', - 'RESET_DATE' => 'Reset Date', - 'RESET_ONLINE' => 'Reset Online', - 'RESYNC_POSTCOUNTS' => 'Resync Postcounts', - 'RESYNC_POST_MARKING' => 'Resync dotted topics', - 'RESYNC_STATS' => 'Resync Stats', + 'RESET_DATE' => 'Reset date', + 'RESET_ONLINE' => 'Reset online', + 'RESYNC_POSTCOUNTS' => 'Resyncronise post counts', + 'RESYNC_POST_MARKING' => 'Resyncronise dotted topics', + 'RESYNC_STATS' => 'Resyncronise statistics', 'STATISTIC' => 'Statistic', 'TOPICS_PER_DAY' => 'Topics per day', - 'UPLOAD_DIR_SIZE' => 'Upload directory size', + 'UPLOAD_DIR_SIZE' => 'Size of posted attachments', 'USERS_PER_DAY' => 'Users per day', - 'VALUE' => 'Value', - 'VIEW_ADMIN_LOG' => 'View administrator log', + 'VALUE' => 'Value', + 'VIEW_ADMIN_LOG' => 'View administrator log', + 'VIEW_INACTIVE_USERS' => 'View inactive users', 'WELCOME_PHPBB' => 'Welcome to phpBB', )); +// Inactive Users +$lang = array_merge($lang, array( + 'INACTIVE_DATE' => 'Inactive date', + 'INACTIVE_REASON' => 'Reason', + 'INACTIVE_REASON_MANUAL' => 'Account deactivated by administrator', + 'INACTIVE_REASON_PROFILE' => 'Profile details changed', + 'INACTIVE_REASON_REGISTER' => 'Newly registered account', + 'INACTIVE_REASON_REMIND' => 'Forced user account reactivation', + 'INACTIVE_REASON_UNKNOWN' => 'Unknown', + 'INACTIVE_USERS' => 'Inactive Users', + 'INACTIVE_USERS_EXPLAIN' => 'This is a list of users who have registered but whos accounts are inactive. You can activate, delete or remind (by sending an email) these users if you wish.', + 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. A full list is available from the appropriate menu item or by following the link below from where you can activate, delete or remind (by sending an email) these users if you wish.', + + 'NO_INACTIVE_USERS' => 'No inactive users', + + 'SORT_INACTIVE' => 'Inactive date', + 'SORT_LAST_VISIT' => 'Last visit', + 'SORT_REASON' => 'Reason', + 'SORT_REG_DATE' => 'Registration date', +)); + // Log Entries $lang = array_merge($lang, array( - 'LOG_ACL_ADD_USER_GLOBAL_U_' => '<b>Added or edited users user permissions</b><br />» %s', - 'LOG_ACL_ADD_GROUP_GLOBAL_U_' => '<b>Added or edited groups user permissions</b><br />» %s', - 'LOG_ACL_ADD_USER_GLOBAL_M_' => '<b>Added or edited users global moderator permissions</b><br />» %s', - 'LOG_ACL_ADD_GROUP_GLOBAL_M_' => '<b>Added or edited groups global moderator permissions</b><br />» %s', - 'LOG_ACL_ADD_USER_GLOBAL_A_' => '<b>Added or edited users admin permissions</b><br />» %s', - 'LOG_ACL_ADD_GROUP_GLOBAL_A_' => '<b>Added or edited groups admin permissions</b><br />» %s', - - 'LOG_ACL_ADD_ADMIN_GLOBAL_A_' => '<b>Added or edited Administrators</b><br />» %s', - 'LOG_ACL_ADD_MOD_GLOBAL_M_' => '<b>Added or edited Global Moderators</b><br />» %s', - - 'LOG_ACL_ADD_USER_LOCAL_F_' => '<b>Added or edited users forum access</b> from %1$s<br />» %2$s', - 'LOG_ACL_ADD_USER_LOCAL_M_' => '<b>Added or edited users forum moderator access</b> from %1$s<br />» %2$s', - 'LOG_ACL_ADD_GROUP_LOCAL_F_' => '<b>Added or edited groups forum access</b> from %1$s<br />» %2$s', - 'LOG_ACL_ADD_GROUP_LOCAL_M_' => '<b>Added or edited groups forum moderator access</b> from %1$s<br />» %2$s', - - 'LOG_ACL_ADD_MOD_LOCAL_M_' => '<b>Added or edited Moderators</b> from %1$s<br />» %2$s', - 'LOG_ACL_ADD_FORUM_LOCAL_F_' => '<b>Added or edited Forum Permissions</b> from %1$s<br />» %2$s', - - 'LOG_ACL_DEL_ADMIN_GLOBAL_A_' => '<b>Removed Administrators</b><br />» %s', - 'LOG_ACL_DEL_MOD_GLOBAL_M_' => '<b>Removed Global Moderators</b><br />» %s', - 'LOG_ACL_DEL_MOD_LOCAL_M_' => '<b>Removed Moderators</b> from %1$s<br />» %2$s', - 'LOG_ACL_DEL_FORUM_LOCAL_F_' => '<b>Removed User/Group Forum Permissions</b> from %1$s<br />» %2$s', - - 'LOG_ACL_TRANSFER_PERMISSIONS' => '<b>Permissions transfered from</b><br />» %s', - 'LOG_ACL_RESTORE_PERMISSIONS' => '<b>Own permissions restored after using permissions from</b><br />» %s', + 'LOG_ACL_ADD_USER_GLOBAL_U_' => '<strong>Added or edited users user permissions</strong><br />» %s', + 'LOG_ACL_ADD_GROUP_GLOBAL_U_' => '<strong>Added or edited groups user permissions</strong><br />» %s', + 'LOG_ACL_ADD_USER_GLOBAL_M_' => '<strong>Added or edited users global moderator permissions</strong><br />» %s', + 'LOG_ACL_ADD_GROUP_GLOBAL_M_' => '<strong>Added or edited groups global moderator permissions</strong><br />» %s', + 'LOG_ACL_ADD_USER_GLOBAL_A_' => '<strong>Added or edited users admin permissions</strong><br />» %s', + 'LOG_ACL_ADD_GROUP_GLOBAL_A_' => '<strong>Added or edited groups admin permissions</strong><br />» %s', + + 'LOG_ACL_ADD_ADMIN_GLOBAL_A_' => '<strong>Added or edited Administrators</strong><br />» %s', + 'LOG_ACL_ADD_MOD_GLOBAL_M_' => '<strong>Added or edited Global Moderators</strong><br />» %s', + + 'LOG_ACL_ADD_USER_LOCAL_F_' => '<strong>Added or edited users forum access</strong> from %1$s<br />» %2$s', + 'LOG_ACL_ADD_USER_LOCAL_M_' => '<strong>Added or edited users forum moderator access</strong> from %1$s<br />» %2$s', + 'LOG_ACL_ADD_GROUP_LOCAL_F_' => '<strong>Added or edited groups forum access</strong> from %1$s<br />» %2$s', + 'LOG_ACL_ADD_GROUP_LOCAL_M_' => '<strong>Added or edited groups forum moderator access</strong> from %1$s<br />» %2$s', + + 'LOG_ACL_ADD_MOD_LOCAL_M_' => '<strong>Added or edited Moderators</strong> from %1$s<br />» %2$s', + 'LOG_ACL_ADD_FORUM_LOCAL_F_' => '<strong>Added or edited Forum Permissions</strong> from %1$s<br />» %2$s', + + 'LOG_ACL_DEL_ADMIN_GLOBAL_A_' => '<strong>Removed Administrators</strong><br />» %s', + 'LOG_ACL_DEL_MOD_GLOBAL_M_' => '<strong>Removed Global Moderators</strong><br />» %s', + 'LOG_ACL_DEL_MOD_LOCAL_M_' => '<strong>Removed Moderators</strong> from %1$s<br />» %2$s', + 'LOG_ACL_DEL_FORUM_LOCAL_F_' => '<strong>Removed User/Group Forum Permissions</strong> from %1$s<br />» %2$s', + + 'LOG_ACL_TRANSFER_PERMISSIONS' => '<strong>Permissions transfered from</strong><br />» %s', + 'LOG_ACL_RESTORE_PERMISSIONS' => '<strong>Own permissions restored after using permissions from</strong><br />» %s', - 'LOG_ADMIN_AUTH_FAIL' => '<b>Failed administration login attempt</b>', - 'LOG_ADMIN_AUTH_SUCCESS' => '<b>Successful administration login</b>', - - 'LOG_ATTACH_EXT_ADD' => '<b>Added or edited attachment extension</b><br />» %s', - 'LOG_ATTACH_EXT_DEL' => '<b>Removed attachment extension</b><br />» %s', - 'LOG_ATTACH_EXT_UPDATE' => '<b>Updated attachment extension</b><br />» %s', - 'LOG_ATTACH_EXTGROUP_ADD' => '<b>Added extension group</b><br />» %s', - 'LOG_ATTACH_EXTGROUP_EDIT' => '<b>Edited extension group</b><br />» %s', - 'LOG_ATTACH_EXTGROUP_DEL' => '<b>Removed extension group</b><br />» %s', - 'LOG_ATTACH_FILEUPLOAD' => '<b>Orphan File uploaded to Post</b><br />» ID %1$d - %2$s', - 'LOG_ATTACH_ORPHAN_DEL' => '<b>Orphan Files deleted</b><br />» %s', - - 'LOG_BAN_EXCLUDE_USER' => '<b>Excluded user from ban</b> for reason "<i>%1$s</i>"<br />» %2$s ', - 'LOG_BAN_EXCLUDE_IP' => '<b>Excluded ip from ban</b> for reason "<i>%1$s</i>"<br />» %2$s ', - 'LOG_BAN_EXCLUDE_EMAIL' => '<b>Excluded email from ban</b> for reason "<i>%1$s</i>"<br />» %2$s ', - 'LOG_BAN_USER' => '<b>Banned User</b> for reason "<i>%1$s</i>"<br />» %2$s ', - 'LOG_BAN_IP' => '<b>Banned ip</b> for reason "<i>%1$s</i>"<br />» %2$s', - 'LOG_BAN_EMAIL' => '<b>Banned email</b> for reason "<i>%1$s</i>"<br />» %2$s', - 'LOG_UNBAN_USER' => '<b>Unbanned user</b><br />» %s', - 'LOG_UNBAN_IP' => '<b>Unbanned ip</b><br />» %s', - 'LOG_UNBAN_EMAIL' => '<b>Unbanned email</b><br />» %s', - - 'LOG_BBCODE_ADD' => '<b>Added new BBCode</b><br />» %s', - 'LOG_BBCODE_EDIT' => '<b>Edited BBCode</b><br />» %s', - 'LOG_BBCODE_DELETE' => '<b>Deleted BBCode</b><br />» %s', - - 'LOG_BOT_ADDED' => '<b>New bot added</b><br />» %s', - 'LOG_BOT_DELETE' => '<b>Deleted bot</b><br />» %s', - 'LOG_BOT_UPDATED' => '<b>Existing bot updated</b><br />» %s', - - 'LOG_CLEAR_ADMIN' => '<b>Cleared admin log</b>', - 'LOG_CLEAR_CRITICAL' => '<b>Cleared error log</b>', - 'LOG_CLEAR_MOD' => '<b>Cleared moderator log</b>', - 'LOG_CLEAR_USER' => '<b>Cleared user log</b><br />» %s', - 'LOG_CLEAR_USERS' => '<b>Cleared user logs</b>', - - 'LOG_CONFIG_ATTACH' => '<b>Altered attachment settings</b>', - 'LOG_CONFIG_AUTH' => '<b>Altered authentication settings</b>', - 'LOG_CONFIG_AVATAR' => '<b>Altered avatar settings</b>', - 'LOG_CONFIG_COOKIE' => '<b>Altered cookie settings</b>', - 'LOG_CONFIG_EMAIL' => '<b>Altered email settings</b>', - 'LOG_CONFIG_FEATURES' => '<b>Altered board features</b>', - 'LOG_CONFIG_LOAD' => '<b>Altered load settings</b>', - 'LOG_CONFIG_MESSAGE' => '<b>Altered private message settings</b>', - 'LOG_CONFIG_POST' => '<b>Altered post settings</b>', - 'LOG_CONFIG_REGISTRATION' => '<b>Altered user registration settings</b>', - 'LOG_CONFIG_SEARCH' => '<b>Altered search settings</b>', - 'LOG_CONFIG_SECURITY' => '<b>Altered security settings</b>', - 'LOG_CONFIG_SERVER' => '<b>Altered server settings</b>', - 'LOG_CONFIG_SETTINGS' => '<b>Altered board settings</b>', - 'LOG_CONFIG_SIGNATURE' => '<b>Altered signature settings</b>', - 'LOG_CONFIG_VISUAL' => '<b>Altered visual confirmation settings</b>', - - 'LOG_APPROVE_TOPIC' => '<b>Approved topic</b><br />» %s', - 'LOG_BUMP_TOPIC' => '<b>User bumped topic</b><br />» %s', - 'LOG_DELETE_POST' => '<b>Deleted post</b><br />» %s', - 'LOG_DELETE_TOPIC' => '<b>Deleted topic</b><br />» %s', - 'LOG_FORK' => '<b>Copied topic</b><br />» from %s', - 'LOG_LOCK' => '<b>Locked topic</b><br />» %s', - 'LOG_LOCK_POST' => '<b>Locked post</b><br />» %s', - 'LOG_MERGE' => '<b>Merged posts</b> into topic<br />»%s', - 'LOG_MOVE' => '<b>Moved topic</b><br />» from %s', - 'LOG_TOPIC_DELETED' => '<b>Deleted topic</b><br />» %s', - 'LOG_TOPIC_RESYNC' => '<b>Resynchronised topic counters</b><br />» %s', - 'LOG_TOPIC_TYPE_CHANGED' => '<b>Changed topic type</b><br />» %s', - 'LOG_UNLOCK' => '<b>Unlocked topic</b><br />» %s', - 'LOG_UNLOCK_POST' => '<b>Unlocked post</b><br />» %s', - - 'LOG_DISALLOW_ADD' => '<b>Added disallowed username</b><br />» %s', - 'LOG_DISALLOW_DELETE' => '<b>Deleted disallowed username</b>', - - 'LOG_DB_BACKUP' => '<b>Database backup</b>', - 'LOG_DB_RESTORE' => '<b>Database restore</b>', - - 'LOG_DOWNLOAD_EXCLUDE_IP' => '<b>Exluded ip/hostname from download list</b><br />» %s', - 'LOG_DOWNLOAD_IP' => '<b>Added ip/hostname to download list</b><br />» %s', - 'LOG_DOWNLOAD_REMOVE_IP' => '<b>Removed ip/hostname from download list</b><br />» %s', - - 'LOG_ERROR_JABBER' => '<b>Jabber Error</b><br />» %s', - 'LOG_ERROR_EMAIL' => '<b>Email Error</b><br />» %s', + 'LOG_ADMIN_AUTH_FAIL' => '<strong>Failed administration login attempt</strong>', + 'LOG_ADMIN_AUTH_SUCCESS' => '<strong>Successful administration login</strong>', + + 'LOG_ATTACH_EXT_ADD' => '<strong>Added or edited attachment extension</strong><br />» %s', + 'LOG_ATTACH_EXT_DEL' => '<strong>Removed attachment extension</strong><br />» %s', + 'LOG_ATTACH_EXT_UPDATE' => '<strong>Updated attachment extension</strong><br />» %s', + 'LOG_ATTACH_EXTGROUP_ADD' => '<strong>Added extension group</strong><br />» %s', + 'LOG_ATTACH_EXTGROUP_EDIT' => '<strong>Edited extension group</strong><br />» %s', + 'LOG_ATTACH_EXTGROUP_DEL' => '<strong>Removed extension group</strong><br />» %s', + 'LOG_ATTACH_FILEUPLOAD' => '<strong>Orphan File uploaded to Post</strong><br />» ID %1$d - %2$s', + 'LOG_ATTACH_ORPHAN_DEL' => '<strong>Orphan Files deleted</strong><br />» %s', + + 'LOG_BAN_EXCLUDE_USER' => '<strong>Excluded user from ban</strong> for reason "<em>%1$s</em>"<br />» %2$s ', + 'LOG_BAN_EXCLUDE_IP' => '<strong>Excluded IP from ban</strong> for reason "<em>%1$s</em>"<br />» %2$s ', + 'LOG_BAN_EXCLUDE_EMAIL' => '<strong>Excluded email from ban</strong> for reason "<em>%1$s</em>"<br />» %2$s ', + 'LOG_BAN_USER' => '<strong>Banned User</strong> for reason "<em>%1$s</em>"<br />» %2$s ', + 'LOG_BAN_IP' => '<strong>Banned IP</strong> for reason "<em>%1$s</em>"<br />» %2$s', + 'LOG_BAN_EMAIL' => '<strong>Banned email</strong> for reason "<em>%1$s</em>"<br />» %2$s', + 'LOG_UNBAN_USER' => '<strong>Unbanned user</strong><br />» %s', + 'LOG_UNBAN_IP' => '<strong>Unbanned ip</strong><br />» %s', + 'LOG_UNBAN_EMAIL' => '<strong>Unbanned email</strong><br />» %s', + + 'LOG_BBCODE_ADD' => '<strong>Added new BBCode</strong><br />» %s', + 'LOG_BBCODE_EDIT' => '<strong>Edited BBCode</strong><br />» %s', + 'LOG_BBCODE_DELETE' => '<strong>Deleted BBCode</strong><br />» %s', + + 'LOG_BOT_ADDED' => '<strong>New bot added</strong><br />» %s', + 'LOG_BOT_DELETE' => '<strong>Deleted bot</strong><br />» %s', + 'LOG_BOT_UPDATED' => '<strong>Existing bot updated</strong><br />» %s', + + 'LOG_CLEAR_ADMIN' => '<strong>Cleared admin log</strong>', + 'LOG_CLEAR_CRITICAL' => '<strong>Cleared error log</strong>', + 'LOG_CLEAR_MOD' => '<strong>Cleared moderator log</strong>', + 'LOG_CLEAR_USER' => '<strong>Cleared user log</strong><br />» %s', + 'LOG_CLEAR_USERS' => '<strong>Cleared user logs</strong>', + + 'LOG_CONFIG_ATTACH' => '<strong>Altered attachment settings</strong>', + 'LOG_CONFIG_AUTH' => '<strong>Altered authentication settings</strong>', + 'LOG_CONFIG_AVATAR' => '<strong>Altered avatar settings</strong>', + 'LOG_CONFIG_COOKIE' => '<strong>Altered cookie settings</strong>', + 'LOG_CONFIG_EMAIL' => '<strong>Altered email settings</strong>', + 'LOG_CONFIG_FEATURES' => '<strong>Altered board features</strong>', + 'LOG_CONFIG_LOAD' => '<strong>Altered load settings</strong>', + '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_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_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_TOPIC' => '<strong>Deleted topic</strong><br />» %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 %s', + 'LOG_TOPIC_DELETED' => '<strong>Deleted topic</strong><br />» %s', + 'LOG_TOPIC_RESYNC' => '<strong>Resynchronised topic counters</strong><br />» %s', + 'LOG_TOPIC_TYPE_CHANGED' => '<strong>Changed topic type</strong><br />» %s', + 'LOG_UNLOCK' => '<strong>Unlocked topic</strong><br />» %s', + 'LOG_UNLOCK_POST' => '<strong>Unlocked post</strong><br />» %s', + + 'LOG_DISALLOW_ADD' => '<strong>Added disallowed username</strong><br />» %s', + 'LOG_DISALLOW_DELETE' => '<strong>Deleted disallowed username</strong>', + + 'LOG_DB_BACKUP' => '<strong>Database backup</strong>', + 'LOG_DB_RESTORE' => '<strong>Database restore</strong>', + + 'LOG_DOWNLOAD_EXCLUDE_IP' => '<strong>Exluded IP/hostname from download list</strong><br />» %s', + 'LOG_DOWNLOAD_IP' => '<strong>Added IP/hostname to download list</strong><br />» %s', + 'LOG_DOWNLOAD_REMOVE_IP' => '<strong>Removed IP/hostname from download list</strong><br />» %s', + + 'LOG_ERROR_JABBER' => '<strong>Jabber error</strong><br />» %s', + 'LOG_ERROR_EMAIL' => '<strong>Email error</strong><br />» %s', - 'LOG_FORUM_ADD' => '<b>Created new forum</b><br />» %s', - 'LOG_FORUM_DEL_FORUM' => '<b>Deleted forum</b><br />» %s', - 'LOG_FORUM_DEL_FORUMS' => '<b>Deleted forum and its subforums</b><br />» %s', - 'LOG_FORUM_DEL_MOVE_FORUMS' => '<b>Deleted forum and moved subforums</b> to %1$s<br />» %2$s', - 'LOG_FORUM_DEL_MOVE_POSTS' => '<b>Deleted forum and moved posts </b> to %1$s<br />» %2$s', - 'LOG_FORUM_DEL_MOVE_POSTS_FORUMS' => '<b>Deleted forum and its subforums, moved messages</b> to %1$s<br />» %2$s', - 'LOG_FORUM_DEL_MOVE_POSTS_MOVE_FORUMS' => '<b>Deleted forum, moved posts</b> to %1$s <b>and subforums</b> to %2$s<br />» %3$s', - 'LOG_FORUM_DEL_POSTS' => '<b>Deleted forum and its messages</b><br />» %s', - 'LOG_FORUM_DEL_POSTS_FORUMS' => '<b>Deleted forum, its messages and subforums</b><br />» %s', - 'LOG_FORUM_DEL_POSTS_MOVE_FORUMS' => '<b>Deleted forum and its messages, moved subforums</b> to %1$s<br />» %2$s', - 'LOG_FORUM_EDIT' => '<b>Edited forum details</b><br />» %s', - 'LOG_FORUM_MOVE_DOWN' => '<b>Moved forum</b> %1$s <b>below</b> %2$s', - 'LOG_FORUM_MOVE_UP' => '<b>Moved forum</b> %1$s <b>above</b> %2$s', - 'LOG_FORUM_SYNC' => '<b>Re-synchronised forum</b><br />» %s', - - 'LOG_GROUP_CREATED' => '<b>New usergroup created</b><br />» %s', - 'LOG_GROUP_DEFAULTS' => '<b>Group made default for members</b><br />» %s', - 'LOG_GROUP_DELETE' => '<b>Usergroup deleted</b><br />» %s', - 'LOG_GROUP_DEMOTED' => '<b>Leaders demoted in usergroup</b> %1$s<br />» %2$s', - 'LOG_GROUP_PROMOTED' => '<b>Members promoted to leader in usergroup</b> %1$s<br />» %2$s', - 'LOG_GROUP_REMOVE' => '<b>Members removed from usergroup</b> %1$s<br />» %2$s', - 'LOG_GROUP_UPDATED' => '<b>Usergroup details updated</b><br />» %s', - 'LOG_MODS_ADDED' => '<b>Added new leaders to usergroup</b> %1$s<br />» %2$s', - 'LOG_USERS_APPROVED' => '<b>Users approved in usergroup</b> %1$s<br />» %2$s', - 'LOG_USERS_ADDED' => '<b>Added new members to usergroup</b> %1$s<br />» %2$s', - - 'LOG_IMAGESET_ADD_DB' => '<b>Added new imageset to database</b><br />» %s', - 'LOG_IMAGESET_ADD_FS' => '<b>Add new imageset on filesystem</b><br />» %s', - 'LOG_IMAGESET_DELETE' => '<b>Deleted imageset</b><br />» %s', - 'LOG_IMAGESET_EDIT_DETAILS' => '<b>Edited imageset details</b><br />» %s', - 'LOG_IMAGESET_EDIT' => '<b>Edited imageset</b><br />» %s', - 'LOG_IMAGESET_EXPORT' => '<b>Exported imageset</b><br />» %s', - 'LOG_IMAGESET_REFRESHED' => '<b>Refreshed imageset</b><br />» %s', - - 'LOG_INDEX_ACTIVATE' => '<b>Activated inactive users</b><br />» %s', - 'LOG_INDEX_DELETE' => '<b>Deleted inactive users</b><br />» %s', - 'LOG_INDEX_REMIND' => '<b>Sent reminder emails to inactive users</b><br />» %s', - 'LOG_INSTALL_CONVERTED' => '<b>Converted from %1$s to phpBB %2$s</b>', - 'LOG_INSTALL_INSTALLED' => '<b>Installed phpBB %s</b>', - - 'LOG_IP_BROWSER_CHECK' => '<b>Session IP/Browser check failed</b><br />»User IP "<i>%1$s</i>" checked against session IP "<i>%2$s</i>" and user browser string "<i>%3$s</i>" checked against session browser string "<i>%4$s</i>".', - - 'LOG_JAB_CHANGED' => '<b>Jabber account changed</b>', - 'LOG_JAB_PASSCHG' => '<b>Jabber password changed</b>', - 'LOG_JAB_REGISTER' => '<b>Jabber account registered</b>', - 'LOG_JAB_SETTINGS_CHANGED' => '<b>Jabber settings changed</b>', - - 'LOG_LANGUAGE_PACK_DELETED' => '<b>Deleted language pack</b><br />» %s', - 'LOG_LANGUAGE_PACK_INSTALLED' => '<b>Installed language pack</b><br />» %s', - 'LOG_LANGUAGE_PACK_UPDATED' => '<b>Updated language pack details</b><br />» %s', - 'LOG_LANGUAGE_FILE_REPLACED' => '<b>Replaced language file</b><br />» %s', - - 'LOG_MASS_EMAIL' => '<b>Sent mass email</b><br />» %s', - - 'LOG_MCP_CHANGE_POSTER' => '<b>Changed poster in topic "%1$s"</b><br />» from %2$s to %3$s', - - 'LOG_MODULE_DISABLE' => '<b>Module disabled</b>', - 'LOG_MODULE_ENABLE' => '<b>Module enabled</b>', - 'LOG_MODULE_MOVE_DOWN' => '<b>Module moved down</b><br />» %s', - 'LOG_MODULE_MOVE_UP' => '<b>Module moved up</b><br />» %s', - 'LOG_MODULE_REMOVED' => '<b>Module removed</b><br />» %s', - 'LOG_MODULE_ADD' => '<b>Module added</b><br />» %s', - 'LOG_MODULE_EDIT' => '<b>Module edited</b><br />» %s', - - 'LOG_A_ROLE_ADD' => '<b>Admin Role added</b><br />» %s', - 'LOG_A_ROLE_EDIT' => '<b>Admin Role edited</b><br />» %s', - 'LOG_A_ROLE_REMOVED' => '<b>Admin Role removed</b><br />» %s', - 'LOG_F_ROLE_ADD' => '<b>Forum Role added</b><br />» %s', - 'LOG_F_ROLE_EDIT' => '<b>Forum Role edited</b><br />» %s', - 'LOG_F_ROLE_REMOVED' => '<b>Forum Role removed</b><br />» %s', - 'LOG_M_ROLE_ADD' => '<b>Moderator Role added</b><br />» %s', - 'LOG_M_ROLE_EDIT' => '<b>Moderator Role edited</b><br />» %s', - 'LOG_M_ROLE_REMOVED' => '<b>Moderator Role removed</b><br />» %s', - 'LOG_U_ROLE_ADD' => '<b>User Role added</b><br />» %s', - 'LOG_U_ROLE_EDIT' => '<b>User Role edited</b><br />» %s', - 'LOG_U_ROLE_REMOVED' => '<b>User Role removed</b><br />» %s', - - 'LOG_PROFILE_FIELD_ACTIVATE' => '<b>Profile field activated</b><br />» %s', - 'LOG_PROFILE_FIELD_CREATE' => '<b>Profile field added</b><br />» %s', - 'LOG_PROFILE_FIELD_DEACTIVATE' => '<b>Profile field deactivated</b><br />» %s', - 'LOG_PROFILE_FIELD_EDIT' => '<b>Profile field changed</b><br />» %s', - 'LOG_PROFILE_FIELD_REMOVED' => '<b>Profile field removed</b><br />» %s', - - 'LOG_PRUNE' => '<b>Pruned forums</b><br />» %s', - 'LOG_AUTO_PRUNE' => '<b>Auto-pruned forums</b><br />» %s', - 'LOG_PRUNE_USER_DEAC' => '<b>Users deactivated</b><br />» %s', - 'LOG_PRUNE_USER_DEL_DEL' => '<b>Users pruned and posts deleted</b><br />» %s', - 'LOG_PRUNE_USER_DEL_ANON' => '<b>Users pruned and posts retained</b><br />» %s', - - 'LOG_REASON_ADDED' => '<b>Added report/denial reason</b><br />» %s', - 'LOG_REASON_REMOVED' => '<b>Removed report/denial reason</b><br />» %s', - 'LOG_REASON_UPDATED' => '<b>Updated report/denial reason</b><br />» %s', - - 'LOG_RESET_DATE' => '<b>Board start date reset</b>', - 'LOG_RESET_ONLINE' => '<b>Most users online reset</b>', - 'LOG_RESYNC_POSTCOUNTS' => '<b>User postcounts synced</b>', - 'LOG_RESYNC_POST_MARKING' => '<b>Dotted topics synced</b>', - 'LOG_RESYNC_STATS' => '<b>Post, topic and user stats reset</b>', - - 'LOG_STYLE_ADD' => '<b>Added new style</b><br />» %s', - 'LOG_STYLE_DELETE' => '<b>Deleted style</b><br />» %s', - 'LOG_STYLE_EDIT_DETAILS' => '<b>Edited style</b><br />» %s', - 'LOG_STYLE_EXPORT' => '<b>Exported style</b><br />» %s', - - 'LOG_TEMPLATE_ADD_DB' => '<b>Added new template set to database</b><br />» %s', - 'LOG_TEMPLATE_ADD_FS' => '<b>Add new template set on filesystem</b><br />» %s', - 'LOG_TEMPLATE_CACHE_CLEARED' => '<b>Deleted cached versions of template files in template set <i>%1$s</i></b><br />» %2$s', - 'LOG_TEMPLATE_DELETE' => '<b>Deleted template set</b><br />» %s', - 'LOG_TEMPLATE_EDIT' => '<b>Edited template set <i>%1$s</i></b><br />» %2$s', - 'LOG_TEMPLATE_EDIT_DETAILS' => '<b>Edited template details</b><br />» %s', - 'LOG_TEMPLATE_EXPORT' => '<b>Exported template set</b><br />» %s', - 'LOG_TEMPLATE_REFRESHED' => '<b>Refreshed template set</b><br />» %s', - - 'LOG_THEME_ADD_DB' => '<b>Added new theme to database</b><br />» %s', - 'LOG_THEME_ADD_FS' => '<b>Add new theme on filesystem</b><br />» %s', - 'LOG_THEME_DELETE' => '<b>Theme deleted</b><br />» %s', - 'LOG_THEME_EDIT_DETAILS' => '<b>Edited theme details</b><br />» %s', - 'LOG_THEME_EDIT' => '<b>Edited theme <i>%1$s</i></b><br />» Modified class <i>%2$s</i>', - 'LOG_THEME_EDIT_ADD' => '<b>Edited theme <i>%1$s</i></b><br />» Added class <i>%2$s</i>', - 'LOG_THEME_EXPORT' => '<b>Exported theme</b><br />» %s', - 'LOG_THEME_REFRESHED' => '<b>Refreshed theme</b><br />» %s', - - 'LOG_USER_ACTIVE' => '<b>User activated</b><br />» %s', - 'LOG_USER_BAN_USER' => '<b>Banned User via user management</b> for reason "<i>%1$s</i>"<br />» %2$s', - 'LOG_USER_BAN_IP' => '<b>Banned ip via user management</b> for reason "<i>%1$s</i>"<br />» %2$s', - 'LOG_USER_BAN_EMAIL' => '<b>Banned email via user management</b> for reason "<i>%1$s</i>"<br />» %2$s', - 'LOG_USER_DELETED' => '<b>Deleted user</b><br />» %s', - 'LOG_USER_DEL_ATTACH' => '<b>Removed all attachments made by the user</b><br />» %s', - 'LOG_USER_DEL_AVATAR' => '<b>Removed user avatar</b><br />» %s', - 'LOG_USER_DEL_POSTS' => '<b>Removed all posts made by the user</b><br />» %s', - 'LOG_USER_DEL_SIG' => '<b>Removed user signature</b><br />» %s', - 'LOG_USER_INACTIVE' => '<b>User deactivated</b><br />» %s', - 'LOG_USER_MOVE_POSTS' => '<b>Moved user posts</b><br />» posts by "%1$s" to forum "%2$s"', - 'LOG_USER_NEW_PASSWORD' => '<b>Changed user password</b><br />» %s', - 'LOG_USER_REACTIVATE' => '<b>Forced user account re-activation</b><br />» %s', - 'LOG_USER_UPDATE_EMAIL' => '<b>User "%1$s" changed email</b><br />» from "%2$s" to "%3$s"', - 'LOG_USER_UPDATE_NAME' => '<b>Changed username</b><br />» from "%1$s" to "%2$s"', - 'LOG_USER_USER_UPDATE' => '<b>Updated user details</b><br />» %s', - - 'LOG_USER_ACTIVE_USER' => '<b>User account activated</b>', - 'LOG_USER_DEL_AVATAR_USER' => '<b>User avatar removed</b>', - 'LOG_USER_DEL_SIG_USER' => '<b>User signature removed</b>', - 'LOG_USER_FEEDBACK' => '<b>Added user feedback</b><br />» %s', + 'LOG_FORUM_ADD' => '<strong>Created new forum</strong><br />» %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', + 'LOG_FORUM_DEL_MOVE_POSTS' => '<strong>Deleted forum and moved posts </strong> to %1$s<br />» %2$s', + 'LOG_FORUM_DEL_MOVE_POSTS_FORUMS' => '<strong>Deleted forum and its subforums, moved messages</strong> to %1$s<br />» %2$s', + 'LOG_FORUM_DEL_MOVE_POSTS_MOVE_FORUMS' => '<strong>Deleted forum, moved posts</strong> to %1$s <strong>and subforums</strong> to %2$s<br />» %3$s', + 'LOG_FORUM_DEL_POSTS' => '<strong>Deleted forum and its messages</strong><br />» %s', + 'LOG_FORUM_DEL_POSTS_FORUMS' => '<strong>Deleted forum, its messages and subforums</strong><br />» %s', + 'LOG_FORUM_DEL_POSTS_MOVE_FORUMS' => '<strong>Deleted forum and its messages, moved subforums</strong> to %1$s<br />» %2$s', + 'LOG_FORUM_EDIT' => '<strong>Edited forum details</strong><br />» %s', + 'LOG_FORUM_MOVE_DOWN' => '<strong>Moved forum</strong> %1$s <strong>below</strong> %2$s', + '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_GROUP_CREATED' => '<strong>New usergroup created</strong><br />» %s', + 'LOG_GROUP_DEFAULTS' => '<strong>Group made default for members</strong><br />» %s', + 'LOG_GROUP_DELETE' => '<strong>Usergroup deleted</strong><br />» %s', + 'LOG_GROUP_DEMOTED' => '<strong>Leaders demoted in usergroup</strong> %1$s<br />» %2$s', + 'LOG_GROUP_PROMOTED' => '<strong>Members promoted to leader in usergroup</strong> %1$s<br />» %2$s', + '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_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', + 'LOG_IMAGESET_DELETE' => '<strong>Deleted imageset</strong><br />» %s', + 'LOG_IMAGESET_EDIT_DETAILS' => '<strong>Edited imageset details</strong><br />» %s', + 'LOG_IMAGESET_EDIT' => '<strong>Edited imageset</strong><br />» %s', + 'LOG_IMAGESET_EXPORT' => '<strong>Exported imageset</strong><br />» %s', + 'LOG_IMAGESET_REFRESHED' => '<strong>Refreshed imageset</strong><br />» %s', + + 'LOG_INACTIVE_ACTIVATE' => '<strong>Activated inactive users</strong><br />» %s', + 'LOG_INACTIVE_DELETE' => '<strong>Deleted inactive users</strong><br />» %s', + 'LOG_INACTIVE_REMIND' => '<strong>Sent reminder emails to inactive users</strong><br />» %s', + 'LOG_INSTALL_CONVERTED' => '<strong>Converted from %1$s to phpBB %2$s</strong>', + 'LOG_INSTALL_INSTALLED' => '<strong>Installed phpBB %s</strong>', + + 'LOG_IP_BROWSER_CHECK' => '<strong>Session IP/browser check failed</strong><br />»User IP "<em>%1$s</em>" checked against session IP "<em>%2$s</em>" and user browser string "<em>%3$s</em>" checked against session browser string "<em>%4$s</em>".', + + 'LOG_JAB_CHANGED' => '<strong>Jabber account changed</strong>', + 'LOG_JAB_PASSCHG' => '<strong>Jabber password changed</strong>', + 'LOG_JAB_REGISTER' => '<strong>Jabber account registered</strong>', + 'LOG_JAB_SETTINGS_CHANGED' => '<strong>Jabber settings changed</strong>', + + 'LOG_LANGUAGE_PACK_DELETED' => '<strong>Deleted language pack</strong><br />» %s', + 'LOG_LANGUAGE_PACK_INSTALLED' => '<strong>Installed language pack</strong><br />» %s', + 'LOG_LANGUAGE_PACK_UPDATED' => '<strong>Updated language pack details</strong><br />» %s', + 'LOG_LANGUAGE_FILE_REPLACED' => '<strong>Replaced language file</strong><br />» %s', + + 'LOG_MASS_EMAIL' => '<strong>Sent mass email</strong><br />» %s', + + 'LOG_MCP_CHANGE_POSTER' => '<strong>Changed poster in topic "%1$s"</strong><br />» from %2$s to %3$s', + + 'LOG_MODULE_DISABLE' => '<strong>Module disabled</strong>', + 'LOG_MODULE_ENABLE' => '<strong>Module enabled</strong>', + 'LOG_MODULE_MOVE_DOWN' => '<strong>Module moved down</strong><br />» %s', + 'LOG_MODULE_MOVE_UP' => '<strong>Module moved up</strong><br />» %s', + 'LOG_MODULE_REMOVED' => '<strong>Module removed</strong><br />» %s', + 'LOG_MODULE_ADD' => '<strong>Module added</strong><br />» %s', + 'LOG_MODULE_EDIT' => '<strong>Module edited</strong><br />» %s', + + 'LOG_A_ROLE_ADD' => '<strong>Admin role added</strong><br />» %s', + 'LOG_A_ROLE_EDIT' => '<strong>Admin role edited</strong><br />» %s', + 'LOG_A_ROLE_REMOVED' => '<strong>Admin role removed</strong><br />» %s', + 'LOG_F_ROLE_ADD' => '<strong>Forum role added</strong><br />» %s', + 'LOG_F_ROLE_EDIT' => '<strong>Forum role edited</strong><br />» %s', + 'LOG_F_ROLE_REMOVED' => '<strong>Forum role removed</strong><br />» %s', + 'LOG_M_ROLE_ADD' => '<strong>Moderator role added</strong><br />» %s', + 'LOG_M_ROLE_EDIT' => '<strong>Moderator role edited</strong><br />» %s', + 'LOG_M_ROLE_REMOVED' => '<strong>Moderator role removed</strong><br />» %s', + 'LOG_U_ROLE_ADD' => '<strong>User role added</strong><br />» %s', + 'LOG_U_ROLE_EDIT' => '<strong>User role edited</strong><br />» %s', + 'LOG_U_ROLE_REMOVED' => '<strong>User role removed</strong><br />» %s', + + 'LOG_PROFILE_FIELD_ACTIVATE' => '<strong>Profile field activated</strong><br />» %s', + 'LOG_PROFILE_FIELD_CREATE' => '<strong>Profile field added</strong><br />» %s', + 'LOG_PROFILE_FIELD_DEACTIVATE' => '<strong>Profile field deactivated</strong><br />» %s', + 'LOG_PROFILE_FIELD_EDIT' => '<strong>Profile field changed</strong><br />» %s', + 'LOG_PROFILE_FIELD_REMOVED' => '<strong>Profile field removed</strong><br />» %s', + + 'LOG_PRUNE' => '<strong>Pruned forums</strong><br />» %s', + 'LOG_AUTO_PRUNE' => '<strong>Auto-pruned forums</strong><br />» %s', + 'LOG_PRUNE_USER_DEAC' => '<strong>Users deactivated</strong><br />» %s', + 'LOG_PRUNE_USER_DEL_DEL' => '<strong>Users pruned and posts deleted</strong><br />» %s', + 'LOG_PRUNE_USER_DEL_ANON' => '<strong>Users pruned and posts retained</strong><br />» %s', + + 'LOG_REASON_ADDED' => '<strong>Added report/denial reason</strong><br />» %s', + 'LOG_REASON_REMOVED' => '<strong>Removed report/denial reason</strong><br />» %s', + 'LOG_REASON_UPDATED' => '<strong>Updated report/denial reason</strong><br />» %s', + + 'LOG_RESET_DATE' => '<strong>Board start date reset</strong>', + 'LOG_RESET_ONLINE' => '<strong>Most users online reset</strong>', + 'LOG_RESYNC_POSTCOUNTS' => '<strong>User post counts resyncronised</strong>', + 'LOG_RESYNC_POST_MARKING' => '<strong>Dotted topics resyncronised</strong>', + 'LOG_RESYNC_STATS' => '<strong>Post, topic and user statistics resyncronised</strong>', + + 'LOG_STYLE_ADD' => '<strong>Added new style</strong><br />» %s', + 'LOG_STYLE_DELETE' => '<strong>Deleted style</strong><br />» %s', + 'LOG_STYLE_EDIT_DETAILS' => '<strong>Edited style</strong><br />» %s', + 'LOG_STYLE_EXPORT' => '<strong>Exported style</strong><br />» %s', + + 'LOG_TEMPLATE_ADD_DB' => '<strong>Added new template set to database</strong><br />» %s', + 'LOG_TEMPLATE_ADD_FS' => '<strong>Add new template set on filesystem</strong><br />» %s', + 'LOG_TEMPLATE_CACHE_CLEARED' => '<strong>Deleted cached versions of template files in template set <em>%1$s</em></strong><br />» %2$s', + 'LOG_TEMPLATE_DELETE' => '<strong>Deleted template set</strong><br />» %s', + 'LOG_TEMPLATE_EDIT' => '<strong>Edited template set <em>%1$s</em></strong><br />» %2$s', + 'LOG_TEMPLATE_EDIT_DETAILS' => '<strong>Edited template details</strong><br />» %s', + 'LOG_TEMPLATE_EXPORT' => '<strong>Exported template set</strong><br />» %s', + 'LOG_TEMPLATE_REFRESHED' => '<strong>Refreshed template set</strong><br />» %s', + + 'LOG_THEME_ADD_DB' => '<strong>Added new theme to database</strong><br />» %s', + 'LOG_THEME_ADD_FS' => '<strong>Add new theme on filesystem</strong><br />» %s', + 'LOG_THEME_DELETE' => '<strong>Theme deleted</strong><br />» %s', + 'LOG_THEME_EDIT_DETAILS' => '<strong>Edited theme details</strong><br />» %s', + 'LOG_THEME_EDIT' => '<strong>Edited theme <em>%1$s</em></strong><br />» Modified class <em>%2$s</em>', + 'LOG_THEME_EDIT_ADD' => '<strong>Edited theme <em>%1$s</em></strong><br />» Added class <em>%2$s</em>', + 'LOG_THEME_EXPORT' => '<strong>Exported theme</strong><br />» %s', + 'LOG_THEME_REFRESHED' => '<strong>Refreshed theme</strong><br />» %s', + + 'LOG_USER_ACTIVE' => '<strong>User activated</strong><br />» %s', + 'LOG_USER_BAN_USER' => '<strong>Banned User via user management</strong> for reason "<em>%1$s</em>"<br />» %2$s', + 'LOG_USER_BAN_IP' => '<strong>Banned IP via user management</strong> for reason "<em>%1$s</em>"<br />» %2$s', + 'LOG_USER_BAN_EMAIL' => '<strong>Banned email via user management</strong> for reason "<em>%1$s</em>"<br />» %2$s', + '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_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 re-activation</strong><br />» %s', + 'LOG_USER_UPDATE_EMAIL' => '<strong>User "%1$s" changed email</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', + + 'LOG_USER_ACTIVE_USER' => '<strong>User account activated</strong>', + 'LOG_USER_DEL_AVATAR_USER' => '<strong>User avatar removed</strong>', + 'LOG_USER_DEL_SIG_USER' => '<strong>User signature removed</strong>', + 'LOG_USER_FEEDBACK' => '<strong>Added user feedback</strong><br />» %s', 'LOG_USER_GENERAL' => '%s', - 'LOG_USER_INACTIVE_USER' => '<b>User account de-activated</b>', - 'LOG_USER_LOCK' => '<b>User locked own topic</b><br />» %s', - 'LOG_USER_MOVE_POSTS_USER' => '<b>Moved all posts to forum "%s"</b>', - 'LOG_USER_REACTIVATE_USER' => '<b>Forced user account re-activation</b>', - 'LOG_USER_UNLOCK' => '<b>User unlocked own topic</b><br />» %s', - 'LOG_USER_WARNING' => '<b>Added user warning</b><br />»%s', - 'LOG_USER_WARNING_BODY' => '<b>The following warning was issued to this user</b><br />»%s', - - 'LOG_USER_GROUP_CHANGE' => '<b>User changed default group</b><br />» %s', - 'LOG_USER_GROUP_DEMOTE' => '<b>User demoted as leaders from usergroup</b><br />» %s', - 'LOG_USER_GROUP_JOIN' => '<b>User joined group</b><br />» %s', - 'LOG_USER_GROUP_JOIN_PENDING' => '<b>User joined group and needs to be approved</b><br />» %s', - 'LOG_USER_GROUP_RESIGN' => '<b>User resigned membership from group</b><br />» %s', - - 'LOG_WORD_ADD' => '<b>Added word censor</b><br />» %s', - 'LOG_WORD_DELETE' => '<b>Deleted word censor</b><br />» %s', - 'LOG_WORD_EDIT' => '<b>Edited word censor</b><br />» %s', + 'LOG_USER_INACTIVE_USER' => '<strong>User account de-activated</strong>', + 'LOG_USER_LOCK' => '<strong>User locked own topic</strong><br />» %s', + 'LOG_USER_MOVE_POSTS_USER' => '<strong>Moved all posts to forum "%s"</strong>', + 'LOG_USER_REACTIVATE_USER' => '<strong>Forced user account re-activation</strong>', + 'LOG_USER_UNLOCK' => '<strong>User unlocked own topic</strong><br />» %s', + 'LOG_USER_WARNING' => '<strong>Added user warning</strong><br />»%s', + 'LOG_USER_WARNING_BODY' => '<strong>The following warning was issued to this user</strong><br />»%s', + + 'LOG_USER_GROUP_CHANGE' => '<strong>User changed default group</strong><br />» %s', + 'LOG_USER_GROUP_DEMOTE' => '<strong>User demoted as leaders from usergroup</strong><br />» %s', + 'LOG_USER_GROUP_JOIN' => '<strong>User joined group</strong><br />» %s', + '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_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', )); ?>
\ No newline at end of file diff --git a/phpBB/language/en/acp/database.php b/phpBB/language/en/acp/database.php index 16e10978ff..b03348ba46 100644 --- a/phpBB/language/en/acp/database.php +++ b/phpBB/language/en/acp/database.php @@ -28,33 +28,38 @@ if (empty($lang) || !is_array($lang)) // 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 -// Banning +// Database Backup/Restore $lang = array_merge($lang, array( - 'DATABASE' => 'Database Utilities', - 'ACP_BACKUP_EXPLAIN' => 'Here you can backup all your phpBB related data. You may store the resulting archive in your store/ folder or download it directly. Depending on your server configuration you be able to compress the file in a number of formats. If you wish to include any additional "custom" tables please list them in the additional tables field, separated by commas. ', + 'ACP_BACKUP_EXPLAIN' => 'Here you can backup all your phpBB related data. You may store the resulting archive in your <samp>store/</samp> folder or download it directly. Depending on your server configuration you be able to compress the file in a number of formats.', + 'ACP_RESTORE_EXPLAIN' => 'This will perform a full restore of all phpBB tables from a saved file. If your server supports it you may use a gzip or bzip2 compressed text file and it will automatically be decompressed. <strong>WARNING</strong> This will overwrite any existing data. The restore may take a long time to process please do not move from this page till it is complete.', + + 'BACKUP_DELETE' => 'The backup file has been deleted successfully.', + 'BACKUP_INVALID' => 'The selected file to backup is invalid.', 'BACKUP_OPTIONS' => 'Backup options', + 'BACKUP_SUCCESS' => 'The backup file has been created successfully.', 'BACKUP_TYPE' => 'Backup type', - 'BACKUP_INVALID' => 'The selected file to backup is invalid', - 'START_BACKUP' => 'Start Backup', - 'FULL_BACKUP' => 'Full', - 'STRUCTURE_ONLY' => 'Structure Only', + + 'DATABASE' => 'Database utilities', 'DATA_ONLY' => 'Data only', - 'TABLE_SELECT' => 'Table Select', - 'FILE_TYPE' => 'File Type', - 'STORE_LOCAL' => 'Store file locally', - 'SELECT_ALL' => 'Select all', + 'DELETE_BACKUP' => 'Delete backup', 'DESELECT_ALL' => 'Deselect all', - 'BACKUP_SUCCESS' => 'The backup file has been created successfully', - 'BACKUP_DELETE' => 'The backup file has been deleted successfully', + 'DOWNLOAD_BACKUP' => 'Download backup', + + 'FILE_TYPE' => 'File type', + 'FULL_BACKUP' => 'Full', - 'STORE_AND_DOWNLOAD' => 'Store and Download', - 'ACP_RESTORE_EXPLAIN' => 'This will perform a full restore of all phpBB tables from a saved file. If your server supports it you may use a gzip or bzip2 compressed text file and it will automatically be decompressed. <b>WARNING</b> This will overwrite any existing data. The restore may take a long time to process please do not move from this page till it is complete.', - 'SELECT_FILE' => 'Select a file', 'RESTORE_OPTIONS' => 'Restore options', - 'START_RESTORE' => 'Start Restore', - 'DELETE_BACKUP' => 'Delete Backup', - 'DOWNLOAD_BACKUP' => 'Download Backup', - 'RESTORE_SUCCESS' => 'The Database has been successfully restored.<br /><br />Your board should be back to the state it was when the backup was made.', + 'RESTORE_SUCCESS' => 'The database has been successfully restored.<br /><br />Your board should be back to the state it was when the backup was made.', + + 'SELECT_ALL' => 'Select all', + 'SELECT_FILE' => 'Select a file', + 'START_BACKUP' => 'Start backup', + 'START_RESTORE' => 'Start restore', + 'STORE_AND_DOWNLOAD' => 'Store and download', + 'STORE_LOCAL' => 'Store file locally', + 'STRUCTURE_ONLY' => 'Structure only', + + 'TABLE_SELECT' => 'Table select', )); ?>
\ No newline at end of file diff --git a/phpBB/language/en/acp/email.php b/phpBB/language/en/acp/email.php index c72bdbcb68..1bb377fc2f 100644 --- a/phpBB/language/en/acp/email.php +++ b/phpBB/language/en/acp/email.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -30,8 +32,8 @@ if (empty($lang) || !is_array($lang)) // Bot settings $lang = array_merge($lang, array( - 'ACP_MASS_EMAIL_EXPLAIN' => 'Here you can email a message to either all of your users, or all users of a specific group. To do this, an email will be sent out to the administrative email address supplied, with a blind carbon copy sent to all recipients. If you are emailing a large group of people please be patient after submitting and do not stop the page halfway through. It is normal for a mass emailing to take a long time, you will be notified when the script has completed', - 'ALL_USERS' => 'All Users', + 'ACP_MASS_EMAIL_EXPLAIN' => 'Here you can email a message to either all of your users or all users of a specific group. To do this, an email will be sent out to the administrative email address supplied, with a blind carbon copy sent to all recipients. If you are emailing a large group of people please be patient after submitting and do not stop the page halfway through. It is normal for a mass emailing to take a long time, you will be notified when the script has completed', + 'ALL_USERS' => 'All users', 'COMPOSE' => 'Compose', @@ -41,7 +43,7 @@ $lang = array_merge($lang, array( 'LOG_SESSION' => 'Log mail session to critical log', - 'SEND_IMMEDIATLY' => 'Send immediatly', + 'SEND_IMMEDIATLY' => 'Send immediately', 'SEND_TO_GROUP' => 'Send to group', 'SEND_TO_USERS' => 'Send to users', 'SEND_TO_USERS_EXPLAIN' => 'Entering names here will override any group selected above. Enter each username on a new line.', @@ -49,7 +51,7 @@ $lang = array_merge($lang, array( 'MAIL_HIGH_PRIORITY' => 'High', 'MAIL_LOW_PRIORITY' => 'Low', 'MAIL_NORMAL_PRIORITY' => 'Normal', - 'MAIL_PRIORITY' => 'Mail Priority', + 'MAIL_PRIORITY' => 'Mail priority', 'MASS_MESSAGE' => 'Your message', 'MASS_MESSAGE_EXPLAIN' => 'Please note that you may enter only plain text. All markup will be removed before sending.', diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php index eec59c446b..21ddc34558 100644 --- a/phpBB/language/en/acp/forums.php +++ b/phpBB/language/en/acp/forums.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -30,11 +32,11 @@ if (empty($lang) || !is_array($lang)) // Forum Admin $lang = array_merge($lang, array( - 'AUTO_PRUNE_DAYS' => 'Auto-prune Post Age', + 'AUTO_PRUNE_DAYS' => 'Auto-prune post age', 'AUTO_PRUNE_DAYS_EXPLAIN' => 'Number of days since last post after which topic is removed.', - 'AUTO_PRUNE_FREQ' => 'Auto-prune Frequency', + 'AUTO_PRUNE_FREQ' => 'Auto-prune frequency', 'AUTO_PRUNE_FREQ_EXPLAIN' => 'Time in days between pruning events.', - 'AUTO_PRUNE_VIEWED' => 'Auto-prune Post Viewed Age', + 'AUTO_PRUNE_VIEWED' => 'Auto-prune post viewed age', 'AUTO_PRUNE_VIEWED_EXPLAIN' => 'Number of days since topic was viewed after which topic is removed.', 'COPY_PERMISSIONS' => 'Copy permissions from', @@ -58,50 +60,50 @@ $lang = array_merge($lang, array( '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', - 'FORUM_ADMIN' => 'Forum Administration', + 'FORUM_ADMIN' => 'Forum administration', 'FORUM_ADMIN_EXPLAIN' => 'In phpBB3 there are no categories, everything is forum based. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category). Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum.', - 'FORUM_AUTO_PRUNE' => 'Enable Auto-Pruning', + 'FORUM_AUTO_PRUNE' => 'Enable auto-pruning', 'FORUM_AUTO_PRUNE_EXPLAIN' => 'Prunes the forum of topics, set the frequency/age parameters below.', 'FORUM_CREATED' => 'Forum created successfully.', 'FORUM_DATA_NEGATIVE' => 'Pruning parameters cannot be negative.', - 'FORUM_DELETE' => 'Delete Forum', + 'FORUM_DELETE' => 'Delete forum', 'FORUM_DELETE_EXPLAIN' => 'The form below will allow you to delete a forum and decide where you want to put all topics (or forums) it contained.', - 'FORUM_DELETED' => 'Forum successfully deleted', + 'FORUM_DELETED' => 'Forum successfully deleted.', 'FORUM_DESC' => 'Description', 'FORUM_DESC_EXPLAIN' => 'Any markup entered here will displayed as is.', 'FORUM_EDIT_EXPLAIN' => 'The form below will allow you to customise this forum. Please note that moderation and post count controls are set via forum permissions for each user or usergroup.', 'FORUM_IMAGE' => 'Forum Image', - 'FORUM_IMAGE_EXPLAIN' => 'Location, relative to the phpBB root directory, of an image to associate with this forum.', - 'FORUM_LINK_EXPLAIN' => 'Full URL (including the protocol, for example http://) to location clicking this forum will take the user.', - 'FORUM_LINK_TRACK' => 'Track Link Redirects', + 'FORUM_IMAGE_EXPLAIN' => 'Location, relative to the phpBB root directory, of an additional image to associate with this forum.', + 'FORUM_LINK_EXPLAIN' => 'Full URL (including the protocol, for example <samp>http://</samp>) to location clicking this forum will take the user.', + 'FORUM_LINK_TRACK' => 'Track link redirects', 'FORUM_LINK_TRACK_EXPLAIN' => 'Records the number of times a forum link was clicked.', - 'FORUM_NAME' => 'Forum Name', + 'FORUM_NAME' => 'Forum name', 'FORUM_NAME_EMPTY' => 'You must enter a name for this forum.', - 'FORUM_PARENT' => 'Parent Forum', - 'FORUM_PASSWORD' => 'Forum Password', - 'FORUM_PASSWORD_CONFIRM' => 'Confirm Forum Password', + 'FORUM_PARENT' => 'Parent forum', + 'FORUM_PASSWORD' => 'Forum password', + 'FORUM_PASSWORD_CONFIRM' => 'Confirm forum password', 'FORUM_PASSWORD_CONFIRM_EXPLAIN' => 'Only needs to be set if a forum password is entered.', 'FORUM_PASSWORD_EXPLAIN' => 'Defines a password for this forum, use the permission system in preference.', 'FORUM_PASSWORD_MISMATCH' => 'The passwords you entered did not match.', 'FORUM_PRUNE_SETTINGS' => 'Forum prune settings', 'FORUM_RESYNCED' => 'Forum "%s" successfully resynced', - 'FORUM_RULES_EXPLAIN' => 'Forum Rules are displayed at any page within the given forum.', - 'FORUM_RULES_LINK' => 'Link to Forum Rules', - 'FORUM_RULES_LINK_EXPLAIN' => 'You are able to enter the URL of the page/post containing your forum rules here. This setting will override the Forum Rules text you specified.', - 'FORUM_RULES_PREVIEW' => 'Forum Rules preview', - 'FORUM_SETTINGS' => 'Forum Settings', - 'FORUM_STATUS' => 'Forum Status', - 'FORUM_STYLE' => 'Forum Style', - 'FORUM_TOPICS_PAGE' => 'Topics Per Page', + 'FORUM_RULES_EXPLAIN' => 'Forum rules are displayed at any page within the given forum.', + 'FORUM_RULES_LINK' => 'Link to forum rules', + 'FORUM_RULES_LINK_EXPLAIN' => 'You are able to enter the URL of the page/post containing your forum rules here. This setting will override the forum rules text you specified.', + 'FORUM_RULES_PREVIEW' => 'Forum rules preview', + 'FORUM_SETTINGS' => 'Forum settings', + 'FORUM_STATUS' => 'Forum status', + 'FORUM_STYLE' => 'Forum style', + 'FORUM_TOPICS_PAGE' => 'Topics per page', 'FORUM_TOPICS_PAGE_EXPLAIN' => 'If non-zero this value will override the default topics per page setting.', - 'FORUM_TYPE' => 'Forum Type', + 'FORUM_TYPE' => 'Forum type', 'FORUM_UPDATED' => 'Forum informations updated successfully.', - 'GENERAL_FORUM_SETTINGS' => 'General Forum Settings', + 'GENERAL_FORUM_SETTINGS' => 'General forum settings', 'LINK' => 'Link', - 'LIST_INDEX' => 'List Forum On Index', - 'LIST_INDEX_EXPLAIN' => 'Displays a link to this forum under the root parent forum on the index.', + 'LIST_INDEX' => 'List forum in subforum listings', + 'LIST_INDEX_EXPLAIN' => 'Displays a link to this forum under the parent forums subforum listing if one exist.', 'LOCKED' => 'Locked', 'MOVE_POSTS_TO' => 'Move posts', @@ -109,19 +111,22 @@ $lang = array_merge($lang, array( 'NO_DESTINATION_FORUM' => 'You have not specified a forum to move content to', 'NO_FORUM_ACTION' => 'No action defined for what happens with the forum content', - 'NO_PARENT' => 'No Parent', + 'NO_PARENT' => 'No parent', 'NO_PERMISSIONS' => 'Do not copy permissions', - 'NO_PERMISSION_FORUM_ADD' => 'You do not have the neccessary permissions to add forums', - 'NO_PERMISSION_FORUM_DELETE' => 'You do not have the neccessary permissions to delete forums', + 'NO_PERMISSION_FORUM_ADD' => 'You do not have the necessary permissions to add forums.', + 'NO_PERMISSION_FORUM_DELETE' => 'You do not have the necessary permissions to delete forums.', - 'PARENT_NOT_EXIST' => 'Parent does not exist', - 'PRUNE_ANNOUNCEMENTS' => 'Prune Announcements', - 'PRUNE_STICKY' => 'Prune Stickies', - 'PRUNE_OLD_POLLS' => 'Prune Old Polls', + 'PARENT_NOT_EXIST' => 'Parent does not exist.', + 'PRUNE_ANNOUNCEMENTS' => 'Prune announcements', + 'PRUNE_STICKY' => 'Prune stickies', + 'PRUNE_OLD_POLLS' => 'Prune old polls', 'PRUNE_OLD_POLLS_EXPLAIN' => 'Removes topics with polls not voted in for post age days.', 'REDIRECT_ACL' => 'Now you are able to %sset permissions%s for this forum.', + 'SYNC_IN_PROGRESS' => 'Synchronizing forum', + 'SYNC_IN_PROGRESS_EXPLAIN' => 'Currently resyncing topic range %1$d/%2$d.', + 'TYPE_CAT' => 'Category', 'TYPE_FORUM' => 'Forum', 'TYPE_LINK' => 'Link', diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php index 03c02b97fc..582dbb3465 100644 --- a/phpBB/language/en/acp/groups.php +++ b/phpBB/language/en/acp/groups.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -29,8 +31,8 @@ if (empty($lang) || !is_array($lang)) // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine $lang = array_merge($lang, array( - 'ACP_GROUPS_MANAGE_EXPLAIN' => 'From this panel you can administer all your usergroups, you can delete, create and edit existing groups. You may choose moderators, toggle open/closed group status and set the group name and description.', - 'ADD_USERS' => 'Add Users', + 'ACP_GROUPS_MANAGE_EXPLAIN' => 'From this panel you can administrate all your usergroups, you can delete, create and edit existing groups. You may choose moderators, toggle open/closed group status and set the group name and description.', + 'ADD_USERS' => 'Add users', 'ADD_USERS_EXPLAIN' => 'Here you can add new users to the group. You may select whether this group becomes the new default for the selected users. Additionally you can define them as group leaders. Please enter each username on a seperate line.', 'COPY_PERMISSIONS' => 'Copy permissions from', @@ -40,17 +42,17 @@ $lang = array_merge($lang, array( 'GROUPS_NO_MEMBERS' => 'This group has no members', 'GROUPS_NO_MODS' => 'No group leaders defined', 'GROUP_APPROVE' => 'Approve', - 'GROUP_APPROVED' => 'Approved Members', + 'GROUP_APPROVED' => 'Approved members', 'GROUP_AVATAR' => 'Group avatar', 'GROUP_AVATAR_EXPLAIN' => 'This image will be displayed in the Group Control Panel.', 'GROUP_CLOSED' => 'Closed', 'GROUP_COLOR' => 'Group colour', 'GROUP_COLOR_EXPLAIN' => 'Defines the colour members usernames will appear in, leave blank for user default.', - 'GROUP_CREATED' => 'Group has been created successfully', + 'GROUP_CREATED' => 'Group has been created successfully.', 'GROUP_DEFAULT' => 'Default', - 'GROUP_DEFS_UPDATED' => 'Default group set for all selected members', + 'GROUP_DEFS_UPDATED' => 'Default group set for all selected members.', 'GROUP_DELETE' => 'Delete', - 'GROUP_DELETED' => 'Group deleted and user default groups set successfully', + 'GROUP_DELETED' => 'Group deleted and user default groups set successfully.', 'GROUP_DEMOTE' => 'Demote', 'GROUP_DESC' => 'Group description', 'GROUP_DETAILS' => 'Group details', @@ -69,11 +71,11 @@ $lang = array_merge($lang, array( 'GROUP_MESSAGE_LIMIT' => 'Group private message limit per folder', 'GROUP_MESSAGE_LIMIT_EXPLAIN' => 'This setting overrides the per-user folder message limit. A value of 0 means the user default limit will be used.', 'GROUP_MODS_ADDED' => 'New group moderators added successfully.', - 'GROUP_MODS_DEMOTED' => 'Group leaders demoted successfully', - 'GROUP_MODS_PROMOTED' => 'Group members promoted successfully', + 'GROUP_MODS_DEMOTED' => 'Group leaders demoted successfully.', + 'GROUP_MODS_PROMOTED' => 'Group members promoted successfully.', 'GROUP_NAME' => 'Group name', 'GROUP_OPEN' => 'Open', - 'GROUP_PENDING' => 'Pending Members', + 'GROUP_PENDING' => 'Pending members', 'GROUP_PROMOTE' => 'Promote', 'GROUP_RANK' => 'Group rank', 'GROUP_RECEIVE_PM' => 'Group able to receive private messages', @@ -87,23 +89,24 @@ $lang = array_merge($lang, array( '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', + 'GROUP_USERS_REMOVE' => 'Users removed from group and new defaults set successfully.', 'MAKE_DEFAULT_FOR_ALL' => 'Make default group for every member', 'MEMBERS' => 'Members', - 'NO_GROUP' => 'No group specified', + 'NO_GROUP' => 'No group specified.', 'NO_PERMISSIONS' => 'Do not copy permissions', + 'NO_USERS' => 'You haven’t entered any users.', 'SPECIAL_GROUPS' => 'Predefined groups', - 'SPECIAL_GROUPS_EXPLAIN' => 'Pre-defined groups are special groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings. By clicking "Default" you can set the relevant group to the default for all its members.', + 'SPECIAL_GROUPS_EXPLAIN' => 'Pre-defined groups are special groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings. By clicking “Default†you can set the relevant group to the default for all its members.', 'TOTAL_MEMBERS' => 'Members', 'USERS_APPROVED' => 'Users approved successfully.', 'USER_DEFAULT' => 'User default', 'USER_DEF_GROUPS' => 'User defined groups', - 'USER_DEF_GROUPS_EXPLAIN' => 'These are groups created by you or another admin on this board. You can manage memberships as well as edit group properties or even delete the group. By clicking "Default" you can set the relevant group to the default for all its members.', + 'USER_DEF_GROUPS_EXPLAIN' => 'These are groups created by you or another admin on this board. You can manage memberships as well as edit group properties or even delete the group. By clicking “Default†you can set the relevant group to the default for all its members.', 'USER_GROUP_DEFAULT' => 'Set as default group', 'USER_GROUP_DEFAULT_EXPLAIN' => 'Saying yes here will set this group as the default group for the added users', 'USER_GROUP_LEADER' => 'Set as group leader', diff --git a/phpBB/language/en/acp/index.htm b/phpBB/language/en/acp/index.htm new file mode 100644 index 0000000000..ee1f723a7d --- /dev/null +++ b/phpBB/language/en/acp/index.htm @@ -0,0 +1,10 @@ +<html> +<head> +<title></title> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> +</head> + +<body bgcolor="#FFFFFF" text="#000000"> + +</body> +</html> diff --git a/phpBB/language/en/acp/language.php b/phpBB/language/en/acp/language.php index 9aa8c06b9a..acfc45e916 100644 --- a/phpBB/language/en/acp/language.php +++ b/phpBB/language/en/acp/language.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -29,29 +31,29 @@ if (empty($lang) || !is_array($lang)) // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine $lang = array_merge($lang, array( - 'ACP_FILES' => 'Admin Language Files', + 'ACP_FILES' => 'Admin language files', 'ACP_LANGUAGE_PACKS_EXPLAIN' => 'Here you are able to install/remove language packs', - 'EMAIL_FILES' => 'Email Templates', + 'EMAIL_FILES' => 'Email templates', - 'FILE_CONTENTS' => 'File Contents', + 'FILE_CONTENTS' => 'File contents', 'FILE_FROM_STORAGE' => 'File from storage folder', - 'HELP_FILES' => 'Help Files', + 'HELP_FILES' => 'Help files', 'INSTALLED_LANGUAGE_PACKS' => 'Installed language packs', 'INVALID_LANGUAGE_PACK' => 'The selected language pack seems to be not valid. Please verify the language pack and upload it again if necessary.', 'INVALID_UPLOAD_METHOD' => 'The selected upload method is not valid, please choose a different method.', - 'LANGUAGE_DETAILS_UPDATED' => 'Language details successfully updated', + 'LANGUAGE_DETAILS_UPDATED' => 'Language details successfully updated.', 'LANGUAGE_ENTRIES' => 'Language Entries', - 'LANGUAGE_ENTRIES_EXPLAIN' => 'Here you are able to change existing language pack entries or not already translated ones.<br /><b>Note:</b> Once you changed a language file, the changes will be stored within a seperate folder for you to download. The changes will not be seen by your users until you replace the original language files at your webspace (by uploading them).', - 'LANGUAGE_FILES' => 'Language Files', - 'LANGUAGE_KEY' => 'Language Key', + 'LANGUAGE_ENTRIES_EXPLAIN' => 'Here you are able to change existing language pack entries or not already translated ones.<br /><strong>Note:</strong> Once you changed a language file, the changes will be stored within a seperate folder for you to download. The changes will not be seen by your users until you replace the original language files at your webspace (by uploading them).', + 'LANGUAGE_FILES' => 'Language files', + 'LANGUAGE_KEY' => 'Language key', 'LANGUAGE_PACK_ALREADY_INSTALLED' => 'This language pack is already installed.', - 'LANGUAGE_PACK_DELETED' => 'The language pack <b>%s</b> has been removed successfully. All users using this language have been resetted to the boards default language.', - 'LANGUAGE_PACK_DETAILS' => 'Language Pack Details', - 'LANGUAGE_PACK_INSTALLED' => 'The language pack <b>%s</b> has been successfully installed.', + 'LANGUAGE_PACK_DELETED' => 'The language pack <strong>%s</strong> has been removed successfully. All users using this language have been resetted to the boards default language.', + 'LANGUAGE_PACK_DETAILS' => 'Language pack details', + 'LANGUAGE_PACK_INSTALLED' => 'The language pack <strong>%s</strong> has been successfully installed.', 'LANGUAGE_PACK_ISO' => 'ISO', 'LANGUAGE_PACK_LOCALNAME' => 'Local name', 'LANGUAGE_PACK_NAME' => 'Name', @@ -63,30 +65,32 @@ $lang = array_merge($lang, array( 'LANG_ISO_CODE' => 'ISO Code', 'LANG_LOCAL_NAME' => 'Local name', - 'MISSING_LANGUAGE_FILE' => 'Missing Language File: <span style="color:red">%s</span>', - 'MISSING_LANG_VARIABLES' => 'Missing Language Variables', - 'MODS_FILES' => 'Mods Language Files', + 'MISSING_LANGUAGE_FILE' => 'Missing Language File: <strong style="color:red">%s</strong>', + 'MISSING_LANG_VARIABLES' => 'Missing language variables', + 'MODS_FILES' => 'MODs language files', - 'NO_LANG_ID' => 'You haven\'t specified a language pack', + 'NO_FILE_SELECTED' => 'You haven’t specified a language file.', + 'NO_LANG_ID' => 'You haven’t specified a language pack.', 'NO_REMOVE_DEFAULT_LANG' => 'You are not able to remove the default language pack.<br />If you want to remove this language pack, change your boards default language first.', 'NO_UNINSTALLED_LANGUAGE_PACKS' => 'No uninstalled language packs', 'REMOVE_FROM_STORAGE_FOLDER' => 'Remove from storage folder', 'SELECT_DOWNLOAD_FORMAT' => 'Select download format', - 'SUBMIT_AND_DOWNLOAD' => 'Submit and Download File', - 'SUBMIT_AND_UPLOAD' => 'Submit and Upload File', + 'SUBMIT_AND_DOWNLOAD' => 'Submit and download file', + 'SUBMIT_AND_UPLOAD' => 'Submit and upload file', 'THOSE_MISSING_LANG_FILES' => 'The following language files are missing from the %s language folder', - 'THOSE_MISSING_LANG_VARIABLES' => 'The following language variables are missing from the <b>%s</b> language pack', + 'THOSE_MISSING_LANG_VARIABLES' => 'The following language variables are missing from the <strong>%s</strong> language pack', 'UNINSTALLED_LANGUAGE_PACKS' => 'Uninstalled language packs', - 'UPLOAD_COMPLETED' => 'The upload has completed', + 'UNABLE_TO_WRITE_FILE' => 'The file could not be written to %s.', + 'UPLOAD_COMPLETED' => 'The upload was completed successfully.', 'UPLOAD_METHOD' => 'Upload method', 'UPLOAD_SETTINGS' => 'Upload settings', - 'WRONG_LANGUAGE_FILE' => 'Selected language file is invalid', + 'WRONG_LANGUAGE_FILE' => 'Selected language file is invalid.', )); ?>
\ No newline at end of file diff --git a/phpBB/language/en/acp/modules.php b/phpBB/language/en/acp/modules.php index b5055570c1..5a0d98c63b 100644 --- a/phpBB/language/en/acp/modules.php +++ b/phpBB/language/en/acp/modules.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -29,16 +31,16 @@ if (empty($lang) || !is_array($lang)) // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine $lang = array_merge($lang, array( - 'ACP_MODULE_MANAGEMENT_EXPLAIN' => 'Here you are able to manage all kind of modules. Please note that if you place the same module under different categories, the category selected will be the first one found within the tree.', + 'ACP_MODULE_MANAGEMENT_EXPLAIN' => 'Here you are able to manage all kind of modules. Please note that the ACP has a three-level menu structure (Category -> Category -> Module) whereby the others having a two-level menu structure (Category -> Module) which must be kept. Please also be aware that you may lock out yourself if you disable or delete the modules responsible for the module management itself.', 'ADD_MODULE' => 'Add module', 'ADD_MODULE_CONFIRM' => 'Are you sure you want to add the selected module with the selected mode?', - 'ADD_MODULE_TITLE' => 'Add Module', + 'ADD_MODULE_TITLE' => 'Add module', 'CANNOT_REMOVE_MODULE' => 'Unable to remove module, it has assigned childs. Please remove or move all childs before performing this action', 'CATEGORY' => 'Category', - 'CHOOSE_MODE' => 'Choose Module Mode', + 'CHOOSE_MODE' => 'Choose module mode', 'CHOOSE_MODE_EXPLAIN' => 'Choose the modules mode being used.', - 'CHOOSE_MODULE' => 'Choose Module', + 'CHOOSE_MODULE' => 'Choose module', 'CHOOSE_MODULE_EXPLAIN' => 'Choose the file being called by this module.', 'CREATE_MODULE' => 'Create new module', @@ -49,27 +51,27 @@ $lang = array_merge($lang, array( 'EDIT_MODULE' => 'Edit module', 'EDIT_MODULE_EXPLAIN' => 'Here you are able to enter module specific settings', - 'HIDDEN_MODULE' => 'Hidden Module', + 'HIDDEN_MODULE' => 'Hidden module', 'MODULE' => 'Module', - 'MODULE_ADDED' => 'Module successfully added', - 'MODULE_DELETED' => 'Module successfully removed', + 'MODULE_ADDED' => 'Module successfully added.', + 'MODULE_DELETED' => 'Module successfully removed.', 'MODULE_DISPLAYED' => 'Module displayed', 'MODULE_DISPLAYED_EXPLAIN' => 'If you do not wish to display this module, but want to use it, set this to no.', - 'MODULE_EDITED' => 'Module successfully edited', + 'MODULE_EDITED' => 'Module successfully edited.', 'MODULE_ENABLED' => 'Module enabled', - 'MODULE_LANGNAME' => 'Module Language Name', + 'MODULE_LANGNAME' => 'Module language name', 'MODULE_LANGNAME_EXPLAIN' => 'Enter the displayed module name. Use language constant if name is served from language file.', 'MODULE_TYPE' => 'Module type', 'NO_CATEGORY_TO_MODULE' => 'Unable to turn category into module. Please remove/move all childs before performing this action.', - 'NO_MODULE' => 'No module found', - 'NO_MODULE_ID' => 'No module id specified', - 'NO_MODULE_LANGNAME' => 'No module language name specified', + 'NO_MODULE' => 'No module found.', + 'NO_MODULE_ID' => 'No module id specified.', + 'NO_MODULE_LANGNAME' => 'No module language name specified.', 'NO_PARENT' => 'No Parent', 'PARENT' => 'Parent', - 'PARENT_NO_EXIST' => 'Parent does not exist', + 'PARENT_NO_EXIST' => 'Parent does not exist.', 'SELECT_MODULE' => 'Select a module', )); diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index 1b0513b2f3..b66389907c 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -50,23 +52,23 @@ $lang = array_merge($lang, array( ', 'ACL_NEVER' => 'Never', - 'ACL_SET' => 'Setting Permissions', - 'ACL_SET_EXPLAIN' => 'Permissions are based on a simple YES/NO system. Setting an option to NEVER for a user or usergroup overrides any other value assigned to it. If you do not wish to assign a value for an option for this user or group select NO. If values are assigned for this option elsewhere they will be used in preference, else NEVER is assumed. All objects marked (with the checkbox in front of them) will copy the permission set you defined.', + 'ACL_SET' => 'Setting permissions', + 'ACL_SET_EXPLAIN' => 'Permissions are based on a simple <samp>YES</samp>/<samp>NO</samp> system. Setting an option to <samp>NEVER</samp> for a user or usergroup overrides any other value assigned to it. If you do not wish to assign a value for an option for this user or group select <samp>NO</samp>. If values are assigned for this option elsewhere they will be used in preference, else <samp>NEVER</samp> is assumed. All objects marked (with the checkbox in front of them) will copy the permission set you defined.', 'ACL_SETTING' => 'Setting', - 'ACL_TYPE_A_' => 'Administrative Permissions', - 'ACL_TYPE_F_' => 'Forum Permissions', - 'ACL_TYPE_M_' => 'Moderative Permissions', - 'ACL_TYPE_U_' => 'User Permissions', + 'ACL_TYPE_A_' => 'Administrative permissions', + 'ACL_TYPE_F_' => 'Forum permissions', + 'ACL_TYPE_M_' => 'Moderative permissions', + 'ACL_TYPE_U_' => 'User permissions', - 'ACL_TYPE_GLOBAL_A_' => 'Administrative Permissions', - 'ACL_TYPE_GLOBAL_U_' => 'User Permissions', - 'ACL_TYPE_GLOBAL_M_' => 'Global Moderator Permissions', - 'ACL_TYPE_LOCAL_M_' => 'Forum Moderator Permissions', - 'ACL_TYPE_LOCAL_F_' => 'Forum Permissions', + 'ACL_TYPE_GLOBAL_A_' => 'Administrative permissions', + 'ACL_TYPE_GLOBAL_U_' => 'User permissions', + 'ACL_TYPE_GLOBAL_M_' => 'Global Moderator permissions', + 'ACL_TYPE_LOCAL_M_' => 'Forum Moderator permissions', + 'ACL_TYPE_LOCAL_F_' => 'Forum permissions', 'ACL_NO' => 'No', - 'ACL_VIEW' => 'Viewing Permissions', + 'ACL_VIEW' => 'Viewing permissions', 'ACL_VIEW_EXPLAIN' => 'Here you can see the effective permissions the user/group is having. A red square indicates that the user/group does not have the permission, a green square indicates that the user/group does have the permission.', 'ACL_YES' => 'Yes', @@ -76,10 +78,10 @@ $lang = array_merge($lang, array( 'ACP_GLOBAL_MODERATORS_EXPLAIN' => 'Here you can assign global moderator rights 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 admin permissions. User permissions include capabilities such as the use of avatars, sending private messages, etc. Global moderator permissions are blabla, administrative permissions blabla. Individual users permissions should only be changed in rare occassions, the preferred method is putting users in groups and assigning the groups permissions.', - 'ACP_ADMIN_ROLES_EXPLAIN' => 'Here you are able to manage the roles for administrative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change it\'s permissions too.', - 'ACP_FORUM_ROLES_EXPLAIN' => 'Here you are able to manage the roles for forum permissions. Roles are effective permissions, if you change a role the items having this role assigned will change it\'s permissions too.', - 'ACP_MOD_ROLES_EXPLAIN' => 'Here you are able to manage the roles for moderative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change it\'s permissions too.', - 'ACP_USER_ROLES_EXPLAIN' => 'Here you are able to manage the roles for user permissions. Roles are effective permissions, if you change a role the items having this role assigned will change it\'s permissions too.', + 'ACP_ADMIN_ROLES_EXPLAIN' => 'Here you are able to manage the roles for administrative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change it’s permissions too.', + 'ACP_FORUM_ROLES_EXPLAIN' => 'Here you are able to manage the roles for forum permissions. Roles are effective permissions, if you change a role the items having this role assigned will change it’s permissions too.', + 'ACP_MOD_ROLES_EXPLAIN' => 'Here you are able to manage the roles for moderative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change it’s permissions too.', + 'ACP_USER_ROLES_EXPLAIN' => 'Here you are able to manage the roles for user permissions. Roles are effective permissions, if you change a role the items having this role assigned will change it’s permissions too.', 'ACP_USERS_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can assign forum permissions to users.', 'ACP_USERS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to users - user permissions, global moderator permissions and admin permissions. User permissions include capabilities such as the use of avatars, sending private messages, etc. Global moderator permissions are blabla, administrative permissions blabla. To alter these settings for large numbers of users the Group permissions system is the prefered method. Users permissions should only be changed in rare occassions, the preferred method is putting users in groups and assigning the groups permissions.', 'ACP_VIEW_ADMIN_PERMISSIONS_EXPLAIN' => 'Here you can view the effective administrative permissions assigned to the selected users/groups', @@ -88,128 +90,129 @@ $lang = array_merge($lang, array( 'ACP_VIEW_FORUM_MOD_PERMISSIONS_EXPLAIN' => 'Here you can view the forum moderator permissions assigned to the selected users/groups and forums', 'ACP_VIEW_USER_PERMISSIONS_EXPLAIN' => 'Here you can view the effective user permissions assigned to the selected users/groups', - 'ADD_GROUPS' => 'Add Groups', - 'ADD_PERMISSIONS' => 'Add Permissions', - 'ADD_USERS' => 'Add Users', + 'ADD_GROUPS' => 'Add groups', + 'ADD_PERMISSIONS' => 'Add permissions', + 'ADD_USERS' => 'Add users', 'ALL_GROUPS' => 'Select all groups', - 'ALL_NEVER' => 'All Never', - 'ALL_NO' => 'All No', + 'ALL_NEVER' => 'All <samp>NEVER</samp>', + 'ALL_NO' => 'All <samp>NO</samp>', 'ALL_USERS' => 'Select all users', - 'ALL_YES' => 'All Yes', - 'APPLY_ALL_PERMISSIONS' => 'Apply all Permissions', - 'APPLY_PERMISSIONS' => 'Apply Permissions', - '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', + 'ALL_YES' => 'All <samp>YES</samp>', + 'APPLY_ALL_PERMISSIONS' => 'Apply all permissions', + 'APPLY_PERMISSIONS' => 'Apply permissions', + '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.', - 'CREATE_ROLE' => 'Create Role', - 'CREATE_ROLE_FROM' => 'Use settings from...', - 'CUSTOM' => 'Custom...', + 'CREATE_ROLE' => 'Create role', + 'CREATE_ROLE_FROM' => 'Use settings from…', + 'CUSTOM' => 'Custom…', 'DEFAULT' => 'Default', 'DELETE_ROLE' => 'Delete role', 'DELETE_ROLE_CONFIRM' => 'Are you sure you want to remove this role? Items having this role assigned will <strong>not</strong> loosing their permission settings.', - 'DISPLAY_ROLE_ITEMS' => 'View Items using this role', + 'DISPLAY_ROLE_ITEMS' => 'View items using this role', - 'EDIT_PERMISSIONS' => 'Edit Permissions', - 'EDIT_ROLE' => 'Edit Role', + 'EDIT_PERMISSIONS' => 'Edit permissions', + 'EDIT_ROLE' => 'Edit role', 'GROUPS_NOT_ASSIGNED' => 'No group assigned to this role', 'LOOK_UP_FORUMS_EXPLAIN' => 'You are able to select more than one forum', - 'LOOK_UP_GROUP' => 'Look up Usergroup', - 'LOOK_UP_USER' => 'Look up User', + 'LOOK_UP_GROUP' => 'Look up usergroup', + 'LOOK_UP_USER' => 'Look up user', - 'MANAGE_GROUPS' => 'Manage Groups', - 'MANAGE_USERS' => 'Manage Users', + 'MANAGE_GROUPS' => 'Manage groups', + 'MANAGE_USERS' => 'Manage users', 'NO_AUTH_SETTING_FOUND' => 'Permission settings not defined.', - 'NO_ROLE_ASSIGNED' => 'No role assigned...', - 'NO_ROLE_ASSIGNED_EXPLAIN' => 'Setting to this role does not change permissions on the right. If you want to unset/remove all permissions you should use the "All No" link.', + 'NO_ROLE_ASSIGNED' => 'No role assigned…', + 'NO_ROLE_ASSIGNED_EXPLAIN' => 'Setting to this role does not change permissions on the right. If you want to unset/remove all permissions you should use the “All <samp>NO</samp>†link.', 'NO_ROLE_AVAILABLE' => 'No role available', 'NO_ROLE_NAME_SPECIFIED' => 'Please give the role a name.', 'NO_ROLE_SELECTED' => 'Role could not be found.', - 'NO_USER_GROUP_SELECTED' => 'You haven\'t selected any user or group.', + 'NO_USER_GROUP_SELECTED' => 'You haven’t selected any user or group.', 'ONLY_FORUM_DEFINED' => 'You only defined forums in your selection. Please also select at least one user or one group.', 'PERMISSION_APPLIED_TO_ALL' => 'Permissions and Role will also be applied to all checked objects', 'PLUS_SUBFORUMS' => '+Subforums', - 'REMOVE_PERMISSIONS' => 'Remove Permissions', - 'REMOVE_ROLE' => 'Remove Role', + 'REMOVE_PERMISSIONS' => 'Remove permissions', + 'REMOVE_ROLE' => 'Remove role', 'ROLE' => 'Role', 'ROLE_ADD_SUCCESS' => 'Role successfully added.', 'ROLE_ASSIGNED_TO' => 'Users/Groups assigned to %s', 'ROLE_DELETED' => 'Role successfully removed.', - 'ROLE_DESCRIPTION' => 'Role Description', - - 'ROLE_DESCRIPTION_ADMIN_FORUM' => 'Can access the forum management and forum permission settings.', - 'ROLE_DESCRIPTION_ADMIN_FULL' => 'Has access to all admin functions of this forum.<br />Not recommended.', - 'ROLE_DESCRIPTION_ADMIN_STANDARD' => 'Has access to most admin features but is not allowed to use server or system related tools.', - 'ROLE_DESCRIPTION_ADMIN_USERGROUP' => 'Can manage groups and users: Can change permissions, settings, manage bans, and manage ranks.', - 'ROLE_DESCRIPTION_FORUM_BOT' => 'This role is recommended for bots and search spiders.', - 'ROLE_DESCRIPTION_FORUM_FULL' => 'Can use all forum features, including posting of announcements and stickies. Can also ignore the flood limit.<br />Not recommended for normal users.', - 'ROLE_DESCRIPTION_FORUM_LIMITED' => 'Can use some forum features, but cannot attach files or use post icons.', - 'ROLE_DESCRIPTION_FORUM_NOACCESS' => 'Can neither see nor access the forum.', - 'ROLE_DESCRIPTION_FORUM_ONQUEUE' => 'Can use most forum features including attachments, but posts and topics need to be approved by a moderator.', - '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, but cannot lock or delete own topics, and cannot create polls.', - '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.', - 'ROLE_DESCRIPTION_MOD_STANDARD' => 'Can use most moderating tools, but cannot ban users or change the post author.', - 'ROLE_DESCRIPTION_USER_FULL' => 'Can use all available forum features for users, including changing the user name or ignoring the flood limit.<br />Not recommended.', - 'ROLE_DESCRIPTION_USER_LIMITED' => 'Can access some of the user features. Attachments, e-mails, or instant messages are not allowed.', - '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' => 'Role description', + + 'ROLE_DESCRIPTION_ADMIN_FORUM' => 'Can access the forum management and forum permission settings.', + 'ROLE_DESCRIPTION_ADMIN_FULL' => 'Has access to all admin functions of this forum.<br />Not recommended.', + 'ROLE_DESCRIPTION_ADMIN_STANDARD' => 'Has access to most admin features but is not allowed to use server or system related tools.', + 'ROLE_DESCRIPTION_ADMIN_USERGROUP' => 'Can manage groups and users: Able to change permissions, settings, manage bans, and manage ranks.', + 'ROLE_DESCRIPTION_FORUM_BOT' => 'This role is recommended for bots and search spiders.', + 'ROLE_DESCRIPTION_FORUM_FULL' => 'Can use all forum features, including posting of announcements and stickies. Can also ignore the flood limit.<br />Not recommended for normal users.', + 'ROLE_DESCRIPTION_FORUM_LIMITED' => 'Can use some forum features, but cannot attach files or use post icons.', + 'ROLE_DESCRIPTION_FORUM_LIMITED_POLLS' => 'As per Limited Access but can also create polls.', + 'ROLE_DESCRIPTION_FORUM_NOACCESS' => 'Can neither see nor access the forum.', + 'ROLE_DESCRIPTION_FORUM_ONQUEUE' => 'Can use most forum features including attachments, but posts and topics need to be approved by a moderator.', + '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, but cannot lock or delete own topics, and cannot create polls.', + '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.', + 'ROLE_DESCRIPTION_MOD_STANDARD' => 'Can use most moderating tools, but cannot ban users or change the post author.', + 'ROLE_DESCRIPTION_USER_FULL' => 'Can use all available forum features for users, including changing the user name or ignoring the flood limit.<br />Not recommended.', + 'ROLE_DESCRIPTION_USER_LIMITED' => 'Can access some of the user features. Attachments, e-mails, or instant messages are not allowed.', + '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_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_DETAILS' => 'Role Details', + 'ROLE_DETAILS' => 'Role details', 'ROLE_EDIT_SUCCESS' => 'Role successfully edited.', - 'ROLE_NAME' => 'Role Name', + 'ROLE_NAME' => 'Role name', 'ROLE_NAME_ALREADY_EXIST' => 'A role named <strong>%s</strong> already exist for the specified permission type.', 'ROLE_NOT_ASSIGNED' => 'Role has not been assigned yet.', - 'SELECTED_FORUM_NOT_EXIST' => 'The selected forum(s) do not exist', - 'SELECTED_GROUP_NOT_EXIST' => 'The selected group(s) do not exist', - 'SELECTED_USER_NOT_EXIST' => 'The selected user(s) do not exist', + 'SELECTED_FORUM_NOT_EXIST' => 'The selected forum(s) do not exist.', + 'SELECTED_GROUP_NOT_EXIST' => 'The selected group(s) do not exist.', + 'SELECTED_USER_NOT_EXIST' => 'The selected user(s) do not exist.', 'SELECT_FORUM_SUBFORUM_EXPLAIN' => 'The forum you select here will include all subforums into the selection', - 'SELECT_ROLE' => 'Select role...', + 'SELECT_ROLE' => 'Select role…', 'SELECT_TYPE' => 'Select type', 'SET_PERMISSIONS' => 'Set permissions', 'SET_ROLE_PERMISSIONS' => 'Set role permissions', 'SET_USERS_PERMISSIONS' => 'Set users permissions', 'SET_USERS_FORUM_PERMISSIONS' => 'Set users forum permissions', - 'TRACE_DEFAULT' => 'By default every permission is NO (unset). So the permission can be overwritten by other settings.', + 'TRACE_DEFAULT' => 'By default every permission is <samp>NO</samp> (unset). So the permission can be overwritten by other settings.', 'TRACE_FOR' => 'Trace for', 'TRACE_GLOBAL_SETTING' => '%s (global)', - 'TRACE_GROUP_NEVER_TOTAL_NEVER' => 'This group\'s permission is set to NEVER like the total result so the old result is kept.', - 'TRACE_GROUP_NEVER_TOTAL_NO' => 'This group\'s permission is set to NEVER which becomes the new total value because it wasn\'t set yet (set to NO).', - 'TRACE_GROUP_NEVER_TOTAL_YES' => 'This group\'s permission is set to NEVER which overwrites the total YES to a NEVER for this user.', - 'TRACE_GROUP_NO' => 'The permission is NO for this group so the old total value is kept.', - 'TRACE_GROUP_YES_TOTAL_NEVER' => 'This group\'s permission is set to YES but the total NEVER cannot be overwritten.', - 'TRACE_GROUP_YES_TOTAL_NO' => 'This group\'s permission is set to YES which becomes the new total value because it wasn\'t set yet (set to NO).', - 'TRACE_GROUP_YES_TOTAL_YES' => 'This group\'s permission is set to YES and the total permission is already set to YES, so the total result is kept.', + 'TRACE_GROUP_NEVER_TOTAL_NEVER' => 'This group’s permission is set to <samp>NEVER</samp> like the total result so the old result is kept.', + 'TRACE_GROUP_NEVER_TOTAL_NO' => 'This group’s permission is set to <samp>NEVER</samp> which becomes the new total value because it wasn’t set yet (set to <samp>NO</samp>).', + 'TRACE_GROUP_NEVER_TOTAL_YES' => 'This group’s permission is set to <samp>NEVER</samp> which overwrites the total <samp>YES</samp> to a <samp>NEVER</samp> for this user.', + 'TRACE_GROUP_NO' => 'The permission is <samp>NO</samp> for this group so the old total value is kept.', + 'TRACE_GROUP_YES_TOTAL_NEVER' => 'This group’s permission is set to <samp>YES</samp> but the total <samp>NEVER</samp> cannot be overwritten.', + 'TRACE_GROUP_YES_TOTAL_NO' => 'This group’s permission is set to <samp>YES</samp> which becomes the new total value because it wasn’t set yet (set to <samp>NO</samp>).', + 'TRACE_GROUP_YES_TOTAL_YES' => 'This group’s permission is set to <samp>YES</samp> and the total permission is already set to <samp>YES</samp>, so the total result is kept.', 'TRACE_PERMISSION' => 'Trace permission - %s', 'TRACE_SETTING' => 'Trace setting', - 'TRACE_USER_GLOBAL_YES_TOTAL_YES' => 'The forum independent user permission evaluates to YES but the total permission is already set to YES, so the the total result is kept. %sTrace global permission%s', - 'TRACE_USER_GLOBAL_YES_TOTAL_NEVER' => 'The forum independent user permission evaluates to YES which overwrites the current local result NEVER. %sTrace global permission%s', - 'TRACE_USER_GLOBAL_NEVER_TOTAL_KEPT' => 'The forum independent user permission evaluates to NEVER 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 YES by default.', - 'TRACE_USER_KEPT' => 'The user permission is NO so the old total value is kept.', - 'TRACE_USER_NEVER_TOTAL_NEVER' => 'The user permission is set to NEVER and the total value is set to NEVER, so nothing is changed.', - 'TRACE_USER_NEVER_TOTAL_NO' => 'The user permission is set to NEVER which becomes the total value because it was set to NO.', - 'TRACE_USER_NEVER_TOTAL_YES' => 'The user permission is set to NEVER and overwrites the previous YES.', - 'TRACE_USER_NO_TOTAL_NO' => 'The user permission is NO and the total value was set to NO so it defaults to NEVER.', - 'TRACE_USER_YES_TOTAL_NEVER' => 'The user permission is set to YES but the total NEVER cannot be overwritten.', - 'TRACE_USER_YES_TOTAL_NO' => 'The user permission is set to YES which becomes the total value because it was set to NO.', - 'TRACE_USER_YES_TOTAL_YES' => 'The user permission is set to YES and the total value is set to YES, so nothing is changed.', - 'TRACE_WHO' => 'Who', - 'TRACE_TOTAL' => 'Total', + 'TRACE_USER_GLOBAL_YES_TOTAL_YES' => 'The forum independent user permission evaluates to <samp>YES</samp> but the total permission is already set to <samp>YES</samp>, so the the total result is kept. %sTrace global permission%s', + '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_KEPT' => 'The user permission is <samp>NO</samp> so the old total value is kept.', + 'TRACE_USER_NEVER_TOTAL_NEVER' => 'The user permission is set to <samp>NEVER</samp> and the total value is set to <samp>NEVER</samp>, so nothing is changed.', + 'TRACE_USER_NEVER_TOTAL_NO' => 'The user permission is set to <samp>NEVER</samp> which becomes the total value because it was set to NO.', + 'TRACE_USER_NEVER_TOTAL_YES' => 'The user permission is set to <samp>NEVER</samp> and overwrites the previous <samp>YES</samp>.', + 'TRACE_USER_NO_TOTAL_NO' => 'The user permission is <samp>NO</samp> and the total value was set to NO so it defaults to <samp>NEVER</samp>.', + 'TRACE_USER_YES_TOTAL_NEVER' => 'The user permission is set to <samp>YES</samp> but the total <samp>NEVER</samp> cannot be overwritten.', + 'TRACE_USER_YES_TOTAL_NO' => 'The user permission is set to <samp>YES</samp> which becomes the total value because it was set to <samp>NO</samp>.', + 'TRACE_USER_YES_TOTAL_YES' => 'The user permission is set to <samp>YES</samp> and the total value is set to <samp>YES</samp>, so nothing is changed.', + 'TRACE_WHO' => 'Who', + 'TRACE_TOTAL' => 'Total', 'USERS_NOT_ASSIGNED' => 'No user assigned to this role', 'USER_IS_MEMBER_OF_DEFAULT' => 'is a member of the following default groups', @@ -218,7 +221,7 @@ $lang = array_merge($lang, array( 'VIEW_ASSIGNED_ITEMS' => 'View assigned items', 'VIEW_PERMISSIONS' => 'View permissions', - 'WRONG_PERMISSION_TYPE' => 'Wrong permission type selected', + 'WRONG_PERMISSION_TYPE' => 'Wrong permission type selected.', )); ?>
\ No newline at end of file diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php index b0bc770a74..df2d9e8c6f 100644 --- a/phpBB/language/en/acp/permissions_phpbb.php +++ b/phpBB/language/en/acp/permissions_phpbb.php @@ -1,13 +1,11 @@ <?php /** -* * acp_permissions (phpBB Permission Set) [English] * * @package language * @version $Id$ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License -* */ /** @@ -18,7 +16,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -28,26 +28,35 @@ if (empty($lang) || !is_array($lang)) // 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 -/* - MODDERS PLEASE NOTE - - Please add your permission settings this way: - - // Adding new category - $lang['permission_cats']['bugs'] = 'Bugs'; - - // Adding new permission set - $lang['permission_sets']['bug_'] = 'Bug Permissions'; - - // Adding the permissions - $lang = array_merge($lang, array( - 'acl_bug_view' => array('lang' => 'Can view bug reports', 'cat' => 'bugs'), - 'acl_bug_post' => array('lang' => 'Can post bugs', 'cat' => 'post'), // Using a phpBB category here - )); - - TODO: - You are able to put your permission sets into a seperate file too by - prefixing it with permissions_ and putting it into the acp language folder. +/** +* MODDERS PLEASE NOTE +* +* You are able to put your permission sets into a seperate file too by +* prefixing the new file with permissions_ and putting it into the acp +* language folder. +* +* An example of how the file could look like: +* +* <code> +* +* if (empty($lang) || !is_array($lang)) +* { +* $lang = array(); +* } +* +* // Adding new category +* $lang['permission_cat']['bugs'] = 'Bugs'; +* +* // Adding new permission set +* $lang['permission_type']['bug_'] = 'Bug Permissions'; +* +* // Adding the permissions +* $lang = array_merge($lang, array( +* 'acl_bug_view' => array('lang' => 'Can view bug reports', 'cat' => 'bugs'), +* 'acl_bug_post' => array('lang' => 'Can post bugs', 'cat' => 'post'), // Using a phpBB category here +* )); +* +* </code> */ // Define categories and permission types @@ -58,22 +67,22 @@ $lang = array_merge($lang, array( 'forums' => 'Forums', 'misc' => 'Misc', 'permissions' => 'Permissions', - 'pm' => 'Private Messages', + 'pm' => 'Private messages', 'polls' => 'Polls', 'post' => 'Post', - 'post_actions' => 'Post Actions', + 'post_actions' => 'Post actions', 'posting' => 'Posting', 'profile' => 'Profile', 'settings' => 'Settings', - 'topic_actions' => 'Topic Actions', + 'topic_actions' => 'Topic actions', 'user_group' => 'Users & Groups', ), 'permission_type' => array( - 'u_' => 'User Permissions', - 'a_' => 'Admin Permissions', - 'm_' => 'Moderator Permissions', - 'f_' => 'Forum Permissions', + 'u_' => 'User permissions', + 'a_' => 'Admin permissions', + 'm_' => 'Moderator permissions', + 'f_' => 'Forum permissions', ), )); @@ -174,7 +183,7 @@ $lang = array_merge($lang, array( $lang = array_merge($lang, array( 'acl_a_board' => array('lang' => 'Can alter board settings', 'cat' => 'settings'), 'acl_a_server' => array('lang' => 'Can alter server/communication settings', 'cat' => 'settings'), - 'acl_a_jabber' => array('lang' => 'Can alter jabber settings', 'cat' => 'settings'), + 'acl_a_jabber' => array('lang' => 'Can alter Jabber settings', 'cat' => 'settings'), 'acl_a_phpinfo' => array('lang' => 'Can view php settings', 'cat' => 'settings'), 'acl_a_forum' => array('lang' => 'Can manage forums', 'cat' => 'forums'), @@ -215,8 +224,7 @@ $lang = array_merge($lang, array( 'acl_a_email' => array('lang' => 'Can send mass email', 'cat' => 'misc'), 'acl_a_bots' => array('lang' => 'Can manage bots', 'cat' => 'misc'), 'acl_a_reasons' => array('lang' => 'Can manage report/denial reasons', 'cat' => 'misc'), - 'acl_a_backup' => array('lang' => 'Can backup database', 'cat' => 'misc'), -# 'acl_a_restore' => array('lang' => 'Can restore database', 'cat' => 'misc'), + 'acl_a_backup' => array('lang' => 'Can backup/restore database', 'cat' => 'misc'), 'acl_a_search' => array('lang' => 'Can manage search backends and settings', 'cat' => 'misc'), )); diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php index e1941b7f8d..a1feb2acac 100644 --- a/phpBB/language/en/acp/posting.php +++ b/phpBB/language/en/acp/posting.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -34,10 +36,10 @@ $lang = array_merge($lang, array( 'ACP_BBCODES_EXPLAIN' => 'BBCode is a special implementation of HTML offering greater control over what and how something is displayed. From this page you can add, remove and edit custom BBCodes', 'ADD_BBCODE' => 'Add a new BBCode', - 'BBCODE_ADDED' => 'BBCode added successfully', - 'BBCODE_EDITED' => 'BBCode edited successfully', - 'BBCODE_INVALID_TAG_NAME' => 'The BBCode tag name that you selected is invalid', - 'BBCODE_NOT_EXIST' => 'The BBCode you selected does not exist', + 'BBCODE_ADDED' => 'BBCode added successfully.', + 'BBCODE_EDITED' => 'BBCode edited successfully.', + 'BBCODE_INVALID_TAG_NAME' => 'The BBCode tag name that you selected already exists.', + 'BBCODE_NOT_EXIST' => 'The BBCode you selected does not exist.', 'BBCODE_HELPLINE' => 'Helpline', 'BBCODE_HELPLINE_EXPLAIN' => 'This field contains the mouseover text of the BBCode', 'BBCODE_HELPLINE_TEXT' => 'Helpline text', @@ -56,17 +58,17 @@ $lang = array_merge($lang, array( '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. {USERNAME1}, {USERNAME2}.<br /><br />In addition to these tokens you can use any of lang string present in your language/ directory like this: {L_<i><stringname></i>} where <i><stringname></i> 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', + '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. {USERNAME1}, {USERNAME2}.<br /><br />In addition to these tokens you can use any of lang string present in your language/ directory like this: {L_<em><stringname></em>} where <em><stringname></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', 'TOKEN_DEFINITION' => 'What can it be?', - 'TOO_MANY_BBCODES' => 'You cannot create any more BBCodes. Please remove one or more BBCodes then try again', + 'TOO_MANY_BBCODES' => 'You cannot create any more BBCodes. Please remove one or more BBCodes then try again.', 'tokens' => array( - 'TEXT' => 'Any text, including foreign characters, numbers, etc...', + 'TEXT' => 'Any text, including foreign characters, numbers, etc…', 'NUMBER' => 'Any series of digits', 'EMAIL' => 'A valid email address', - 'URL' => 'A valid URL using any protocol (http, ftp, etc... cannot be used for javascript exploits). If none is given, "http://" is prepended to 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 prepended to 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 color, can be either in the numeric form #FF1234 or an english name such as "blue"' + 'COLOR' => 'A HTML color, 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>' ) )); @@ -87,13 +89,13 @@ $lang = array_merge($lang, array( 'DISPLAY_ON_POSTING' => 'Display on posting', - 'EDIT_ICONS' => 'Edit Icons', + 'EDIT_ICONS' => 'Edit icons', 'EDIT_SMILIES' => 'Edit smilies', 'EMOTION' => 'Emotion', - 'EXPORT_ICONS' => 'Create icons pak', - 'EXPORT_ICONS_EXPLAIN' => 'To create a package of your currently installed icons, click %sHERE%s to download the icons package file. Once downloaded create a zip or tgz file containing all of your icons plus this .pak configuration file.', - 'EXPORT_SMILIES' => 'Create smilies pak', - 'EXPORT_SMILIES_EXPLAIN' => 'To create a package of your currently installed smilies, click %sHERE%s to download the smilies.pak file. Once downloaded create a zip or tgz file containing all of your smilies plus this .pak configuration file.', + 'EXPORT_ICONS' => 'Export and download icons.pak', + 'EXPORT_ICONS_EXPLAIN' => '%sOn clicking this link, the configuration for your installed icons will be packaged into <samp>icons.pak</samp> which once downloaded can be used to create a <samp>.zip</samp> or <samp>.tgz</samp> file containing all of your icons plus this <samp>icons.pak</samp> configuration file%s.', + 'EXPORT_SMILIES' => 'Export and download smilies.pak', + 'EXPORT_SMILIES_EXPLAIN' => '%sOn clicking this link, the configuration for your installed smilies will be packaged into <samp>smilies.pak</samp> which once downloaded can be used to create a <samp>.zip</samp> or <samp>.tgz</samp> file containing all of your smilies plus this <samp>icons.pak</samp> configuration file%s.', 'FIRST' => 'First', @@ -101,12 +103,12 @@ $lang = array_merge($lang, array( 'ICONS_ADDED' => 'The icon has been added successfully.', 'ICONS_CONFIG' => 'Icon configuration', 'ICONS_DELETED' => 'The icon has been removed successfully.', - 'ICONS_EDIT' => 'Edit Icon', + 'ICONS_EDIT' => 'Edit icon', 'ICONS_EDITED' => 'The icon has been updated successfully.', 'ICONS_HEIGHT' => 'Icon height', 'ICONS_IMAGE' => 'Icon image', 'ICONS_IMPORTED' => 'The icons pack has been installed successfully.', - 'ICONS_IMPORT_SUCCESS' => 'The icons pack was imported successfully', + 'ICONS_IMPORT_SUCCESS' => 'The icons pack was imported successfully.', 'ICONS_LOCATION' => 'Icon location', 'ICONS_NOT_DISPLAYED' => 'The following icons are not displayed on the posting page', 'ICONS_ORDER' => 'Icon order', @@ -124,12 +126,12 @@ $lang = array_merge($lang, array( 'NO_SMILIES_EXPORT' => 'You have no smilies with which to create a package.', 'NO_SMILIES_PAK' => 'No smiley packages found.', - 'PAK_FILE_NOT_READABLE' => 'Could not read pak file', + 'PAK_FILE_NOT_READABLE' => 'Could not read pak file.', 'REPLACE_MATCHES' => 'Replace matches', 'SELECT_PACKAGE' => 'Select a package file', - 'SMILIES_ADD' => 'Add a new Smiley', + 'SMILIES_ADD' => 'Add a new smiley', 'SMILIES_ADDED' => 'The smiley has been added successfully.', 'SMILIES_CODE' => 'Smiley code', 'SMILIES_CONFIG' => 'Smiley configuration', @@ -140,7 +142,7 @@ $lang = array_merge($lang, array( 'SMILIES_HEIGHT' => 'Smiley height', 'SMILIES_IMAGE' => 'Smiley image', 'SMILIES_IMPORTED' => 'The smilies pack has been installed successfully.', - 'SMILIES_IMPORT_SUCCESS' => 'The smilies pack was imported successfully', + 'SMILIES_IMPORT_SUCCESS' => 'The smilies pack was imported successfully.', 'SMILIES_LOCATION' => 'Smiley location', 'SMILIES_NOT_DISPLAYED' => 'The following smilies are not displayed on the posting page', 'SMILIES_ORDER' => 'Smiley order', @@ -156,18 +158,18 @@ $lang = array_merge($lang, array( 'ADD_WORD' => 'Add new word', 'EDIT_WORD' => 'Edit word censor', - 'ENTER_WORD' => 'You must enter a word and its replacement', + 'ENTER_WORD' => 'You must enter a word and its replacement.', - 'NO_WORD' => 'No word selected for editing', + 'NO_WORD' => 'No word selected for editing.', 'REPLACEMENT' => 'Replacement', 'UPDATE_WORD' => 'Update word censor', 'WORD' => 'Word', - 'WORD_ADDED' => 'The word censor has been successfully added', - 'WORD_REMOVED' => 'The selected word censor has been successfully removed', - 'WORD_UPDATED' => 'The selected word censor has been successfully updated', + 'WORD_ADDED' => 'The word censor has been successfully added.', + 'WORD_REMOVED' => 'The selected word censor has been successfully removed.', + 'WORD_UPDATED' => 'The selected word censor has been successfully updated.', )); // Ranks @@ -178,16 +180,16 @@ $lang = array_merge($lang, array( 'MUST_SELECT_RANK' => 'You must select a rank.', 'NO_ASSIGNED_RANK' => 'No special rank assigned.', - 'NO_RANK_TITLE' => 'You haven\'t specified a title for the rank.', + 'NO_RANK_TITLE' => 'You haven’t specified a title for the rank.', 'NO_UPDATE_RANKS' => 'The rank was successfully deleted. However user accounts using this rank were not updated. You will need to manually reset the rank on these accounts.', 'RANK_ADDED' => 'The rank was successfully added.', - 'RANK_IMAGE' => 'Rank Image', + '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_MINIMUM' => 'Minimum Posts', + 'RANK_MINIMUM' => 'Minimum posts', 'RANK_REMOVED' => 'The rank was successfully deleted.', - 'RANK_SPECIAL' => 'Set as Special Rank', - 'RANK_TITLE' => 'Rank Title', + 'RANK_SPECIAL' => 'Set as special rank', + 'RANK_TITLE' => 'Rank title', 'RANK_UPDATED' => 'The rank was successfully updated.', )); @@ -198,37 +200,41 @@ $lang = array_merge($lang, array( 'ADD_DISALLOW_TITLE' => 'Add a disallowed username', 'DELETE_DISALLOW_EXPLAIN' => 'You can remove a disallowed username by selecting the username from this list and clicking submit', - 'DELETE_DISALLOW_TITLE' => 'Remove a Disallowed Username', + 'DELETE_DISALLOW_TITLE' => 'Remove a disallowed username', 'DISALLOWED_ALREADY' => 'The name you entered could not be disallowed. It either already exists in the list, exists in the word censor list, or a matching username is present.', - 'DISALLOWED_DELETED' => 'The disallowed username has been successfully removed', - 'DISALLOW_SUCCESSFUL' => 'The disallowed username has been successfully added', + 'DISALLOWED_DELETED' => 'The disallowed username has been successfully removed.', + 'DISALLOW_SUCCESSFUL' => 'The disallowed username has been successfully added.', - 'NO_DISALLOWED' => 'No Disallowed Usernames', - 'NO_USERNAME_SPECIFIED' => 'You haven\'t selected or entered a username to operate with.', + 'NO_DISALLOWED' => 'No disallowed usernames', + 'NO_USERNAME_SPECIFIED' => 'You haven’t selected or entered a username to operate with.', )); // Reasons $lang = array_merge($lang, array( 'ACP_REASONS_EXPLAIN' => 'Here you can manage the reasons used in reports and denial messages when disapproving posts. There is one default reason (marked with a *) you are not able to remove, this reason is normally used for custom messages if no reason fits.', - 'ADD_NEW_REASON' => 'Add new reason', + 'AVAILABLE_TITLES' => 'Available localized reason titles', - 'IS_NOT_TRANSLATED' => 'Reason has not been localized', - 'IS_TRANSLATED' => 'Reason has been localized', + 'IS_NOT_TRANSLATED' => 'Reason has <samp>not</samp> been localised.', + 'IS_NOT_TRANSLATED_EXPLAIN' => 'Reason has <samp>not</samp> been localised. If you want to provide the localized form, specify the correct key from the language files report reasons section.', + 'IS_TRANSLATED' => 'Reason has been localised.', + 'IS_TRANSLATED_EXPLAIN' => 'Reason has been localised. If the title you enter here is specified within the language files report reasons section, the localized form of the title and description will be used.', - 'NO_REASON' => 'Reason could not be found', + 'NO_REASON' => 'Reason could not be found.', 'NO_REASON_INFO' => 'You have to specify a title and a description for this reason.', 'NO_REMOVE_DEFAULT_REASON' => 'You are not able to remove the default reason "Other".', - 'REASON_ADD' => 'Add report/denial reason', - 'REASON_ADDED' => 'Report/denial reason successfully added', - 'REASON_ALREADY_EXIST' => 'A reason with this title already exist, please enter another title for this reason.', - 'REASON_DESCRIPTION' => 'Reason Description', - 'REASON_EDIT' => 'Edit report/denial reason', - 'REASON_EDIT_EXPLAIN' => 'Here you are able to add or edit a reason. If the reason is translated the localized version is used instead of the description entered here.', - 'REASON_REMOVED' => 'Report/denial reason successfully removed', - 'REASON_TITLE' => 'Reason Title', - 'REASON_UPDATED' => 'Report/denial reason successfully updated', + 'REASON_ADD' => 'Add report/denial reason', + 'REASON_ADDED' => 'Report/denial reason successfully added.', + 'REASON_ALREADY_EXIST' => 'A reason with this title already exist, please enter another title for this reason.', + 'REASON_DESCRIPTION' => 'Reason description', + 'REASON_DESC_TRANSLATED' => 'Displayed reason description', + 'REASON_EDIT' => 'Edit report/denial reason', + 'REASON_EDIT_EXPLAIN' => 'Here you are able to add or edit a reason. If the reason is translated the localized version is used instead of the description entered here.', + 'REASON_REMOVED' => 'Report/denial reason successfully removed.', + 'REASON_TITLE' => 'Reason title', + 'REASON_TITLE_TRANSLATED' => 'Displayed reason title', + 'REASON_UPDATED' => 'Report/denial reason successfully updated.', 'USED_IN_REPORTS' => 'Used in reports', )); diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php index e8ab61fea2..6e86da03a7 100644 --- a/phpBB/language/en/acp/profile.php +++ b/phpBB/language/en/acp/profile.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -30,27 +32,29 @@ if (empty($lang) || !is_array($lang)) // Custom profile fields $lang = array_merge($lang, array( - 'ADDED_PROFILE_FIELD' => 'Successfully added custom profile field', + 'ADDED_PROFILE_FIELD' => 'Successfully added custom profile field.', 'ALPHA_ONLY' => 'Alphanumeric only', 'ALPHA_SPACERS' => 'Alphanumeric and spacers', 'ALWAYS_TODAY' => 'Always the current date', 'BOOL_ENTRIES_EXPLAIN' => 'Enter your options now', - 'BOOL_TYPE_EXPLAIN' => 'Define the Type, either a checkbox or radio buttons', + 'BOOL_TYPE_EXPLAIN' => 'Define the type, either a checkbox or radio buttons', - 'CHANGED_PROFILE_FIELD' => 'Successfully changed profile field', + 'CHANGED_PROFILE_FIELD' => 'Successfully changed profile field.', 'CHARS_ANY' => 'Any character', 'CHECKBOX' => 'Checkbox', - 'CP_LANG_DEFAULT_VALUE' => 'Default Value', + 'COLUMNS' => 'Columns', + 'CP_LANG_DEFAULT_VALUE' => 'Default value', 'CP_LANG_EXPLAIN' => 'Field Description', - 'CP_LANG_EXPLAIN_EXPLAIN' => 'The Explanation for this field presented to the user', - 'CP_LANG_NAME' => 'Field Name/Title presented to the user', + 'CP_LANG_EXPLAIN_EXPLAIN' => 'The explanation for this field presented to the user', + 'CP_LANG_NAME' => 'Field name/title presented to the user', 'CP_LANG_OPTIONS' => 'Options', - 'CREATE_NEW_FIELD' => 'Create New Field', - 'COLUMNS' => 'Columns', + 'CREATE_NEW_FIELD' => 'Create new field', + 'CUSTOM_FIELDS_NOT_TRANSLATED' => 'At least one custom profile field has not yet been translated. Please enter the required information by clicking on the "Translate" link.', - 'DEFAULT_ISO_LANGUAGE' => 'Default Language [%s]', - 'DEFAULT_VALUE' => 'Default Value', + 'DEFAULT_ISO_LANGUAGE' => 'Default language [%s]', + 'DEFAULT_LANGUAGE_NOT_FILLED' => 'The language entries for the default language are not filled for this profile field.', + 'DEFAULT_VALUE' => 'Default value', 'DELETE_PROFILE_FIELD' => 'Remove profile field', 'DELETE_PROFILE_FIELD_CONFIRM' => 'Are you sure you want to delete this profile field?', 'DISPLAY_AT_PROFILE' => 'Display in user control panel', @@ -69,76 +73,79 @@ $lang = array_merge($lang, array( 'FIELD_BOOL' => 'Boolean (Yes/No)', 'FIELD_DATE' => 'Date', - 'FIELD_DESCRIPTION' => 'Field Description', - 'FIELD_DESCRIPTION_EXPLAIN' => 'The Explanation for this field presented to the user', - 'FIELD_DROPDOWN' => 'Dropdown Box', - 'FIELD_IDENT' => 'Field Identification', - 'FIELD_IDENT_EXPLAIN' => 'The field Identification is a name to identify the profile field within the database and the templates.', + 'FIELD_DESCRIPTION' => 'Field description', + 'FIELD_DESCRIPTION_EXPLAIN' => 'The explanation for this field presented to the user', + 'FIELD_DROPDOWN' => 'Dropdown box', + 'FIELD_IDENT' => 'Field identification', + 'FIELD_IDENT_ALREADY_EXIST' => 'The chosen field identification already exist. Please choose another name.', + 'FIELD_IDENT_EXPLAIN' => 'The field identification is a name to identify the profile field within the database and the templates.', 'FIELD_INT' => 'Numbers', 'FIELD_LENGTH' => 'Length of input box', - 'FIELD_NOT_FOUND' => 'Profile field not found', - 'FIELD_STRING' => 'Single Textfield', + 'FIELD_NOT_FOUND' => 'Profile field not found.', + 'FIELD_STRING' => 'Single textfield', 'FIELD_TEXT' => 'Textarea', - 'FIELD_TYPE' => 'Field Type', + 'FIELD_TYPE' => 'Field type', 'FIELD_TYPE_EXPLAIN' => 'You are not able to change the field type later.', - 'FIELD_VALIDATION' => 'Field Validation', - 'FIRST_OPTION' => 'First Option', + 'FIELD_VALIDATION' => 'Field validation', + 'FIRST_OPTION' => 'First option', - 'HIDE_PROFILE_FIELD' => 'Hide Profile Field', + 'HIDE_PROFILE_FIELD' => 'Hide profile field', 'HIDE_PROFILE_FIELD_EXPLAIN' => 'Only Administrators and Moderators are able to see/fill out this profile field. If this option is enabled, the profile field will be only displayed in user profiles.', 'INVALID_CHARS_FIELD_IDENT' => 'Field identification can only contain lowercase a-z and _', + 'INVALID_FIELD_IDENT_LEN' => 'Field identification can only be 17 characters long', 'ISO_LANGUAGE' => 'Language [%s]', - 'LANG_SPECIFIC_OPTIONS' => 'Language specific options [<b>%s</b>]', + 'LANG_SPECIFIC_OPTIONS' => 'Language specific options [<strong>%s</strong>]', 'MAX_FIELD_CHARS' => 'Maximum number of characters', 'MAX_FIELD_NUMBER' => 'Highest allowed number', 'MIN_FIELD_CHARS' => 'Minimum number of characters', 'MIN_FIELD_NUMBER' => 'Lowest allowed number', - 'NO_FIELD_ENTRIES' => 'No Entries defined', - 'NO_FIELD_ID' => 'No field id specified', - 'NO_FIELD_TYPE' => 'No Field type specified', + 'NO_FIELD_ENTRIES' => 'No entries defined', + 'NO_FIELD_ID' => 'No field id specified.', + 'NO_FIELD_TYPE' => 'No Field type specified.', 'NO_VALUE_OPTION' => 'Option equal to non entered value', 'NO_VALUE_OPTION_EXPLAIN' => 'Value for a non-entry. If the field is required, the user gets an error if he choose the option selected here', 'NUMBERS_ONLY' => 'Only numbers (0-9)', - 'PREVIEW_PROFILE_FIELD' => 'Preview Profile Field', - 'PROFILE_BASIC_OPTIONS' => 'Basic Options', - 'PROFILE_FIELD_ACTIVATED' => 'Profile field successfully activated', - 'PROFILE_FIELD_DEACTIVATED' => 'Profile field successfully deactivated', + 'PREVIEW_PROFILE_FIELD' => 'Preview profile field', + 'PROFILE_BASIC_OPTIONS' => 'Basic options', + 'PROFILE_FIELD_ACTIVATED' => 'Profile field successfully activated.', + 'PROFILE_FIELD_DEACTIVATED' => 'Profile field successfully deactivated.', 'PROFILE_LANG_OPTIONS' => 'Language specific options', 'PROFILE_TYPE_OPTIONS' => 'Profile type specific options', - 'RADIO_BUTTONS' => 'Radio Buttons', + 'RADIO_BUTTONS' => 'Radio buttons', 'REMOVED_PROFILE_FIELD' => 'Successfully removed profile field.', 'REQUIRED_FIELD' => 'Required Field', 'REQUIRED_FIELD_EXPLAIN' => 'Force profile field to be filled out or specified by user. This will display the profile field at registration and within the user control panel.', 'ROWS' => 'Rows', 'SAVE' => 'Save', - 'SECOND_OPTION' => 'Second Option', + 'SECOND_OPTION' => 'Second option', 'STEP_1_EXPLAIN_CREATE' => 'Here you can enter the first basic parameters of your new profile field. These informations are needed for the second step where you are able to set remaining options and where you are able to preview and tweak your profile field further.', 'STEP_1_EXPLAIN_EDIT' => 'Here you can change the basic parameters of your profile field. The relevant options are re-calculated within the second step, where you are able to preview and test the changed settings.', - 'STEP_1_TITLE_CREATE' => 'Add Profile Field', - 'STEP_1_TITLE_EDIT' => 'Edit Profile Field', + 'STEP_1_TITLE_CREATE' => 'Add profile field', + 'STEP_1_TITLE_EDIT' => 'Edit profile field', 'STEP_2_EXPLAIN_CREATE' => 'Here you are able to define some common options. Further you are able to preview the field you generated, as the user will see it. Play around with it until you are satisfied as how the field behaves.', - 'STEP_2_EXPLAIN_EDIT' => 'Here you are able to change some common options. Further you are able to preview the changed field, as the user will see it. Play around with it until you are satisfied as how the field behaves.<br /><b>Please note that changes to profile fields will not affect existing profile fields entered by your users.</b>', + 'STEP_2_EXPLAIN_EDIT' => 'Here you are able to change some common options. Further you are able to preview the changed field, as the user will see it. Play around with it until you are satisfied as how the field behaves.<br /><strong>Please note that changes to profile fields will not affect existing profile fields entered by your users.</strong>', 'STEP_2_TITLE_CREATE' => 'Profile type specific options', 'STEP_2_TITLE_EDIT' => 'Profile type specific options', 'STEP_3_EXPLAIN_CREATE' => 'Since you have more than one board language installed, you have to fill out the remaining language items too. The profile field will work with the default language enabled, you are able to fill out the remaining language items later too.', 'STEP_3_EXPLAIN_EDIT' => 'Since you have more than one board language installed, you now can change or add the remaining language items too. The profile field will work with the default language enabled.', - 'STEP_3_TITLE_CREATE' => 'Remaining Language Definitions', - 'STEP_3_TITLE_EDIT' => 'Language Definitions', + 'STEP_3_TITLE_CREATE' => 'Remaining language definitions', + 'STEP_3_TITLE_EDIT' => 'Language definitions', 'STRING_DEFAULT_VALUE_EXPLAIN' => 'Enter a default phrase to be displayed, a default value. Leave empty if you want to show it empty at the first place.', 'TEXT_DEFAULT_VALUE_EXPLAIN' => 'Enter a default text to be displayed, a default value. Leave empty if you want to show it empty at the first place.', + 'TRANSLATE' => 'Translate', - 'UPDATE_PREVIEW' => 'Update Preview', - 'USER_FIELD_NAME' => 'Field Name/Title presented to the user', + 'UPDATE_PREVIEW' => 'Update preview', + 'USER_FIELD_NAME' => 'Field name/title presented to the user', - 'VISIBILITY_OPTION' => 'Visibility Option', + 'VISIBILITY_OPTION' => 'Visibility option', )); ?>
\ No newline at end of file diff --git a/phpBB/language/en/acp/prune.php b/phpBB/language/en/acp/prune.php index 71f4169fbb..4452deafc9 100644 --- a/phpBB/language/en/acp/prune.php +++ b/phpBB/language/en/acp/prune.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -38,36 +40,36 @@ $lang = array_merge($lang, array( '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 YYYY-MM-DD format.', + 'JOINED_EXPLAIN' => 'Enter a date in <kbd>YYYY-MM-DD</kbd> format.', - 'LAST_ACTIVE_EXPLAIN' => 'Enter a date in YYYY-MM-DD format.', + 'LAST_ACTIVE_EXPLAIN' => 'Enter a date in <kbd>YYYY-MM-DD</kbd> format.', 'SELECT_USERS_EXPLAIN' => 'Enter specific usernames here, they will be used in preference to the criteria above.', - 'USER_DEACTIVATE_SUCCESS' => 'The selected users have been deactivated successfully', - 'USER_DELETE_SUCCESS' => 'The selected users have been deleted successfully', + 'USER_DEACTIVATE_SUCCESS' => 'The selected users have been deactivated successfully.', + 'USER_DELETE_SUCCESS' => 'The selected users have been deleted successfully.', )); // Forum Pruning $lang = array_merge($lang, array( - 'ACP_PRUNE_FORUMS_EXPLAIN' => 'This will delete any topic which has not been posted to within the number of days you select. If you do not enter a number then all topics will be deleted. It will not remove topics in which polls are still running nor will it remove announcements. You will need to remove these topics manually.', + 'ACP_PRUNE_FORUMS_EXPLAIN' => 'This will delete any topic which has not been posted to or viewed within the number of days you select. If you do not enter a number then all topics will be deleted. By default, it will not remove topics in which polls are still running nor will it remove stickies and announcements.', - 'FORUM_PRUNE' => 'Forum Prune', + 'FORUM_PRUNE' => 'Forum prune', 'NO_PRUNE' => 'No forums pruned', - 'SELECTED_FORUM' => 'Selected Forum', - 'SELECTED_FORUMS' => 'Selected Forums', + 'SELECTED_FORUM' => 'Selected forum', + 'SELECTED_FORUMS' => 'Selected forums', 'POSTS_PRUNED' => 'Posts pruned', - 'PRUNE_ANNOUNCEMENTS' => 'Prune Announcements', - 'PRUNE_FINISHED_POLLS' => 'Prune Closed Polls', + 'PRUNE_ANNOUNCEMENTS' => 'Prune announcements', + 'PRUNE_FINISHED_POLLS' => 'Prune closed polls', 'PRUNE_FINISHED_POLLS_EXPLAIN' => 'Removes topics with polls which have ended.', 'PRUNE_NOT_POSTED' => 'Days since last posted', 'PRUNE_NOT_VIEWED' => 'Days since last viewed', - 'PRUNE_OLD_POLLS' => 'Prune Old Polls', + 'PRUNE_OLD_POLLS' => 'Prune old polls', 'PRUNE_OLD_POLLS_EXPLAIN' => 'Removes topics with polls not voted in for post age days.', - 'PRUNE_STICKY' => 'Prune Stickies', + 'PRUNE_STICKY' => 'Prune stickies', 'PRUNE_SUCCESS' => 'Pruning of forums was successful', 'TOPICS_PRUNED' => 'Topics pruned', diff --git a/phpBB/language/en/acp/search.php b/phpBB/language/en/acp/search.php index ab6e55a0d4..4d6b01cb6c 100644 --- a/phpBB/language/en/acp/search.php +++ b/phpBB/language/en/acp/search.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -29,17 +31,17 @@ if (empty($lang) || !is_array($lang)) // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine $lang = array_merge($lang, array( - 'ACP_SEARCH_INDEX_EXPLAIN' => 'Here you can manage the search backend\'s indexes. Since you normally use only one backend you should delete all indexes that you do not make use of. After altering some of the search settings (e.g. the number of minimum/maximum chars) it might be worth recreating the index so it reflects those changes.', + 'ACP_SEARCH_INDEX_EXPLAIN' => 'Here you can manage the search backend’s indexes. Since you normally use only one backend you should delete all indexes that you do not make use of. After altering some of the search settings (e.g. the number of minimum/maximum chars) it might be worth recreating the index so it reflects those changes.', 'ACP_SEARCH_SETTINGS_EXPLAIN' => 'Here you can define what search backend will be used for indexing posts and performing searches. You can set various options that can influence how much processing these actions require. Some of these settings are the same for all search engine backends.', - 'CONFIRM_SEARCH_BACKEND' => 'Are you sure you wish to switch to a different search backend? After changing the search backend you will have to create an index for the new search backend. If you don\'t plan on switching back to the old search backend you can also delete the old backend\'s index in order to free system resources.', + 'CONFIRM_SEARCH_BACKEND' => 'Are you sure you wish to switch to a different search backend? After changing the search backend you will have to create an index for the new search backend. If you don’t plan on switching back to the old search backend you can also delete the old backend’s index in order to free system resources.', 'CONTINUE_DELETING_INDEX' => 'Continue previous index deleting process', 'CONTINUE_DELETING_INDEX_EXPLAIN' => 'An index deleting process has been started. In order to access the search index page again you need to complete it first.', 'CONTINUE_INDEXING' => 'Continue previous indexing process', 'CONTINUE_INDEXING_EXPLAIN' => 'An indexing process has been started. In order to access the search index page again you need to complete it first.', - 'CREATE_INDEX' => 'Create Index', + 'CREATE_INDEX' => 'Create index', - 'DELETE_INDEX' => 'Delete Index', + 'DELETE_INDEX' => 'Delete index', 'DELETING_INDEX_IN_PROGRESS' => 'Deleting the index in progress', 'DELETING_INDEX_IN_PROGRESS_EXPLAIN' => 'The search backend is currently cleaning its index. This can take a few minutes.', @@ -49,12 +51,12 @@ $lang = array_merge($lang, array( 'FULLTEXT_MYSQL_TEXT_CARDINALITY' => 'Cardinality of the post_text fulltext index (estimate of unique values)', 'FULLTEXT_MYSQL_TOTAL_POSTS' => 'Total number of indexed posts', - 'GENERAL_SEARCH_SETTINGS' => 'General Search Settings', + 'GENERAL_SEARCH_SETTINGS' => 'General search settings', 'GO_TO_SEARCH_INDEX' => 'Go to search index page', - 'INDEX_STATS' => 'Index Statistics', + 'INDEX_STATS' => 'Index statistics', 'INDEXING_IN_PROGRESS' => 'Indexing in progress', - 'INDEXING_IN_PROGRESS_EXPLAIN' => 'The search backend is currently indexing all posts on the board. This can take from a few minutes to a few hours depending on your board\'s size.', + 'INDEXING_IN_PROGRESS_EXPLAIN' => 'The search backend is currently indexing all posts on the board. This can take from a few minutes to a few hours depending on your board’s size.', 'LIMIT_SEARCH_LOAD' => 'Search page system load limit', 'LIMIT_SEARCH_LOAD_EXPLAIN' => 'If the 1 minute system load exceeds this value the search page will go offline, 1.0 equals ~100% utilisation of one processor. This only functions on UNIX based servers.', @@ -64,20 +66,20 @@ $lang = array_merge($lang, array( 'MIN_SEARCH_CHARS' => 'Min characters indexed by search', 'MIN_SEARCH_CHARS_EXPLAIN' => 'Words with at least this many characters will be indexed for searching.', 'MIN_SEARCH_AUTHOR_CHARS' => 'Min author name characters', - 'MIN_SEARCH_AUTHOR_CHARS_EXPLAIN' => 'Users have to enter at least this many characters of the name when performing a wildcard author search. If the author\'s username is shorter than this number you can still search for the author\'s posts by entering the complete username.', + 'MIN_SEARCH_AUTHOR_CHARS_EXPLAIN' => 'Users have to enter at least this many characters of the name when performing a wildcard author search. If the author’s username is shorter than this number you can still search for the author’s posts by entering the complete username.', 'PROGRESS_BAR' => 'Progress bar', 'SEARCH_GUEST_INTERVAL' => 'Guest search flood interval', 'SEARCH_GUEST_INTERVAL_EXPLAIN' => 'Number of seconds guests must wait between searches. If one guest searches all others have to wait until the time interval passed.', - 'SEARCH_INDEX_CREATED' => 'Successfully indexed all posts in the board database', - 'SEARCH_INDEX_REMOVED' => 'Successfully deleted the search index for this backend', + 'SEARCH_INDEX_CREATED' => 'Successfully indexed all posts in the board database.', + 'SEARCH_INDEX_REMOVED' => 'Successfully deleted the search index for this backend.', 'SEARCH_INTERVAL' => 'User search flood interval', 'SEARCH_INTERVAL_EXPLAIN' => 'Number of seconds users must wait between searches. This interval is checked independendly for each user.', 'SEARCH_STORE_RESULTS' => 'Search result cache length', 'SEARCH_STORE_RESULTS_EXPLAIN' => 'Cached search results will expire after this time, in seconds. Set to 0 if you want to disable search cache.', - 'SEARCH_TYPE' => 'Search Backend', - 'SEARCH_TYPE_EXPLAIN' => 'phpBB allows you to choose the backend that is used for searching text in post contents. By default the search will use phpBB\'s own fulltext search.', + 'SEARCH_TYPE' => 'Search backend', + 'SEARCH_TYPE_EXPLAIN' => 'phpBB allows you to choose the backend that is used for searching text in post contents. By default the search will use phpBB’s own fulltext search.', 'SWITCHED_SEARCH_BACKEND' => 'You switched the search backend. In order to use the new search backend you should make sure that there is an index for the backend you chose.', 'TOTAL_WORDS' => 'Total number of indexed words', diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php index abf3685cf0..27ecbdb261 100644 --- a/phpBB/language/en/acp/styles.php +++ b/phpBB/language/en/acp/styles.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -31,15 +33,15 @@ if (empty($lang) || !is_array($lang)) $lang = array_merge($lang, array( 'ACP_IMAGESETS_EXPLAIN' => 'Imagesets comprise all the button, forum, folder, etc. and other non-style specific images used by the board. Here you can edit, export or delete existing imagesets and import or activate new sets.', 'ACP_STYLES_EXPLAIN' => 'Here you can manage the available styles on your board. A style consists off a template, theme and imageset. You may alter existing styles, delete, deactivate, reactivate, create or import new ones. You can also see what a style will look like using the preview function. The current default style is noted by the presence of an asterix (*). Also listed is the total user count for each style, note that overriding user styles will not be reflected here.', - 'ACP_TEMPLATES_EXPLAIN' => 'A Template set comprises all the markup used to generate the layout of your board. Here you can edit existing template sets, delete, export, import and preview sets. You can also modify the templating code used to generate BBCode.', - 'ACP_THEMES_EXPLAIN' => 'From here you can create, install, edit, delete and export themes. A theme is the combination of colours and images that are applied to your templates to define the basic look of your forum. The range of options open to you depends on the configuration of your server and phpBB installation, see the Manual for further details. Please note that when creating new themes the use of an existing theme as a basis is optional.', - 'ADD_IMAGESET' => 'Create Imageset', + 'ACP_TEMPLATES_EXPLAIN' => 'A template set comprises all the markup used to generate the layout of your board. Here you can edit existing template sets, delete, export, import and preview sets. You can also modify the templating code used to generate BBCode.', + 'ACP_THEMES_EXPLAIN' => 'From here you can create, install, edit, delete and export themes. A theme is the combination of colours and images that are applied to your templates to define the basic look of your forum. The range of options open to you depends on the configuration of your server and phpBB installation, see the manual for further details. Please note that when creating new themes the use of an existing theme as a basis is optional.', + 'ADD_IMAGESET' => 'Create imageset', 'ADD_IMAGESET_EXPLAIN' => 'Here you can create a new imageset. Depending on your server configuration and file permissions you may have additional options here. For example you may be able to base this imageset on an existing one. You may also be able to upload or import (from the store directory) a imageset archive. If you upload or import an archive the imageset name can be optionally taken from the archive name (to do this leave the imageset name blank).', - 'ADD_STYLE' => 'Create Style', + 'ADD_STYLE' => 'Create style', 'ADD_STYLE_EXPLAIN' => 'Here you can create a new style. Depending on your server configuration and file permissions you may have additional options. For example you may be able to base this style on an existing one. You may also be able to upload or import (from the store directory) a style archive. If you upload or import an archive the style name will be determined automatically.', - 'ADD_TEMPLATE' => 'Create Template', + 'ADD_TEMPLATE' => 'Create template', 'ADD_TEMPLATE_EXPLAIN' => 'Here you can add a new template. Depending on your server configuration and file permissions you may have additional options here. For example you may be able to base this template set on an existing one. You may also be able to upload or import (from the store directory) a template archive. If you upload or import an archive the template name can be optionally taken from the archive name (to do this leave the template name blank).', - 'ADD_THEME' => 'Create Theme', + 'ADD_THEME' => 'Create theme', 'ADD_THEME_EXPLAIN' => 'Here you can add a new theme. Depending on your server configuration and file permissions you may have additional options here. For example you may be able to base this theme on an existing one. You may also be able to upload or import (from the store directory) a theme archive. If you upload or import an archive the theme name can be optionally taken from the archive name (to do this leave the theme name blank).', 'ARCHIVE_FORMAT' => 'Archive file type', @@ -49,33 +51,33 @@ $lang = array_merge($lang, array( 'BACKGROUND_REPEAT' => 'Background repeat', 'BOLD' => 'Bold', - 'CACHE' => 'Cache', - 'CACHE_CACHED' => 'Cached', - 'CACHE_FILENAME' => 'Template file', - 'CACHE_FILESIZE' => 'Filesize', - 'CACHE_MODIFIED' => 'Modified', - 'CONFIRM_IMAGESET_REFRESH' => 'Are you sure you wish to refresh all imageset data? The settings from the imageset configuration file will overwrite all modifications to the imageset which have been carried out with the imageset editor.', + 'CACHE' => 'Cache', + 'CACHE_CACHED' => 'Cached', + 'CACHE_FILENAME' => 'Template file', + 'CACHE_FILESIZE' => 'Filesize', + 'CACHE_MODIFIED' => 'Modified', + 'CONFIRM_IMAGESET_REFRESH' => 'Are you sure you wish to refresh all imageset data? The settings from the imageset configuration file will overwrite all modifications to the imageset which have been carried out with the imageset editor.', 'CONFIRM_TEMPLATE_CLEAR_CACHE' => 'Are you sure you wish to clear all cached versions of your template files?', - 'CONFIRM_TEMPLATE_REFRESH' => 'Are you sure you wish to refresh all template data in the database with the contents of the template files on the filesystem? This will overwrite all modifications which have been carried out with the template editor while the template was stored in the database.', - 'CONFIRM_THEME_REFRESH' => 'Are you sure you wish to refresh the theme data stored in the database with the contents of the theme on the filesystem? This will overwrite all modifications which have been carried out with the theme editor while the theme was stored in the database.', - 'COPYRIGHT' => 'Copyright', - 'CREATE_IMAGESET' => 'Create new imageset', - 'CREATE_STYLE' => 'Create new style', - 'CREATE_TEMPLATE' => 'Create new template set', - 'CREATE_THEME' => 'Create new theme', - 'CSS_CLASS_NAME' => 'CSS class name', - 'CSS_COLOUR_EXPLAIN' => 'You can either enter a hex number for the colour or use the web safe colour swatch to select one.', - 'CURRENT_IMAGE' => 'Current Image', - 'CUSTOM_CLASS' => 'Custom class', - 'CUSTOM_CLASS_EXPLAIN' => 'You can add additional classes to this theme if you wish. You must provide the actual CSS class name below, it must be the same as that you have or will use in your template. Please remember that class names may contain only alphanumeric characters, periods (.), colons (:), dash (-) and number/hash/pound (#). The new class will be added to class selection above.', + 'CONFIRM_TEMPLATE_REFRESH' => 'Are you sure you wish to refresh all template data in the database with the contents of the template files on the filesystem? This will overwrite all modifications which have been carried out with the template editor while the template was stored in the database.', + 'CONFIRM_THEME_REFRESH' => 'Are you sure you wish to refresh the theme data stored in the database with the contents of the theme on the filesystem? This will overwrite all modifications which have been carried out with the theme editor while the theme was stored in the database.', + 'COPYRIGHT' => 'Copyright', + 'CREATE_IMAGESET' => 'Create new imageset', + 'CREATE_STYLE' => 'Create new style', + 'CREATE_TEMPLATE' => 'Create new template set', + 'CREATE_THEME' => 'Create new theme', + 'CSS_CLASS_NAME' => 'CSS class name', + 'CSS_COLOUR_EXPLAIN' => 'You can either enter a hexidecimal number for the colour or use the web safe colour swatch to select one.', + 'CURRENT_IMAGE' => 'Current image', + 'CUSTOM_CLASS' => 'Custom class', + 'CUSTOM_CLASS_EXPLAIN' => 'You can add additional classes to this theme if you wish. You must provide the actual CSS class name below, it must be the same as that you have or will use in your template. Please remember that class names may contain only alphanumeric characters, periods (.), colons (:), dash (-) and number/hash/pound (#). The new class will be added to class selection above.', 'DEACTIVATE_DEFAULT' => 'You cannot deactivate the default style.', 'DELETE_FROM_FS' => 'Delete from filesystem', - 'DELETE_IMAGESET' => 'Delete Imageset', + 'DELETE_IMAGESET' => 'Delete imageset', 'DELETE_IMAGESET_EXPLAIN' => 'Here you can remove the selected imageset from the database. Additionally, if you have permission you can elect to remove the set from the filesystem. Please note that there is no undo capability. When the imageset is deleted it is gone for good. It is recommended that you first export your set for possible future use.', 'DELETE_STYLE' => 'Delete style', 'DELETE_STYLE_EXPLAIN' => 'Here you can remove the selected style. You cannot remove all the style elements from here. These must be deleted individually via their respective forms. Take care in deleting styles there is no undo facility.', - 'DELETE_TEMPLATE' => 'Delete Template', + 'DELETE_TEMPLATE' => 'Delete template', 'DELETE_TEMPLATE_EXPLAIN' => 'Here you can remove the selected template set from the database. Additionally, if you have permission you can elect to remove the set from the filesystem. Please note that there is no undo capability. When the templates are deleted they are gone for good. It is recommended that you first export your set for possible future use.', 'DELETE_THEME' => 'Delete theme', 'DELETE_THEME_EXPLAIN' => 'Here you can remove the selected theme from the database. Additionally, if you have permission you can elect to remove the theme from the filesystem. Please note that there is no undo capability. When the theme is deleted it is gone for good. It is recommended that you first export your theme for possible future use.', @@ -84,7 +86,7 @@ $lang = array_merge($lang, array( 'EDIT_DETAILS_IMAGESET' => 'Edit imageset details', 'EDIT_DETAILS_IMAGESET_EXPLAIN' => 'Here you can edit certain imageset details such as its name.', - 'EDIT_DETAILS_STYLE' => 'Edit Style', + 'EDIT_DETAILS_STYLE' => 'Edit style', 'EDIT_DETAILS_STYLE_EXPLAIN' => 'Using the form below you can modify this existing style. You may alter the combination of template, theme and imageset which define the style itself. You may also make the style the default one.', 'EDIT_DETAILS_TEMPLATE' => 'Edit template details', 'EDIT_DETAILS_TEMPLATE_EXPLAIN' => 'Here you can edit certain templates details such as its name. You may also have the option to switch storage of the stylesheet from the filesystem to the database and vice versa. This option depends on your PHP configuration and whether your template set can be written to by the webserver.', @@ -103,7 +105,7 @@ $lang = array_merge($lang, array( 'FOREGROUND' => 'Foreground', 'FONT_COLOUR' => 'Font colour', 'FONT_FACE' => 'Font face', - 'FONT_FACE_EXPLAIN' => 'You can specify multiple fonts seperated by commas. If a user doesn\'t have the first font installed the first other working font will be chosen.', + 'FONT_FACE_EXPLAIN' => 'You can specify multiple fonts seperated by commas. If a user doesn’t have the first font installed the first other working font will be chosen.', 'FONT_SIZE' => 'Font size', 'GLOBAL_IMAGES' => 'Global', @@ -118,24 +120,24 @@ $lang = array_merge($lang, array( 'IMAGE_NAME' => 'Image name', 'IMAGE_PARAMETER' => 'Parameter', 'IMAGE_VALUE' => 'Value', - 'IMAGESET_ADDED' => 'New imageset added on filesystem', - 'IMAGESET_ADDED_DB' => 'New imageset added to database', - 'IMAGESET_DELETED' => 'Imageset deleted successfully', - 'IMAGESET_DELETED_FS' => 'Imageset removed from database but some files may remain on the filesystem', - 'IMAGESET_DETAILS_UPDATED' => 'Imageset details successfully updated', - 'IMAGESET_ERR_ARCHIVE' => 'Please select an archive method', - 'IMAGESET_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters', - 'IMAGESET_ERR_NAME_CHARS' => 'The imageset name can only contain alphanumeric characters, -, +, _ and space', - 'IMAGESET_ERR_NAME_EXIST' => 'A imageset with that name already exists', - 'IMAGESET_ERR_NAME_LONG' => 'The imageset name can be no longer than 30 characters', + 'IMAGESET_ADDED' => 'New imageset added on filesystem.', + 'IMAGESET_ADDED_DB' => 'New imageset added to database.', + 'IMAGESET_DELETED' => 'Imageset deleted successfully.', + 'IMAGESET_DELETED_FS' => 'Imageset removed from database but some files may remain on the filesystem.', + 'IMAGESET_DETAILS_UPDATED' => 'Imageset details successfully updated.', + 'IMAGESET_ERR_ARCHIVE' => 'Please select an archive method.', + 'IMAGESET_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters.', + 'IMAGESET_ERR_NAME_CHARS' => 'The imageset name can only contain alphanumeric characters, -, +, _ and space.', + 'IMAGESET_ERR_NAME_EXIST' => 'A imageset with that name already exists.', + 'IMAGESET_ERR_NAME_LONG' => 'The imageset name can be no longer than 30 characters.', 'IMAGESET_ERR_NOT_IMAGESET' => 'The archive you specified does not contain a valid imageset.', - 'IMAGESET_ERR_STYLE_NAME' => 'You must supply a name for this imageset', + 'IMAGESET_ERR_STYLE_NAME' => 'You must supply a name for this imageset.', 'IMAGESET_EXPORT' => 'Export Imageset', 'IMAGESET_EXPORT_EXPLAIN' => 'Here you can export an imageset in the form of an archive. This archive will contain all the data necessary to install the set of images on another board. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.', - 'IMAGESET_EXPORTED' => 'Imageset exported succesfully and stored in %s', + 'IMAGESET_EXPORTED' => 'Imageset exported succesfully and stored in %s.', 'IMAGESET_NAME' => 'Imageset Name', - 'IMAGESET_REFRESHED' => 'Imageset refreshed successfully', - 'IMAGESET_UPDATED' => 'Imageset updated successfully', + 'IMAGESET_REFRESHED' => 'Imageset refreshed successfully.', + 'IMAGESET_UPDATED' => 'Imageset updated successfully.', 'ITALIC' => 'Italic', 'IMG_CAT_BUTTONS' => 'Localised buttons', @@ -280,22 +282,22 @@ $lang = array_merge($lang, array( 'EDITED_IMAGESET' => 'Edited imageset', - 'NO_CLASS' => 'Cannot find class in stylesheet', - 'NO_IMAGESET' => 'Cannot find imageset on filesystem', + 'NO_CLASS' => 'Cannot find class in stylesheet.', + 'NO_IMAGESET' => 'Cannot find imageset on filesystem.', 'NO_IMAGE' => 'No Image', - 'NO_STYLE' => 'Cannot find style on filesystem', - 'NO_TEMPLATE' => 'Cannot find template on filesystem', - 'NO_THEME' => 'Cannot find theme on filesystem', + 'NO_STYLE' => 'Cannot find style on filesystem.', + 'NO_TEMPLATE' => 'Cannot find template on filesystem.', + 'NO_THEME' => 'Cannot find theme on filesystem.', 'NO_UNINSTALLED_IMAGESET' => 'No uninstalled imagesets detected', 'NO_UNINSTALLED_STYLE' => 'No uninstalled styles detected', 'NO_UNINSTALLED_TEMPLATE' => 'No uninstalled templates detected', 'NO_UNINSTALLED_THEME' => 'No uninstalled themes detected', 'NO_UNIT' => 'None', - 'ONLY_IMAGESET' => 'This is the only remaining imageset, you cannot delete it', - 'ONLY_STYLE' => 'This is the only remaining style, you cannot delete it', - 'ONLY_TEMPLATE' => 'This is the only remaining template set, you cannot delete it', - 'ONLY_THEME' => 'This is the only remaining theme, you cannot delete it', + 'ONLY_IMAGESET' => 'This is the only remaining imageset, you cannot delete it.', + 'ONLY_STYLE' => 'This is the only remaining style, you cannot delete it.', + 'ONLY_TEMPLATE' => 'This is the only remaining template set, you cannot delete it.', + 'ONLY_THEME' => 'This is the only remaining theme, you cannot delete it.', 'OPTIONAL_BASIS' => 'Optional basis', 'REFRESH' => 'Refresh', @@ -318,7 +320,7 @@ $lang = array_merge($lang, array( 'SELECT_IMAGE' => 'Select image', 'SELECT_TEMPLATE' => 'Select template file', 'SELECT_CLASS' => 'Select CSS class', - 'SELECTED_IMAGE' => 'Selected Image', + 'SELECTED_IMAGE' => 'Selected image', 'SELECTED_IMAGESET' => 'Selected imageset', 'SELECTED_TEMPLATE' => 'Selected template', 'SELECTED_TEMPLATE_FILE' => 'Selected template file', @@ -331,83 +333,83 @@ $lang = array_merge($lang, array( 'STORE_FILESYSTEM' => 'Filesystem', 'STYLE_ACTIVATE' => 'Activate', 'STYLE_ACTIVE' => 'Active', - 'STYLE_ADDED' => 'Style added successfully', + 'STYLE_ADDED' => 'Style added successfully.', 'STYLE_DEACTIVATE' => 'Deactivate', 'STYLE_DEFAULT' => 'Make default style', - 'STYLE_DELETED' => 'Style deleted successfully', - 'STYLE_DETAILS_UPDATED' => 'Style edited successfully', - 'STYLE_ERR_ARCHIVE' => 'Please select an archive method', - 'STYLE_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters', + 'STYLE_DELETED' => 'Style deleted successfully.', + 'STYLE_DETAILS_UPDATED' => 'Style edited successfully.', + 'STYLE_ERR_ARCHIVE' => 'Please select an archive method.', + 'STYLE_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters.', 'STYLE_ERR_MORE_ELEMENTS' => 'You must select at least one style element.', - 'STYLE_ERR_NAME_CHARS' => 'The style name can only contain alphanumeric characters, -, +, _ and space', - 'STYLE_ERR_NAME_EXIST' => 'A style with that name already exists', - 'STYLE_ERR_NAME_LONG' => 'The style name can be no longer than 30 characters', - 'STYLE_ERR_NO_IDS' => 'You must select a template, theme and imageset for this style', + 'STYLE_ERR_NAME_CHARS' => 'The style name can only contain alphanumeric characters, -, +, _ and space.', + 'STYLE_ERR_NAME_EXIST' => 'A style with that name already exists.', + 'STYLE_ERR_NAME_LONG' => 'The style name can be no longer than 30 characters.', + 'STYLE_ERR_NO_IDS' => 'You must select a template, theme and imageset for this style.', 'STYLE_ERR_NOT_STYLE' => 'The imported or uploaded file did not contain a valid style archive.', - 'STYLE_ERR_STYLE_NAME' => 'You must supply a name for this style', + 'STYLE_ERR_STYLE_NAME' => 'You must supply a name for this style.', 'STYLE_EXPORT' => 'Export Style', 'STYLE_EXPORT_EXPLAIN' => 'Here you can export a style in the form of an archive. A style does not need to contain all elements but it must contain at least one. For example if you have created a new theme and imageset for a commonly used template you could simply export the theme and imageset and ommit the template. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.', - 'STYLE_EXPORTED' => 'Style exported succesfully and stored in %s', + 'STYLE_EXPORTED' => 'Style exported succesfully and stored in %s.', 'STYLE_IMAGESET' => 'Imageset', 'STYLE_NAME' => 'Style name', 'STYLE_TEMPLATE' => 'Template', 'STYLE_THEME' => 'Theme', 'STYLE_USED_BY' => 'Used by', - 'TEMPLATE_ADDED' => 'Template set added and stored on filesystem', - 'TEMPLATE_ADDED_DB' => 'Template set added and stored in database', + 'TEMPLATE_ADDED' => 'Template set added and stored on filesystem.', + 'TEMPLATE_ADDED_DB' => 'Template set added and stored in database.', 'TEMPLATE_CACHE' => 'Template cache', 'TEMPLATE_CACHE_EXPLAIN' => 'By default phpBB caches the compiled version of its templates. This decreases the load on the server each time a page is viewed and thus may reduce the page generation time. Here you can view the cache status of each file and delete individual files or the entire cache.', - 'TEMPLATE_CACHE_CLEARED' => 'Template cache cleared successfully', + 'TEMPLATE_CACHE_CLEARED' => 'Template cache cleared successfully.', 'TEMPLATE_CACHE_EMPTY' => 'There are no cached templates.', - 'TEMPLATE_DELETED' => 'Template set deleted successfully', - 'TEMPLATE_DELETED_FS' => 'Template set removed from database but some files may remain on the filesystem', - 'TEMPLATE_DETAILS_UPDATED' => 'Template details successfully updated', + 'TEMPLATE_DELETED' => 'Template set deleted successfully.', + 'TEMPLATE_DELETED_FS' => 'Template set removed from database but some files may remain on the filesystem.', + 'TEMPLATE_DETAILS_UPDATED' => 'Template details successfully updated.', 'TEMPLATE_EDITOR' => 'Raw HTML template editor', 'TEMPLATE_EDITOR_HEIGHT' => 'Template editor height', - 'TEMPLATE_ERR_ARCHIVE' => 'Please select an archive method', + 'TEMPLATE_ERR_ARCHIVE' => 'Please select an archive method.', 'TEMPLATE_ERR_CACHE_READ' => 'The cache directory used to store cached versions of template files could not be opened.', - 'TEMPLATE_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters', - 'TEMPLATE_ERR_NAME_CHARS' => 'The template name can only contain alphanumeric characters, -, +, _ and space', - 'TEMPLATE_ERR_NAME_EXIST' => 'A template set with that name already exists', - 'TEMPLATE_ERR_NAME_LONG' => 'The template name can be no longer than 30 characters', + 'TEMPLATE_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters.', + 'TEMPLATE_ERR_NAME_CHARS' => 'The template name can only contain alphanumeric characters, -, +, _ and space.', + 'TEMPLATE_ERR_NAME_EXIST' => 'A template set with that name already exists.', + 'TEMPLATE_ERR_NAME_LONG' => 'The template name can be no longer than 30 characters.', 'TEMPLATE_ERR_NOT_TEMPLATE' => 'The archive you specified does not contain a valid template set.', - 'TEMPLATE_ERR_STYLE_NAME' => 'You must supply a name for this templates', - 'TEMPLATE_EXPORT' => 'Export Templates', + 'TEMPLATE_ERR_STYLE_NAME' => 'You must supply a name for this templates.', + 'TEMPLATE_EXPORT' => 'Export templates', 'TEMPLATE_EXPORT_EXPLAIN' => 'Here you can export a template set in the form of an archive. This archive will contain all the files necessary to install the templates on another board. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.', - 'TEMPLATE_EXPORTED' => 'Templates exported succesfully and stored in %s', + 'TEMPLATE_EXPORTED' => 'Templates exported succesfully and stored in %s.', 'TEMPLATE_FILE' => 'Template file', - 'TEMPLATE_FILE_UPDATED' => 'Template file updated successfully', + 'TEMPLATE_FILE_UPDATED' => 'Template file updated successfully.', 'TEMPLATE_LOCATION' => 'Store templates in', 'TEMPLATE_LOCATION_EXPLAIN' => 'Images are always stored on the filesystem.', 'TEMPLATE_NAME' => 'Template name', - 'TEMPLATE_REFRESHED' => 'Template refreshed successfully', - - 'THEME_ADDED' => 'New theme added on filesystem', - 'THEME_ADDED_DB' => 'New theme added to database', - 'THEME_CLASS_ADDED' => 'Custom class added successfully', - 'THEME_DELETED' => 'Theme deleted successfully', - 'THEME_DELETED_FS' => 'Theme removed from database but files remain on the filesystem', - 'THEME_DETAILS_UPDATED' => 'Theme details successfully updated', + 'TEMPLATE_REFRESHED' => 'Template refreshed successfully.', + + 'THEME_ADDED' => 'New theme added on filesystem.', + 'THEME_ADDED_DB' => 'New theme added to database.', + 'THEME_CLASS_ADDED' => 'Custom class added successfully.', + 'THEME_DELETED' => 'Theme deleted successfully.', + 'THEME_DELETED_FS' => 'Theme removed from database but files remain on the filesystem.', + 'THEME_DETAILS_UPDATED' => 'Theme details successfully updated.', 'THEME_EDITOR' => 'Raw CSS theme editor', 'THEME_EDITOR_HEIGHT' => 'Theme editor height', - 'THEME_ERR_ARCHIVE' => 'Please select an archive method', + 'THEME_ERR_ARCHIVE' => 'Please select an archive method.', 'THEME_ERR_CLASS_CHARS' => 'Only alphanumeric characters plus ., :, - and # are valid in class names.', - 'THEME_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters', - 'THEME_ERR_NAME_CHARS' => 'The theme name can only contain alphanumeric characters, -, +, _ and space', - 'THEME_ERR_NAME_EXIST' => 'A theme with that name already exists', - 'THEME_ERR_NAME_LONG' => 'The theme name can be no longer than 30 characters', + 'THEME_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters.', + 'THEME_ERR_NAME_CHARS' => 'The theme name can only contain alphanumeric characters, -, +, _ and space.', + 'THEME_ERR_NAME_EXIST' => 'A theme with that name already exists.', + 'THEME_ERR_NAME_LONG' => 'The theme name can be no longer than 30 characters.', 'THEME_ERR_NOT_THEME' => 'The archive you specified does not contain a valid theme.', 'THEME_ERR_REFRESH_FS' => 'This theme is stored on the filesystem so there is no need to refresh it.', - 'THEME_ERR_STYLE_NAME' => 'You must supply a name for this theme', + 'THEME_ERR_STYLE_NAME' => 'You must supply a name for this theme.', 'THEME_EXPORT' => 'Export Theme', 'THEME_EXPORT_EXPLAIN' => 'Here you can export a theme in the form of an archive. This archive will contain all the data necessary to install the theme on another board. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.', - 'THEME_EXPORTED' => 'Theme exported succesfully and stored in %s', + 'THEME_EXPORTED' => 'Theme exported succesfully and stored in %s.', 'THEME_LOCATION' => 'Store stylesheet in', 'THEME_LOCATION_EXPLAIN' => 'Images are always stored on the filesystem.', 'THEME_NAME' => 'Theme Name', - 'THEME_REFRESHED' => 'Theme refreshed successfully', - 'THEME_UPDATED' => 'Class updated successfully', + 'THEME_REFRESHED' => 'Theme refreshed successfully.', + 'THEME_UPDATED' => 'Class updated successfully.', 'UNDERLINE' => 'Underline', 'UNINSTALLED_IMAGESET' => 'Uninstalled imagesets', diff --git a/phpBB/language/en/acp/users.php b/phpBB/language/en/acp/users.php index 6398ff8f70..afa1697534 100644 --- a/phpBB/language/en/acp/users.php +++ b/phpBB/language/en/acp/users.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -30,24 +32,31 @@ if (empty($lang) || !is_array($lang)) $lang = array_merge($lang, array( 'ADMIN_SIG_PREVIEW' => 'Signature preview', - 'AT_LEAST_ONE_FOUNDER' => 'You are not able to change this founder to a normal user. There needs to be at least one founder enabled for this board. If you want to change this users founder status promote another user to be a founder first.', + 'AT_LEAST_ONE_FOUNDER' => 'You are not able to change this founder to a normal user. There needs to be at least one founder enabled for this board. If you want to change this users founder status, promote another user to be a founder first.', - 'BAN_SUCCESSFUL' => 'Ban entered successfully', + 'BAN_SUCCESSFUL' => 'Ban entered successfully.', + 'CANNOT_BAN_FOUNDER' => 'You are not allowed to ban founder accounts.', 'CANNOT_BAN_YOURSELF' => 'You are not allowed to ban yourself.', + 'CANNOT_DEACTIVATE_BOT' => 'You are not allowed to deactivate bot accounts. Please deactivate the bot instead.', + 'CANNOT_DEACTIVATE_FOUNDER' => 'You are not allowed to deactivate founder accounts.', 'CANNOT_DEACTIVATE_YOURSELF' => 'You are not allowed to deactivate your own account.', + 'CANNOT_FORCE_REACT_BOT' => 'You are not allowed to force reactivation on bot accounts. Please deactivate the bot instead.', + 'CANNOT_FORCE_REACT_FOUNDER' => 'You are not allowed to force reactivation on founder accounts.', 'CANNOT_FORCE_REACT_YOURSELF' => 'You are not allowed to force reactivation of your own account.', 'CANNOT_REMOVE_ANONYMOUS' => 'You are not able to remove the guest user account.', 'CANNOT_REMOVE_YOURSELF' => 'You are not allowed to remove your own user account.', + 'CANNOT_SET_FOUNDER_BOT' => 'You are not able to promote ignored users to be founders.', + 'CANNOT_SET_FOUNDER_INACTIVE' => 'You need to activate users before you promote them to founders, only activated users are able to be promoted.', 'CONFIRM_EMAIL_EXPLAIN' => 'You only need to specify this if you are changing the users email address.', - + 'DELETE_POSTS' => 'Delete posts', 'DELETE_USER' => 'Delete user', 'DELETE_USER_EXPLAIN' => 'Please note that deleting a user is final, they cannot be recovered', - 'FORCE_REACTIVATION_SUCCESS' => 'Successfully forced re-activation', + 'FORCE_REACTIVATION_SUCCESS' => 'Successfully forced re-activation.', 'FOUNDER' => 'Founder', - 'FOUNDER_EXPLAIN' => 'Founders can never be banned, deleted or altered by non-founder members', + 'FOUNDER_EXPLAIN' => 'Founders have all admin permissions and can never be banned, deleted or altered by non-founder members', 'GROUP_DEFAULT' => 'Default', 'GROUP_DELETE' => 'Delete', @@ -72,10 +81,10 @@ $lang = array_merge($lang, array( 'SELECT_FORM' => 'Select form', 'SELECT_USER' => 'Select User', - 'USER_ADMIN' => 'User Administration', + 'USER_ADMIN' => 'User administration', 'USER_ADMIN_ACTIVATE' => 'Activate account', - 'USER_ADMIN_ACTIVATED' => 'User activated successfully', - 'USER_ADMIN_AVATAR_REMOVED' => 'Successfully removed avatar from user account', + 'USER_ADMIN_ACTIVATED' => 'User activated successfully.', + 'USER_ADMIN_AVATAR_REMOVED' => 'Successfully removed avatar from user account.', 'USER_ADMIN_BAN_EMAIL' => 'Ban by email', 'USER_ADMIN_BAN_EMAIL_REASON' => 'Email address banned via user management', 'USER_ADMIN_BAN_IP' => 'Ban by IP', @@ -83,7 +92,7 @@ $lang = array_merge($lang, array( 'USER_ADMIN_BAN_NAME_REASON' => 'Username banned via user management', 'USER_ADMIN_BAN_USER' => 'Ban by username', 'USER_ADMIN_DEACTIVATE' => 'Deactivate account', - 'USER_ADMIN_DEACTIVED' => 'User deactivated successfully', + 'USER_ADMIN_DEACTIVED' => 'User deactivated successfully.', 'USER_ADMIN_DEL_ATTACH' => 'Delete all attachments', 'USER_ADMIN_DEL_AVATAR' => 'Delete avatar', 'USER_ADMIN_DEL_POSTS' => 'Delete all posts', @@ -91,24 +100,25 @@ $lang = array_merge($lang, array( 'USER_ADMIN_EXPLAIN' => 'Here you can change your users information and certain specific options. To modify the users permissions please use the user and group permissions system.', 'USER_ADMIN_FORCE' => 'Force re-activation', '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_UPDATED' => 'Successfully updated user avatars details', + 'USER_ADMIN_SIG_REMOVED' => 'Successfully removed signature from user account.', + 'USER_ATTACHMENTS_REMOVED' => 'Successfully removed all attachments made by this user.', + 'USER_AVATAR_UPDATED' => 'Successfully updated user avatars details.', 'USER_CUSTOM_PROFILE_FIELDS' => 'Custom profile fields', - 'USER_DELETED' => 'User deleted successfully', + 'USER_DELETED' => 'User deleted successfully.', 'USER_GROUP_ADD' => 'Add user to group', 'USER_GROUP_NORMAL' => 'Normal groups user is a member of', 'USER_GROUP_PENDING' => 'Groups user is in pending mode', 'USER_GROUP_SPECIAL' => 'Special groups user is a member of', - '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', - 'USER_PREFS_UPDATED' => 'User preferences updated', + 'USER_IS_INACTIVE' => 'User is inactive', + '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.', + 'USER_PREFS_UPDATED' => 'User preferences updated.', 'USER_PROFILE' => 'User Profile', - 'USER_PROFILE_UPDATED' => 'User profile updated', + 'USER_PROFILE_UPDATED' => 'User profile updated.', 'USER_RANK' => 'User Rank', - 'USER_RANK_UPDATED' => 'User rank updated', - 'USER_SIG_UPDATED' => 'User signature successfully updated', + 'USER_RANK_UPDATED' => 'User rank updated.', + 'USER_SIG_UPDATED' => 'User signature successfully updated.', 'USER_TOOLS' => 'Basic tools', 'WARNINGS_EXPLAIN' => 'You can directly alter the warnings this users has received.', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 183f465a98..d7e4cbd50e 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang)) // 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 @@ -30,11 +32,11 @@ if (empty($lang) || !is_array($lang)) $lang = array_merge($lang, array( 'TRANSLATION_INFO' => '', - 'ENCODING' => 'iso-8859-1', 'DIRECTION' => 'ltr', 'LEFT' => 'left', 'RIGHT' => 'right', 'DATE_FORMAT' => '|d M Y|', + 'USER_LANG' => 'en-gb', '1_DAY' => '1 day', '1_MONTH' => '1 month', @@ -52,6 +54,7 @@ $lang = array_merge($lang, array( 'ADMINISTRATOR' => 'Administrator', 'ADMINISTRATORS' => 'Administrators', 'AGE' => 'Age', + 'AIM' => 'AIM', 'ALLOWED' => 'Allowed', 'ALL_FILES' => 'All files', 'ALL_FORUMS' => 'All forums', @@ -72,8 +75,8 @@ $lang = array_merge($lang, array( 'AVATAR_NOT_UPLOADED' => 'Avatar could not be uploaded.', 'AVATAR_NO_SIZE' => 'Could not obtain width or height of linked avatar, please enter them manually.', 'AVATAR_PARTIAL_UPLOAD' => 'The uploaded file was only partially uploaded', - 'AVATAR_PHP_SIZE_NA' => 'The avatar\'s filesize is too large.<br />Could not determine the maximum size defined by PHP in php.ini.', - 'AVATAR_PHP_SIZE_OVERRUN' => 'The avatar\'s filesize is too large, maximum upload size is %d MB.<br />Please note this is set in php.ini and cannot be overriden.', + 'AVATAR_PHP_SIZE_NA' => 'The avatar’s filesize is too large.<br />Could not determine the maximum size defined by PHP in php.ini.', + 'AVATAR_PHP_SIZE_OVERRUN' => 'The avatar’s filesize is too large, maximum upload size is %d MB.<br />Please note this is set in php.ini and cannot be overriden.', 'AVATAR_URL_INVALID' => 'The URL you specified is invalid.', 'AVATAR_URL_NOT_FOUND' => 'The file specified could not be found.', 'AVATAR_WRONG_FILESIZE' => 'The avatar must be between 0 and %1d %2s.', @@ -81,6 +84,9 @@ $lang = array_merge($lang, array( 'BACK_TO_TOP' => 'Top', 'BACK_TO_PREV' => 'Back to previous page', + 'BAN_TRIGGERED_BY_EMAIL'=> 'This ban has been issued on your email address.', + 'BAN_TRIGGERED_BY_IP' => 'This ban has been issued on your ip address.', + 'BAN_TRIGGERED_BY_USER' => 'This ban has been issued on your username.', 'BBCODE_GUIDE' => 'BBCode guide', 'BCC' => 'BCC', 'BIRTHDAYS' => 'Birthdays', @@ -96,6 +102,7 @@ $lang = array_merge($lang, array( 'CANCEL' => 'Cancel', 'CHANGE' => 'Change', + 'CHANGE_FONT_SIZE' => 'Change font size', 'CLICK_VIEW_PRIVMSG' => '%sGo to your inbox%s', 'CLOSE_WINDOW' => 'Close window', 'COLOUR_SWATCH' => 'Colour swatch', @@ -107,7 +114,7 @@ $lang = array_merge($lang, array( 'CONNECTION_FAILED' => 'Connection failed', 'CONNECTION_SUCCESS' => 'Connection was successful!', 'COOKIES_DELETED' => 'All board cookies successfully deleted.', - 'CURRENT_TIME' => 'The time is %s', + 'CURRENT_TIME' => 'It is currently %s', 'DAY' => 'Day', 'DAYS' => 'Days', @@ -133,13 +140,15 @@ $lang = array_merge($lang, array( 'EDIT_POST' => 'Edit post', 'EMAIL' => 'Email', 'EMAIL_ADDRESS' => 'Email address', - 'EMAIL_SMTP_ERROR_RESPONSE' => "Ran into problems sending Mail at <strong>Line %s</strong>. Response: %s", + 'EMAIL_SMTP_ERROR_RESPONSE' => 'Ran into problems sending email at <strong>Line %1$s</strong>. Response: %2$s', 'EMPTY_SUBJECT' => 'You must specify a subject when posting a new topic.', 'ENABLED' => 'Enabled', 'ENCLOSURE' => 'Enclosure', 'ERR_CHANGING_DIRECTORY' => 'Unable to change directory', 'ERR_CONNECTING_SERVER' => 'Error connecting to the server', 'ERR_UNABLE_TO_LOGIN' => 'Error on login. Supplied username or password wrong.', + 'ERR_WRONG_PATH_TO_PHPBB' => 'The phpBB path entered seems to be not valid.', + 'EXPAND_VIEW' => 'Expand view', 'EXTENSION' => 'Extension', 'EXTENSION_DISABLED_AFTER_POSTING' => 'The extension <strong>%s</strong> has been deactivated and can no longer be displayed', @@ -147,6 +156,7 @@ $lang = array_merge($lang, array( 'FAQ_EXPLAIN' => 'Frequently Asked Questions', 'FILENAME' => 'Filename', 'FILESIZE' => 'Filesize', + 'FILEDATE' => 'Filedate', 'FILE_COMMENT' => 'File comment', 'FILE_NOT_FOUND' => 'The requested file could not be found', 'FIND_USERNAME' => 'Find a member', @@ -208,8 +218,6 @@ $lang = array_merge($lang, array( 'G_ADMINISTRATORS' => 'Administrators', 'G_BOTS' => 'Bots', 'G_GUESTS' => 'Guests', - 'G_INACTIVE' => 'Unapproved Users', - 'G_INACTIVE_COPPA' => 'Unapproved COPPA Users', 'G_REGISTERED' => 'Registered Users', 'G_REGISTERED_COPPA' => 'Registered COPPA Users', 'G_GLOBAL_MODERATORS' => 'Global Moderators', @@ -225,9 +233,12 @@ $lang = array_merge($lang, array( 'HOURS' => 'Hours', 'HOME' => 'Home', - 'ICQ_STATUS' => 'ICQ status', + 'ICQ' => 'ICQ', + 'ICQ_STATUS' => 'ICQ status', 'IF' => 'if', 'IMAGE' => 'Image', + 'IMAGE_FILETYPE_INVALID' => 'Image filetype %d for mimetype %s not supported.', + 'IMAGE_FILETYPE_MISMATCH' => 'Image filetype mismatch: expected extension %1$s but extension %2$s given.', 'IN' => 'in', 'INDEX' => 'Index page', 'INFORMATION' => 'Information', @@ -235,57 +246,59 @@ $lang = array_merge($lang, array( 'INVALID_DIGEST_CHALLENGE' => 'Invalid digest challenge', 'INVALID_EMAIL_LOG' => '<strong>%s</strong> possibly an invalid email address?', 'IP' => 'IP', + 'IP_BLACKLISTED' => 'Your IP %1$s has been blocked because it is blacklisted. For details please see <a href="%2$s">%2$s</a>.', + 'JABBER' => 'Jabber', 'JOINED' => 'Joined', 'JUMP_PAGE' => 'Enter the page number you wish to go to', 'JUMP_TO' => 'Jump to', - 'JUMP_TO_PAGE' => 'Click to jump to page...', - - 'KB' => 'KB', - - 'LAST_POST' => 'Last post', - 'LAST_UPDATED' => 'Last updated', - 'LAST_VISIT' => 'Last visit', - 'LDAP_NO_LDAP_EXTENSION' => 'LDAP extension not availible', - 'LDAP_NO_SERVER_CONNECTION' => 'Could not connect to LDAP server', - 'LEGEND' => 'Legend', - 'LOCATION' => 'Location', - 'LOCK_POST' => 'Lock Post', - 'LOCK_POST_EXPLAIN' => 'Prevent editing', - 'LOCK_TOPIC' => 'Lock topic', - 'LOGIN' => 'Login', - 'LOGIN_CHECK_PM' => 'Log in to check your private messages', - 'LOGIN_CONFIRMATION' => 'Confirmation of login', - 'LOGIN_CONFIRM_EXPLAIN' => 'To prevent brute forcing accounts the board administrator requires you to enter a confirmation code after a maximum amount of failed logins. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.', - 'LOGIN_ERROR_ATTEMPTS' => 'You exceeded the maximum allowed number of login attempts. In addition to your username and password you now have to additionally confirm the image you see below.', + 'JUMP_TO_PAGE' => 'Click to jump to page…', + + 'KB' => 'KB', + + 'LAST_POST' => 'Last post', + 'LAST_UPDATED' => 'Last updated', + 'LAST_VISIT' => 'Last visit', + 'LDAP_NO_LDAP_EXTENSION' => 'LDAP extension not availible', + 'LDAP_NO_SERVER_CONNECTION' => 'Could not connect to LDAP server', + 'LEGEND' => 'Legend', + 'LOCATION' => 'Location', + 'LOCK_POST' => 'Lock post', + 'LOCK_POST_EXPLAIN' => 'Prevent editing', + 'LOCK_TOPIC' => 'Lock topic', + 'LOGIN' => 'Login', + 'LOGIN_CHECK_PM' => 'Log in to check your private messages', + 'LOGIN_CONFIRMATION' => 'Confirmation of login', + 'LOGIN_CONFIRM_EXPLAIN' => 'To prevent brute forcing accounts the board administrator requires you to enter a confirmation code after a maximum amount of failed logins. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.', + 'LOGIN_ERROR_ATTEMPTS' => 'You exceeded the maximum allowed number of login attempts. In addition to your username and password you now also have to enter the confirm code from the image you see below.', 'LOGIN_ERROR_EXTERNAL_AUTH_APACHE' => 'You have not been authenticated by apache.', - 'LOGIN_ERROR_PASSWORD' => 'You have specified an incorrect password. Please check your password and try again. If you continue to have problems please contact the %sBoard Administrator%s.', - 'LOGIN_ERROR_USERNAME' => 'You have specified an incorrect username. Please check your username and try again. If you continue to have problems please contact the %sBoard Administrator%s.', - 'LOGIN_FORUM' => 'To view or post in this forum you must enter its password.', - 'LOGIN_INFO' => 'In order to login you must be registered. Registering takes only a few seconds but gives you increased capabilies. The board administrator may also grant additional permissions to registered users. Before you login please ensure you are familiar with our terms of use and related policies. Please ensure you read any forum rules as you navigate around the board.', - 'LOGIN_VIEWFORUM' => 'The board administrator requires you to be registered and logged in to view this forum.', - 'LOGIN_EXPLAIN_EDIT' => 'In order to edit posts in this forum you have to be registered and logged in.', - 'LOGOUT' => 'Logout', - 'LOGOUT_USER' => 'Logout [ %s ]', - 'LOG_ME_IN' => 'Log me on automatically each visit', - - 'MARK' => 'Mark', - 'MARK_ALL' => 'Mark all', - 'MARK_FORUMS_READ' => 'Mark forums read', - 'MB' => 'MB', - 'MCP' => 'Moderator Control Panel', - 'MEMBERLIST' => 'Members', + 'LOGIN_ERROR_PASSWORD' => 'You have specified an incorrect password. Please check your password and try again. If you continue to have problems please contact the %sBoard Administrator%s.', + 'LOGIN_ERROR_USERNAME' => 'You have specified an incorrect username. Please check your username and try again. If you continue to have problems please contact the %sBoard Administrator%s.', + 'LOGIN_FORUM' => 'To view or post in this forum you must enter its password.', + 'LOGIN_INFO' => 'In order to login you must be registered. Registering takes only a few seconds but gives you increased capabilities. The board administrator may also grant additional permissions to registered users. Before you login please ensure you are familiar with our terms of use and related policies. Please ensure you read any forum rules as you navigate around the board.', + 'LOGIN_VIEWFORUM' => 'The board administrator requires you to be registered and logged in to view this forum.', + 'LOGIN_EXPLAIN_EDIT' => 'In order to edit posts in this forum you have to be registered and logged in.', + 'LOGOUT' => 'Logout', + 'LOGOUT_USER' => 'Logout [ %s ]', + 'LOG_ME_IN' => 'Log me on automatically each visit', + + 'MARK' => 'Mark', + 'MARK_ALL' => 'Mark all', + 'MARK_FORUMS_READ' => 'Mark forums read', + 'MB' => 'MB', + 'MCP' => 'Moderator Control Panel', + 'MEMBERLIST' => 'Members', 'MEMBERLIST_EXPLAIN' => 'View complete list of members', - 'MERGE_TOPIC' => 'Merge Topic', - 'MESSAGE' => 'Message', - 'MESSAGES' => 'Messages', - 'MESSAGE_BODY' => 'Message body', - 'MINUTES' => 'Minutes', - 'MODERATE' => 'Moderate', - 'MODERATOR' => 'Moderator', - 'MODERATORS' => 'Moderators', - 'MONTH' => 'Month', - 'MOVE' => 'Move', + 'MERGE_TOPIC' => 'Merge Topic', + 'MESSAGE' => 'Message', + 'MESSAGES' => 'Messages', + 'MESSAGE_BODY' => 'Message body', + 'MINUTES' => 'Minutes', + 'MODERATE' => 'Moderate', + 'MODERATOR' => 'Moderator', + 'MODERATORS' => 'Moderators', + 'MONTH' => 'Month', + 'MOVE' => 'Move', 'NA' => 'N/A', 'NEWEST_USER' => 'Our newest member <strong>%s%s%s</strong>', @@ -302,35 +315,40 @@ $lang = array_merge($lang, array( 'NOT_WATCHING_FORUM' => 'You are no longer subscribed to updates on this forum.', 'NOT_WATCHING_TOPIC' => 'You are no longer subscribed to this topic.', 'NO_ACCESS_ATTACHMENT' => 'You are not allowed to access this file.', + 'NO_ACTION' => 'No action specified.', 'NO_ADMINISTRATORS' => 'No administrators assigned at this board.', 'NO_AUTH_ADMIN' => 'You do not have admin permissions and therefore not allowed to access the administration control panel.', 'NO_AUTH_ADMIN_USER_DIFFER' => 'You are not able to re-authenticate as a different user.', - 'NO_AUTH_OPERATION' => 'You do not have the neccessary permissions to complete this operation.', + 'NO_AUTH_OPERATION' => 'You do not have the necessary permissions to complete this operation.', 'NO_CONNECT_TO_SMTP_HOST' => 'Could not connect to smtp host : %s : %s', 'NO_BIRTHDAYS' => 'No birthdays today', 'NO_EMAIL_MESSAGE' => 'Email message was blank', 'NO_EMAIL_RESPONSE_CODE' => 'Could not get mail server response codes', 'NO_EMAIL_SUBJECT' => 'No email subject specified', - 'NO_FORUM' => 'The forum you selected does not exist', + 'NO_FORUM' => 'The forum you selected does not exist.', 'NO_FORUMS' => 'This board has no forums', 'NO_GROUP' => 'The requested usergroup does not exist.', 'NO_GROUP_MEMBERS' => 'This group currently has no members', 'NO_IPS_DEFINED' => 'No IPs or Hostnames defined', 'NO_MEMBERS' => 'No members found for this search criteria', 'NO_MESSAGES' => 'No messages', + 'NO_MODE' => 'No mode specified.', 'NO_MODERATORS' => 'No moderators assigned at this board.', 'NO_NEW_MESSAGES' => 'No new messages', 'NO_NEW_PM' => '<strong>0</strong> new messages', 'NO_NEW_POSTS' => 'No new posts', 'NO_ONLINE_USERS' => 'No registered users', 'NO_POSTS' => 'No posts', - 'NO_SUCH_SEARCH_MODULE' => 'The specified search backend doesn\'t exist', + 'NO_POSTS_TIME_FRAME' => 'No posts exist inside this topic for the selected time frame.', + 'NO_SUCH_SEARCH_MODULE' => 'The specified search backend doesn’t exist', 'NO_SUPPORTED_AUTH_METHODS' => 'No supported authentication methods', 'NO_TOPIC' => 'The requested topic does not exist.', 'NO_TOPICS' => 'There are no topics or posts in this forum.', + 'NO_TOPICS_TIME_FRAME' => 'No topics exist inside this forum for the selected time frame.', 'NO_UNREAD_PM' => '<strong>0</strong> unread messages', + 'NO_UPLOAD_FORM_FOUND' => 'Upload initiated but no valid file upload form found.', 'NO_USER' => 'The requested user does not exist.', - 'NO_USERS' => 'The requested users do not exist', + 'NO_USERS' => 'The requested users do not exist.', 'NO_USER_SPECIFIED' => 'No username was specified', 'OCCUPATION' => 'Occupation', @@ -342,36 +360,37 @@ $lang = array_merge($lang, array( 'ONLINE_USER_TOTAL' => 'In total there is <strong>%d</strong> user online :: ', 'OPTIONS' => 'Options', - 'PAGE_OF' => 'Page <strong>%1$d</strong> of <strong>%2$d</strong>', - 'PASSWORD' => 'Password', - 'PM' => 'PM', - 'POSTING_MESSAGE' => 'Posting message in %s', - 'POST' => 'Post', - 'POST_ANNOUNCEMENT' => 'Announce', - 'POST_STICKY' => 'Sticky', - 'POSTED' => 'Posted', - 'POSTED_IN_FORUM' => 'in', - 'POSTED_ON_DATE' => 'on', - 'POSTS' => 'Posts', - 'POSTS_UNAPPROVED' => 'At least one post in this topic has not been approved', - 'POST_BY_AUTHOR' => 'by', - 'POST_BY_FOE' => 'This post was made by <strong>%1$s</strong> who is currently on your ignore list. %2$sDisplay this post%3$s.', - 'POST_DAY' => '%.2f posts per day', - 'POST_DETAILS' => 'Post details', - 'POST_NEW_TOPIC' => 'Post new topic', - 'POST_PCT' => '%.2f%% of all posts', - 'POST_PCT_ACTIVE' => '%.2f%% of your posts', - 'POST_REPORTED' => 'Click to view report', - 'POST_SUBJECT' => 'Post subject', - 'POST_TIME' => 'Post time', - 'POST_UNAPPROVED' => 'This post is waiting for approval', - 'PREVIEW' => 'Preview', - 'PREVIOUS' => 'Previous', - 'PRIVACY' => 'Privacy policy', - 'PRIVATE_MESSAGE' => 'Private Message', - 'PRIVATE_MESSAGES' => 'Private Messages', - 'PRIVATE_MESSAGING' => 'Private Messaging', - 'PROFILE' => 'User Control Panel', + 'PAGE_OF' => 'Page <strong>%1$d</strong> of <strong>%2$d</strong>', + 'PASSWORD' => 'Password', + 'PLAY_QUICKTIME_FILE' => 'Play quicktime file', + 'PM' => 'PM', + 'POSTING_MESSAGE' => 'Posting message in %s', + 'POST' => 'Post', + 'POST_ANNOUNCEMENT' => 'Announce', + 'POST_STICKY' => 'Sticky', + 'POSTED' => 'Posted', + 'POSTED_IN_FORUM' => 'in', + 'POSTED_ON_DATE' => 'on', + 'POSTS' => 'Posts', + 'POSTS_UNAPPROVED' => 'At least one post in this topic has not been approved', + 'POST_BY_AUTHOR' => 'by', + 'POST_BY_FOE' => 'This post was made by <strong>%1$s</strong> who is currently on your ignore list. %2$sDisplay this post%3$s.', + 'POST_DAY' => '%.2f posts per day', + 'POST_DETAILS' => 'Post details', + 'POST_NEW_TOPIC' => 'Post new topic', + 'POST_PCT' => '%.2f%% of all posts', + 'POST_PCT_ACTIVE' => '%.2f%% of your posts', + 'POST_REPORTED' => 'Click to view report', + 'POST_SUBJECT' => 'Post subject', + 'POST_TIME' => 'Post time', + 'POST_UNAPPROVED' => 'This post is waiting for approval', + 'PREVIEW' => 'Preview', + 'PREVIOUS' => 'Previous', + 'PRIVACY' => 'Privacy policy', + 'PRIVATE_MESSAGE' => 'Private Message', + 'PRIVATE_MESSAGES' => 'Private Messages', + 'PRIVATE_MESSAGING' => 'Private Messaging', + 'PROFILE' => 'User Control Panel', 'READING_FORUM' => 'Viewing topics in %s', 'READING_GLOBAL_ANNOUNCE' => 'Reading global announcement', @@ -389,7 +408,7 @@ $lang = array_merge($lang, array( 'REG_USER_ONLINE' => 'There is %d registered user and ', 'REG_USER_TOTAL' => '%d registered, ', 'REMOVE' => 'Remove', - 'REMOVE_INSTALL' => 'Please delete, move or rename the install directory.', + 'REMOVE_INSTALL' => 'Please delete, move or rename the install directory before you use your forum. If this directory is still present, only the Administration Control Panel (ACP) will be accessible.', 'REPLIES' => 'Replies', 'REPLY_WITH_QUOTE' => 'Reply with quote', 'REPLYING_GLOBAL_ANNOUNCE' => 'Replying to Global Announcement', @@ -429,8 +448,11 @@ $lang = array_merge($lang, array( 'SEARCHING_FORUMS' => 'Searching forums', 'SEARCH_ACTIVE_TOPICS' => 'View active topics', 'SEARCH_FOR' => 'Search for', + 'SEARCH_FORUM' => 'Search this forum', 'SEARCH_NEW' => 'View new posts', + 'SEARCH_POSTS_BY' => 'Search posts by', 'SEARCH_SELF' => 'View your posts', + 'SEARCH_TOPIC' => 'Search this topic', 'SEARCH_UNANSWERED' => 'View unanswered posts', 'SECONDS' => 'Seconds', 'SELECT' => 'Select', @@ -527,7 +549,7 @@ $lang = array_merge($lang, array( 'TOTAL_USERS_ZERO' => 'Total members <strong>0</strong>', 'TRACKED_PHP_ERROR' => 'Tracked PHP errors: %s', - 'UNABLE_GET_IMAGE_SIZE' => 'Accessing the image was impossible or file isn\'t a valid image.', + 'UNABLE_GET_IMAGE_SIZE' => 'Accessing the image was impossible or file isn’t a valid image.', 'UNABLE_TO_DELIVER_FILE'=> 'Unable to deliver file.', 'UNKNOWN_BROWSER' => 'Unknown browser', 'UNMARK_ALL' => 'Unmark all', @@ -542,6 +564,7 @@ $lang = array_merge($lang, array( 'USERGROUPS' => 'Groups', 'USERNAME' => 'Username', 'USERNAMES' => 'Usernames', + 'USER_AVATAR' => 'User avatar', 'USER_CANNOT_READ' => 'You cannot read posts in this forum', 'USER_POST' => '%d Post', 'USER_POSTS' => '%d Posts', @@ -570,6 +593,7 @@ $lang = array_merge($lang, array( 'VIEW_TOPIC_MOVED' => 'Moved: ', 'VIEW_TOPIC_POLL' => 'Poll: ', 'VIEW_TOPIC_STICKY' => 'Sticky: ', + 'VISIT_WEBSITE' => 'Visit website', 'WARNINGS' => 'Warnings', 'WARN_USER' => 'Warn user', @@ -586,6 +610,7 @@ $lang = array_merge($lang, array( 'YEAR' => 'Year', 'YES' => 'Yes', + 'YIM' => 'YIM', 'YOU_LAST_VISIT' => 'Last visit was: %s', 'YOU_NEW_PM' => 'A new private message is waiting for you in your Inbox', 'YOU_NEW_PMS' => 'New private messages are waiting for you in your Inbox', @@ -593,6 +618,7 @@ $lang = array_merge($lang, array( 'datetime' => array( 'TODAY' => 'Today, ', + 'TOMORROW' => 'Tomorrow, ', 'YESTERDAY' => 'Yesterday, ', 'Sunday' => 'Sunday', @@ -682,45 +708,45 @@ $lang = array_merge($lang, array( ), 'tz_zones' => array( - '-12' => '[UTC - 12, Y] Baker Island Time', - '-11' => '[UTC - 11, X] Niue Time, Samoa Standard Time', - '-10' => '[UTC - 10, W] Hawaii-Aleutian Standard Time, Cook Island Time', - '-9.5' => '[UTC - 9:30, V*] Marquesas Islands Time', - '-9' => '[UTC - 9, V] Alaska Standard Time, Gambier Island Time', - '-8' => '[UTC - 8, U] Pacific Standard Time', - '-7' => '[UTC - 7, T] Mountain Standard Time', - '-6' => '[UTC - 6, S] Central Standard Time', - '-5' => '[UTC - 5, R] Eastern Standard Time', - '-4' => '[UTC - 4, Q] Atlantic Standard Time', - '-3.5' => '[UTC - 3:30, P*] Newfoundland Standard Time', - '-3' => '[UTC - 3, P] Amazon Standard Time, Central Greenland Time', - '-2' => '[UTC - 2, O] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time', - '-1' => '[UTC - 1, N] Azores Standard Time, Cape Verde Time, Eastern Greenland Time', - '0' => '[UTC, Z] Western European Time, Greenwich Mean Time', - '1' => '[UTC + 1, A] Central European Time, West African Time', - '2' => '[UTC + 2, B] Eastern European Time, Central African Time', - '3' => '[UTC + 3, C] Moscow Standard Time, Eastern African Time', - '3.5' => '[UTC + 3:30, C*] Iran Standard Time', - '4' => '[UTC + 4, D] Gulf Standard Time, Samara Standard Time', - '4.5' => '[UTC + 4:30, D*] Afghanistan Time', - '5' => '[UTC + 5, E] Pakistan Standard Time, Yekaterinburg Standard Time', - '5.5' => '[UTC + 5:30, E*] Indian Standard Time, Sri Lanka Time', - '5.75' => '[UTC + 5:45, E‡] Nepal Time', - '6' => '[UTC + 6, F] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time', - '6.5' => '[UTC + 6:30, F*] Cocos Islands Time, Myanmar Time', - '7' => '[UTC + 7, G] Indochina Time, Krasnoyarsk Standard Time', - '8' => '[UTC + 8, H] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time', - '8.75' => '[UTC + 8:45, H‡] Southeastern Western Australia Standard Time', - '9' => '[UTC + 9, I] Japan Standard Time, Korea Standard Time, Chita Standard Time', - '9.5' => '[UTC + 9:30, I*] Australian Central Standard Time', - '10' => '[UTC + 10, K] Australian Eastern Standard Time, Vladivostok Standard Time', - '10.5' => '[UTC + 10:30, K*] Lord Howe Standard Time', - '11' => '[UTC + 11, L] Solomon Island Time, Magadan Standard Time', - '11.5' => '[UTC + 11:30, L*] Norfolk Island Time', - '12' => '[UTC + 12, M] New Zealand Time, Fiji Time, Kamchatka Standard Time', - '12.75' => '[UTC + 12:45, M‡] Chatham Islands Time', - '13' => '[UTC + 13, M*] Tonga Time, Phoenix Islands Time', - '14' => '[UTC + 14, M†] Line Island Time', + '-12' => '[UTC - 12] Baker Island Time', + '-11' => '[UTC - 11] Niue Time, Samoa Standard Time', + '-10' => '[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time', + '-9.5' => '[UTC - 9:30] Marquesas Islands Time', + '-9' => '[UTC - 9] Alaska Standard Time, Gambier Island Time', + '-8' => '[UTC - 8] Pacific Standard Time', + '-7' => '[UTC - 7] Mountain Standard Time', + '-6' => '[UTC - 6] Central Standard Time', + '-5' => '[UTC - 5] Eastern Standard Time', + '-4' => '[UTC - 4] Atlantic Standard Time', + '-3.5' => '[UTC - 3:30] Newfoundland Standard Time', + '-3' => '[UTC - 3] Amazon Standard Time, Central Greenland Time', + '-2' => '[UTC - 2] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time', + '-1' => '[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time', + '0' => '[UTC] Western European Time, Greenwich Mean Time', + '1' => '[UTC + 1] Central European Time, West African Time', + '2' => '[UTC + 2] Eastern European Time, Central African Time', + '3' => '[UTC + 3] Moscow Standard Time, Eastern African Time', + '3.5' => '[UTC + 3:30] Iran Standard Time', + '4' => '[UTC + 4] Gulf Standard Time, Samara Standard Time', + '4.5' => '[UTC + 4:30] Afghanistan Time', + '5' => '[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time', + '5.5' => '[UTC + 5:30] Indian Standard Time, Sri Lanka Time', + '5.75' => '[UTC + 5:45] Nepal Time', + '6' => '[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time', + '6.5' => '[UTC + 6:30] Cocos Islands Time, Myanmar Time', + '7' => '[UTC + 7] Indochina Time, Krasnoyarsk Standard Time', + '8' => '[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time', + '8.75' => '[UTC + 8:45] Southeastern Western Australia Standard Time', + '9' => '[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time', + '9.5' => '[UTC + 9:30] Australian Central Standard Time', + '10' => '[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time', + '10.5' => '[UTC + 10:30] Lord Howe Standard Time', + '11' => '[UTC + 11] Solomon Island Time, Magadan Standard Time', + '11.5' => '[UTC + 11:30] Norfolk Island Time', + '12' => '[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time', + '12.75' => '[UTC + 12:45] Chatham Islands Time', + '13' => '[UTC + 13] Tonga Time, Phoenix Islands Time', + '14' => '[UTC + 14] Line Island Time', ), // The value is only an example and will get replaced by the current time on view diff --git a/phpBB/language/en/email/admin_activate.txt b/phpBB/language/en/email/admin_activate.txt index ea0af53880..a168ff533c 100644 --- a/phpBB/language/en/email/admin_activate.txt +++ b/phpBB/language/en/email/admin_activate.txt @@ -1,5 +1,4 @@ -Subject: New user account -Charset: iso-8859-1 +Subject: Activate user account Hello, diff --git a/phpBB/language/en/email/admin_send_email.txt b/phpBB/language/en/email/admin_send_email.txt index 5fd5592f7c..b778496258 100644 --- a/phpBB/language/en/email/admin_send_email.txt +++ b/phpBB/language/en/email/admin_send_email.txt @@ -1,4 +1,3 @@ -Charset: iso-8859-1 The following is an email sent to you by an administrator of "{SITENAME}". If this message is spam, contains abusive or other comments you find offensive please contact the webmaster of the board at the following address: diff --git a/phpBB/language/en/email/admin_welcome_activated.txt b/phpBB/language/en/email/admin_welcome_activated.txt index 3b7aa48362..0e4658b969 100644 --- a/phpBB/language/en/email/admin_welcome_activated.txt +++ b/phpBB/language/en/email/admin_welcome_activated.txt @@ -1,5 +1,4 @@ -Subject: Account Activated -Charset: iso-8859-1 +Subject: Account activated Hello {USERNAME}, diff --git a/phpBB/language/en/email/admin_welcome_inactive.txt b/phpBB/language/en/email/admin_welcome_inactive.txt index 905e71696b..8a06683586 100644 --- a/phpBB/language/en/email/admin_welcome_inactive.txt +++ b/phpBB/language/en/email/admin_welcome_inactive.txt @@ -1,5 +1,4 @@ -Subject: Welcome to {SITENAME} Forums -Charset: iso-8859-1 +Subject: Welcome to {SITENAME} ({U_BOARD}) {WELCOME_MSG} diff --git a/phpBB/language/en/email/coppa_resend_inactive.txt b/phpBB/language/en/email/coppa_resend_inactive.txt index d65367e31b..b3d745ffbb 100644 --- a/phpBB/language/en/email/coppa_resend_inactive.txt +++ b/phpBB/language/en/email/coppa_resend_inactive.txt @@ -1,5 +1,4 @@ -Subject: Welcome to {SITENAME} Forums -Charset: iso-8859-1 +Subject: Welcome to {SITENAME} ({U_BOARD}) {WELCOME_MSG} @@ -14,7 +13,7 @@ OR mail it to: {MAIL_INFO} ------------------------------ CUT HERE ------------------------------ -Permission to Participate at {SITENAME} +Permission to participate at {SITENAME} Username: {USERNAME} Email: {EMAIL_ADDRESS} @@ -24,7 +23,7 @@ I UNDERSTAND THIS INFORMATION CAN BE CHANGED AT ANY TIME BY ENTERING A PASSWORD. I UNDERSTAND THAT I MAY REQUEST FOR THIS INFORMATION TO BE REMOVED FROM {SITENAME} AT ANY TIME. -Parent or Guardian +Parent or guardian (print your name here): _____________________ (sign here): __________________ diff --git a/phpBB/language/en/email/coppa_welcome_inactive.txt b/phpBB/language/en/email/coppa_welcome_inactive.txt index 4aac4ce5bd..3acc7e2007 100644 --- a/phpBB/language/en/email/coppa_welcome_inactive.txt +++ b/phpBB/language/en/email/coppa_welcome_inactive.txt @@ -1,5 +1,4 @@ -Subject: Welcome to {SITENAME} Forums -Charset: iso-8859-1 +Subject: Welcome to {SITENAME} ({U_BOARD}) {WELCOME_MSG} @@ -14,7 +13,7 @@ OR mail it to: {MAIL_INFO} ------------------------------ CUT HERE ------------------------------ -Permission to Participate at {SITENAME} +Permission to participate at {SITENAME} Username: {USERNAME} Password: {PASSWORD} @@ -25,7 +24,7 @@ I UNDERSTAND THIS INFORMATION CAN BE CHANGED AT ANY TIME BY ENTERING A PASSWORD. I UNDERSTAND THAT I MAY REQUEST FOR THIS INFORMATION TO BE REMOVED FROM {SITENAME} AT ANY TIME. -Parent or Guardian +Parent or guardian (print your name here): _____________________ (sign here): __________________ diff --git a/phpBB/language/en/email/email_notify.txt b/phpBB/language/en/email/email_notify.txt index 0543165627..4f65f17566 100644 --- a/phpBB/language/en/email/email_notify.txt +++ b/phpBB/language/en/email/email_notify.txt @@ -1,5 +1,4 @@ Subject: {SITENAME} - Email a friend -Charset: iso-8859-1 Hello {TO_USERNAME}, diff --git a/phpBB/language/en/email/forum_notify.txt b/phpBB/language/en/email/forum_notify.txt index af9e9e3bab..3252e3ae32 100644 --- a/phpBB/language/en/email/forum_notify.txt +++ b/phpBB/language/en/email/forum_notify.txt @@ -1,13 +1,12 @@ -Subject: Forum Post Notification - {FORUM_NAME} -Charset: iso-8859-1 +Subject: Forum post notification - {FORUM_NAME} Hello {USERNAME}, -You are receiving this email because you are watching the forum, "{FORUM_NAME}" at {SITENAME}. This forum has received a new reply to the topic "{TOPIC_TITLE}" since your last visit. You can use the following link to view this topic, no more notifications will be sent until you visit the topic. +You are receiving this notification because you are watching the forum, "{FORUM_NAME}" at {SITENAME}. This forum has received a new reply to the topic "{TOPIC_TITLE}" since your last visit. You can use the following link to view this topic, no more notifications will be sent until you visit the topic. {U_NEWEST_POST} -If you no longer wish to watch this forum you can either click the "Unsubscribe forum link" found in the forum above, or by clicking the following link: +If you no longer wish to watch this forum you can either click the "Unsubscribe forum" link found in the forum above, or by clicking the following link: {U_STOP_WATCHING_FORUM} diff --git a/phpBB/language/en/email/group_added.txt b/phpBB/language/en/email/group_added.txt index 4f07fdb9cd..e2a6d22ec0 100644 --- a/phpBB/language/en/email/group_added.txt +++ b/phpBB/language/en/email/group_added.txt @@ -1,5 +1,4 @@ Subject: You have been added to this usergroup -Charset: iso-8859-1 Congratulations, diff --git a/phpBB/language/en/email/group_approved.txt b/phpBB/language/en/email/group_approved.txt index b2134f86f9..bc31d88b3e 100644 --- a/phpBB/language/en/email/group_approved.txt +++ b/phpBB/language/en/email/group_approved.txt @@ -1,5 +1,4 @@ Subject: Your request has been approved -Charset: iso-8859-1 Congratulations, diff --git a/phpBB/language/en/email/group_request.txt b/phpBB/language/en/email/group_request.txt index 7b51823067..5b6bbcb33f 100644 --- a/phpBB/language/en/email/group_request.txt +++ b/phpBB/language/en/email/group_request.txt @@ -1,5 +1,4 @@ Subject: A request to join your group has been made -Charset: iso-8859-1 Dear {USERNAME}, diff --git a/phpBB/language/en/email/installed.txt b/phpBB/language/en/email/installed.txt index b69e9189ae..61cd345774 100644 --- a/phpBB/language/en/email/installed.txt +++ b/phpBB/language/en/email/installed.txt @@ -1,5 +1,4 @@ -Subject: phpBB Installed -Charset: iso-8859-1 +Subject: phpBB installed Congratulations, @@ -14,8 +13,8 @@ Password: {PASSWORD} Board URL: {U_BOARD} ---------------------------- -Useful information on your phpBB installation can be found in the docs folder of your installation and on our website - http://www.phpbb.com/support/ +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/ -We recommend that in order to stay current with software releases you subscribe to our mailing list, located at the above URL. +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. {EMAIL_SIG}
\ No newline at end of file diff --git a/phpBB/language/en/email/newtopic_notify.txt b/phpBB/language/en/email/newtopic_notify.txt index 93c62fe9e2..0c64b7a40e 100644 --- a/phpBB/language/en/email/newtopic_notify.txt +++ b/phpBB/language/en/email/newtopic_notify.txt @@ -1,13 +1,12 @@ -Subject: New Topic Notification - {FORUM_NAME} -Charset: iso-8859-1 +Subject: New topic notification - {FORUM_NAME} Hello {USERNAME}, -You are receiving this email because you are watching the forum, "{FORUM_NAME}" at {SITENAME}. This forum has received a new topic since your last visit, "{TOPIC_TITLE}". You can use the following link to view forum, no more notifications will be sent until you visit the forum. +You are receiving this notification because you are watching the forum, "{FORUM_NAME}" at {SITENAME}. This forum has received a new topic since your last visit, "{TOPIC_TITLE}". You can use the following link to view forum, no more notifications will be sent until you visit the forum. {U_FORUM} -If you no longer wish to watch this forum you can either click the "Unsubscribe forum link" found in the forum above, or by clicking the following link: +If you no longer wish to watch this forum you can either click the "Unsubscribe forum" link found in the forum above, or by clicking the following link: {U_STOP_WATCHING_FORUM} diff --git a/phpBB/language/en/email/post_approved.txt b/phpBB/language/en/email/post_approved.txt index 3d7c4902c5..3c8ef03a3e 100644 --- a/phpBB/language/en/email/post_approved.txt +++ b/phpBB/language/en/email/post_approved.txt @@ -1,11 +1,10 @@ -Subject: Post Approved - {POST_SUBJECT} -Charset: iso-8859-1 +Subject: Post approved - {POST_SUBJECT} Hello {USERNAME}, -You are receiving this email because your post "{POST_SUBJECT}" at {SITENAME} was approved by a moderator or admin. +You are receiving this notification because your post "{POST_SUBJECT}" at {SITENAME} was approved by a moderator or administrator. -If you want to view the post click the following link: +If you want to view the post, click the following link: {U_VIEW_POST} If you want to view the topic, click the following link: diff --git a/phpBB/language/en/email/post_disapproved.txt b/phpBB/language/en/email/post_disapproved.txt index c6055cb28e..f9adc3e546 100644 --- a/phpBB/language/en/email/post_disapproved.txt +++ b/phpBB/language/en/email/post_disapproved.txt @@ -1,9 +1,8 @@ -Subject: Post Disapproved - {POST_SUBJECT} -Charset: iso-8859-1 +Subject: Post disapproved - {POST_SUBJECT} Hello {USERNAME}, -You are receiving this email because your post "{POST_SUBJECT}" at {SITENAME} was disapproved by a moderator or admin. +You are receiving this notification because your post "{POST_SUBJECT}" at {SITENAME} was disapproved by a moderator or administrator. The following reason was given for the disapproval: diff --git a/phpBB/language/en/email/privmsg_notify.txt b/phpBB/language/en/email/privmsg_notify.txt index 7dae75ecc9..d363df7973 100644 --- a/phpBB/language/en/email/privmsg_notify.txt +++ b/phpBB/language/en/email/privmsg_notify.txt @@ -1,5 +1,4 @@ -Subject: New Private Message has arrived -Charset: iso-8859-1 +Subject: New private message has arrived Hello {USERNAME}, diff --git a/phpBB/language/en/email/profile_send_email.txt b/phpBB/language/en/email/profile_send_email.txt index 00dcde1e46..5dd8fd0e9c 100644 --- a/phpBB/language/en/email/profile_send_email.txt +++ b/phpBB/language/en/email/profile_send_email.txt @@ -1,4 +1,3 @@ -Charset: iso-8859-1 Hello {TO_USERNAME}, diff --git a/phpBB/language/en/email/profile_send_im.txt b/phpBB/language/en/email/profile_send_im.txt index 5220bdd906..d2fea692a0 100644 --- a/phpBB/language/en/email/profile_send_im.txt +++ b/phpBB/language/en/email/profile_send_im.txt @@ -1,4 +1,3 @@ -Charset: iso-8859-1 Hello {TO_USERNAME}, diff --git a/phpBB/language/en/email/report_closed.txt b/phpBB/language/en/email/report_closed.txt index 7da2026fb3..f7c63527da 100644 --- a/phpBB/language/en/email/report_closed.txt +++ b/phpBB/language/en/email/report_closed.txt @@ -1,9 +1,8 @@ -Subject: Report Closed - {POST_SUBJECT} -Charset: iso-8859-1 +Subject: Report closed - {POST_SUBJECT} Hello {USERNAME}, -You are receiving this email because the report you filed on the post "{POST_SUBJECT}" in "{TOPIC_TITLE}" at {SITENAME} was handled by a moderator or by an admin. The report was afterwards closed. If you have further questions contact {CLOSER_NAME} with a personal message. +You are receiving this notification because the report you filed on the post "{POST_SUBJECT}" in "{TOPIC_TITLE}" at {SITENAME} was handled by a moderator or by an administrator. The report was afterwards closed. If you have further questions contact {CLOSER_NAME} with a personal message. {EMAIL_SIG}
\ No newline at end of file diff --git a/phpBB/language/en/email/report_deleted.txt b/phpBB/language/en/email/report_deleted.txt index 9fed2a590f..f8e32c88ab 100644 --- a/phpBB/language/en/email/report_deleted.txt +++ b/phpBB/language/en/email/report_deleted.txt @@ -1,9 +1,8 @@ -Subject: Report Closed - {POST_SUBJECT} -Charset: iso-8859-1 +Subject: Report deleted - {POST_SUBJECT} Hello {USERNAME}, -You are receiving this email because the report you filed on the post "{POST_SUBJECT}" in "{TOPIC_TITLE}" at {SITENAME} was deleted by a moderator or by an admin. +You are receiving this notification because the report you filed on the post "{POST_SUBJECT}" in "{TOPIC_TITLE}" at {SITENAME} was deleted by a moderator or by an administrator. {EMAIL_SIG}
\ No newline at end of file diff --git a/phpBB/language/en/email/topic_approved.txt b/phpBB/language/en/email/topic_approved.txt index 28927b5a29..3b9bd34b0e 100644 --- a/phpBB/language/en/email/topic_approved.txt +++ b/phpBB/language/en/email/topic_approved.txt @@ -1,9 +1,8 @@ -Subject: Topic Approved - {TOPIC_TITLE} -Charset: iso-8859-1 +Subject: Topic approved - {TOPIC_TITLE} Hello {USERNAME}, -You are receiving this email because your topic "{TOPIC_TITLE}" at {SITENAME} was approved by a moderator or admin. +You are receiving this notification because your topic "{TOPIC_TITLE}" at {SITENAME} was approved by a moderator or administrator. If you want to view the topic, click the following link: {U_VIEW_TOPIC} diff --git a/phpBB/language/en/email/topic_disapproved.txt b/phpBB/language/en/email/topic_disapproved.txt index 52c1578861..fe417a0a1b 100644 --- a/phpBB/language/en/email/topic_disapproved.txt +++ b/phpBB/language/en/email/topic_disapproved.txt @@ -1,9 +1,8 @@ -Subject: Topic Disapproved - {TOPIC_TITLE} -Charset: iso-8859-1 +Subject: Topic disapproved - {TOPIC_TITLE} Hello {USERNAME}, -You are receiving this email because your topic "{TOPIC_TITLE}" at {SITENAME} was disapproved by a moderator or admin. +You are receiving this notification because your topic "{TOPIC_TITLE}" at {SITENAME} was disapproved by a moderator or administrator. The following reason was given for the disapproval: diff --git a/phpBB/language/en/email/topic_notify.txt b/phpBB/language/en/email/topic_notify.txt index 274fe0995a..fcfb9c63af 100644 --- a/phpBB/language/en/email/topic_notify.txt +++ b/phpBB/language/en/email/topic_notify.txt @@ -1,9 +1,8 @@ -Subject: Topic Reply Notification - {TOPIC_TITLE} -Charset: iso-8859-1 +Subject: Topic reply notification - {TOPIC_TITLE} Hello {USERNAME}, -You are receiving this email because you are watching the topic, "{TOPIC_TITLE}" at {SITENAME}. This topic has received a reply since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic. +You are receiving this notification because you are watching the topic, "{TOPIC_TITLE}" at {SITENAME}. This topic has received a reply since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic. If you want to view the newest post made since your last visit, click the following link: {U_NEWEST_POST} @@ -11,7 +10,7 @@ If you want to view the newest post made since your last visit, click the follow If you want to view the topic, click the following link: {U_TOPIC} -If you no longer wish to watch this topic you can either click the "Stop watching this topic link" found at the bottom of the topic above, or by clicking the following link: +If you no longer wish to watch this topic you can either click the "Stop watching this topic" link found at the bottom of the topic above, or by clicking the following link: {U_STOP_WATCHING_TOPIC} diff --git a/phpBB/language/en/email/user_activate.txt b/phpBB/language/en/email/user_activate.txt index 0adeb5bff2..7d7960c4c5 100644 --- a/phpBB/language/en/email/user_activate.txt +++ b/phpBB/language/en/email/user_activate.txt @@ -1,5 +1,4 @@ Subject: Reactivate your account -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/user_activate_inactive.txt b/phpBB/language/en/email/user_activate_inactive.txt index 439437940f..cbef5c780c 100644 --- a/phpBB/language/en/email/user_activate_inactive.txt +++ b/phpBB/language/en/email/user_activate_inactive.txt @@ -1,5 +1,4 @@ Subject: Your account has been deactivated -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/user_activate_passwd.txt b/phpBB/language/en/email/user_activate_passwd.txt index 0c2adc82ec..76a7f88930 100644 --- a/phpBB/language/en/email/user_activate_passwd.txt +++ b/phpBB/language/en/email/user_activate_passwd.txt @@ -1,9 +1,8 @@ Subject: New password activation -Charset: iso-8859-1 Hello {USERNAME} -You are receiving this email because you have (or someone pretending to be you has) requested a new password be sent for your account on {SITENAME}. If you did not request this email then please ignore it, if you keep receiving it please contact the board administrator. +You are receiving this notification because you have (or someone pretending to be you has) requested a new password be sent for your account on {SITENAME}. If you did not request this email then please ignore it, if you keep receiving it please contact the board administrator. To use the new password you need to activate it. To do this click the link provided below. diff --git a/phpBB/language/en/email/user_remind_inactive.txt b/phpBB/language/en/email/user_remind_inactive.txt index be0cf3e76b..806f9f3a63 100644 --- a/phpBB/language/en/email/user_remind_inactive.txt +++ b/phpBB/language/en/email/user_remind_inactive.txt @@ -1,5 +1,4 @@ Subject: Inactive account reminder -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/user_resend_inactive.txt b/phpBB/language/en/email/user_resend_inactive.txt index bc4dd02d2d..3a35c53dd4 100644 --- a/phpBB/language/en/email/user_resend_inactive.txt +++ b/phpBB/language/en/email/user_resend_inactive.txt @@ -1,5 +1,4 @@ -Subject: Welcome to {SITENAME} Forums -Charset: iso-8859-1 +Subject: Welcome to {SITENAME} ({U_BOARD}) {WELCOME_MSG} diff --git a/phpBB/language/en/email/user_welcome.txt b/phpBB/language/en/email/user_welcome.txt index 42dc56df3b..6a911d90a2 100644 --- a/phpBB/language/en/email/user_welcome.txt +++ b/phpBB/language/en/email/user_welcome.txt @@ -1,5 +1,4 @@ -Subject: Welcome to {SITENAME} Forums -Charset: iso-8859-1 +Subject: Welcome to {SITENAME} ({U_BOARD}) {WELCOME_MSG} diff --git a/phpBB/language/en/email/user_welcome_inactive.txt b/phpBB/language/en/email/user_welcome_inactive.txt index 6ece2d4faf..4575c7e7bb 100644 --- a/phpBB/language/en/email/user_welcome_inactive.txt +++ b/phpBB/language/en/email/user_welcome_inactive.txt @@ -1,5 +1,4 @@ -Subject: Welcome to {SITENAME} Forums -Charset: iso-8859-1 +Subject: Welcome to {SITENAME} ({U_BOARD}) {WELCOME_MSG} diff --git a/phpBB/language/en/groups.php b/phpBB/language/en/groups.php index 07b566f3fe..a936058162 100644 --- a/phpBB/language/en/groups.php +++ b/phpBB/language/en/groups.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -35,23 +37,23 @@ $lang = array_merge($lang, array( 'CHANGED_DEFAULT_GROUP' => 'Successfully changed default group', 'GROUP_AVATAR' => 'Group avatar', - 'GROUP_CHANGE_DEFAULT' => 'Are you sure you want to change your default membership to the group "%s"?', + 'GROUP_CHANGE_DEFAULT' => 'Are you sure you want to change your default membership to the group “%sâ€?', 'GROUP_CLOSED' => 'Closed', 'GROUP_DESC' => 'Group description', 'GROUP_HIDDEN' => 'Hidden', - 'GROUP_INFORMATION' => 'Usergroup Information', + 'GROUP_INFORMATION' => 'Usergroup information', 'GROUP_IS_CLOSED' => 'This is a closed group, new members cannot automatically join.', 'GROUP_IS_FREE' => 'This is a freely open group, all new members are welcome.', 'GROUP_IS_HIDDEN' => 'This is a hidden group, only members of this group can view its membership.', 'GROUP_IS_OPEN' => 'This is an open group, members can apply to join.', 'GROUP_IS_SPECIAL' => 'This is a special group, special groups are managed by the board administrators.', - 'GROUP_JOIN' => 'Join Group', + 'GROUP_JOIN' => 'Join group', 'GROUP_JOIN_CONFIRM' => 'Are you sure you want to join the selected group?', 'GROUP_JOIN_PENDING' => 'Request to join group', 'GROUP_JOIN_PENDING_CONFIRM' => 'Are you sure you want to request joining the selected group?', 'GROUP_JOINED' => 'Successfully joined selected group', 'GROUP_JOINED_PENDING' => 'Successfully requested group membership. Please wait for a group leader to approve your membership.', - 'GROUP_LIST' => 'Manage Users', + 'GROUP_LIST' => 'Manage users', 'GROUP_MEMBERS' => 'Group members', 'GROUP_NAME' => 'Group name', 'GROUP_OPEN' => 'Open', @@ -64,6 +66,7 @@ $lang = array_merge($lang, array( 'GROUP_RESIGNED_PENDING' => 'Your pending membership was successfully removed from the selected group', 'GROUP_TYPE' => 'Group type', 'GROUP_UNDISCLOSED' => 'Hidden group', + 'FORUM_UNDISCLOSED' => 'Moderating hidden forum(s)', 'LOGIN_EXPLAIN_GROUP' => 'You need to login to view group details', @@ -76,7 +79,7 @@ $lang = array_merge($lang, array( 'REMOVE_SELECTED' => 'Remove selected', - 'USER_GROUP_CHANGE' => 'From "%1$s" group to "%2$s"', + 'USER_GROUP_CHANGE' => 'From “%1$s†group to “%2$sâ€', 'USER_GROUP_DEMOTE' => 'Demote leadership', 'USER_GROUP_DEMOTE_CONFIRM' => 'Are you sure you want to demote as group leader from the selected group?', 'USER_GROUP_DEMOTED' => 'Successfully demoted your leadership.', diff --git a/phpBB/language/en/help_bbcode.php b/phpBB/language/en/help_bbcode.php index a2c1600193..ada28713e0 100644 --- a/phpBB/language/en/help_bbcode.php +++ b/phpBB/language/en/help_bbcode.php @@ -13,7 +13,9 @@ /** */ -// DEVELOPERS PLEASE NOTE +// 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 @@ -46,7 +48,7 @@ $help = array( ), array( 0 => 'Can I combine formatting tags?', - 1 => 'Yes, of course you can, for example to get someones attention you may write:<br /><br /><strong>[size=18][color=red][b]</strong>LOOK AT ME!<strong>[/b][/color][/size]</strong><br /><br />this would output <span style="color:red;font-size:18px;"><strong>LOOK AT ME!</strong></span><br /><br />We don\'t recommend you output lots of text that looks like this though! Remember it is up to you, the poster to ensure tags are closed correctly. For example the following is incorrect:<br /><br /><strong>[b][u]</strong>This is wrong<strong>[/b][/u]</strong>' + 1 => 'Yes, of course you can, for example to get someones attention you may write:<br /><br /><strong>[size=18][color=red][b]</strong>LOOK AT ME!<strong>[/b][/color][/size]</strong><br /><br />this would output <span style="color:red;font-size:18px;"><strong>LOOK AT ME!</strong></span><br /><br />We don’t recommend you output lots of text that looks like this though! Remember it is up to you, the poster to ensure tags are closed correctly. For example the following is incorrect:<br /><br /><strong>[b][u]</strong>This is wrong<strong>[/b][/u]</strong>' ), array( 0 => '--', @@ -86,7 +88,7 @@ $help = array( ), array( 0 => 'Adding an image to a post', - 1 => 'phpBB BBCode incorporates a tag for including images in your posts. Two very important things to remember when using this tag are; many users do not appreciate lots of images being shown in posts and secondly the image you display must already be available on the internet (it cannot exist only on your computer for example, unless you run a webserver!). There is currently no way of storing images locally with phpBB (all these issues are expected to be addressed in the next release of phpBB). To display an image you must surround the URL pointing to the image with <strong>[img][/img]</strong> tags. For example:<br /><br /><strong>[img]</strong>http://www.phpbb.com/images/phplogo.gif<strong>[/img]</strong><br /><br />As noted in the URL section above you can wrap an image in a <strong>[url][/url]</strong> tag if you wish, eg.<br /><br /><strong>[url=http://www.phpbb.com/][img]</strong>http://www.phpbb.com/images/phplogo.gif<strong>[/img][/url]</strong><br /><br />would generate:<br /><br /><a href="http://www.phpbb.com/" target="_blank"><img src="http://www.phpbb.com/images/phplogo.gif" border="0" alt="" /></a><br />' + 1 => 'phpBB BBCode incorporates a tag for including images in your posts. Two very important things to remember when using this tag are; many users do not appreciate lots of images being shown in posts and secondly the image you display must already be available on the internet (it cannot exist only on your computer for example, unless you run a webserver!). There is currently no way of storing images locally with phpBB (all these issues are expected to be addressed in the next release of phpBB). To display an image you must surround the URL pointing to the image with <strong>[img][/img]</strong> tags. For example:<br /><br /><strong>[img]</strong>http://www.phpbb.com/images/phplogo.gif<strong>[/img]</strong><br /><br />As noted in the URL section above you can wrap an image in a <strong>[url][/url]</strong> tag if you wish, eg.<br /><br /><strong>[url=http://www.phpbb.com/][img]</strong>http://www.phpbb.com/images/phplogo.gif<strong>[/img][/url]</strong><br /><br />would generate:<br /><br /><a href="http://www.phpbb.com/" target="_blank"><img src="http://www.phpbb.com/images/phplogo.gif" alt="" /></a><br />' ), array( 0 => '--', diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php index 31d9a8f5fd..a9dba1a1d6 100644 --- a/phpBB/language/en/help_faq.php +++ b/phpBB/language/en/help_faq.php @@ -13,7 +13,9 @@ /** */ -// DEVELOPERS PLEASE NOTE +// 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 @@ -29,44 +31,56 @@ $help = array( 1 => 'Login and Registration Issues' ), array( - 0 => 'Why can\'t I login?', - 1 => 'Have you registered? Seriously, you must register in order to login. Have you been banned from the board (a message will be displayed if you have)? If so then you should contact the webmaster or board administrator to find out why. If you have registered and are not banned and you still cannot login then check and double check your username and password. Usually this is the problem, if not then contact the board administrator they may have incorrect configuration settings for the board.' + 0 => 'Why can’t I login?', + 1 => 'There are several reasons why this could occur. First, ensure your username and password are correct. If they are, contact the board owner to make sure you haven’t been banned. It is also possible the website owner has a configuration error on their end, and they would need to fix it.' ), array( 0 => 'Why do I need to register at all?', - 1 => 'You may not have too, it is up to the administrator of the board as to whether you need to register in order to post messages. However registration will give you access to additional features not available to guest users such as definable avatar images, private messaging, emailing of fellow users, usergroup subscription, etc. It only takes a few moments to register so it is recommended you do so.' + 1 => 'You may not have to, it is up to the administrator of the board as to whether you need to register in order to post messages. However; registration will give you access to additional features not available to guest users such as definable avatar images, private messaging, emailing of fellow users, usergroup subscription, etc. It only takes a few moments to register so it is recommended you do so.' ), array( 0 => 'Why do I get logged off automatically?', - 1 => 'If you do not check the <i>Log me in automatically</i> box when you login the board will only keep you logged in for a preset time. This prevents misuse of your account by anyone else. To stay logged in check the box during login, this is not recommended if you access the board from a shared computer, e.g. library, internet cafe, university cluster, etc.' + 1 => 'If you do not check the <em>Log me in automatically</em> box when you login the board will only keep you logged in for a preset time. This prevents misuse of your account by anyone else. To stay logged in check the box during login, this is not recommended if you access the board from a shared computer, e.g. library, internet cafe, university computer lab, etc. If you do not see this check box, it means your administrator has disabled this feature.' ), array( 0 => 'How do I prevent my username appearing in the online user listings?', - 1 => 'In your profile you will find an option <i>Hide your online status</i>, if you switch this <i>on</i> you\'ll only appear to board administrators or to yourself. You will be counted as a hidden user.' + 1 => 'In your profile you will find an option <em>Hide your online status</em>, if you switch this <em>on</em> you’ll only appear to board administrators, moderators, or to yourself. You will be counted as a hidden user.' ), array( - 0 => 'I\'ve lost my password!', - 1 => 'Don\'t panic! While your password cannot be retrieved it can be reset. To do this go to the login page and click <u>I\'ve forgotten my password</u>, follow the instructions and you should be back online in no time' + 0 => 'I’ve lost my password!', + 1 => 'Don’t panic! While your password cannot be retrieved, it can be reset. To do this go to the login page and click <em>I’ve forgotten my password</em>, follow the instructions and you should be able to log in again in no time.' ), array( 0 => 'I registered but cannot login!', - 1 => 'Firstly check your are entering the correct username and password. If they are okay then one of two things may have happened. If COPPA support is enabled and you clicked the <u>I am under 13 years old</u> link while registering then you will have to follow the instructions you received. If this is not the case then does your account need activating? Some boards will require all new registrations be activated, either by yourself or by the administrator before you can logon. When you registered it would have told you whether activation was required. If you were sent an email then follow the instructions, if you did not receive the email then are you sure your email address is valid? One reason activation is used is to reduce the possibility of <i>rouge</i> users abusing the board anonymously. If you are sure the email address you used is valid then try contacting the board administrator.' + 1 => 'Firstly check your are entering the correct username and password. If they are okay then one of two things may have happened. If COPPA support is enabled and you clicked the <em>I am under 13 years old</em> link while registering then you will have to follow the instructions you received. If this is not the case then does your account need activating? Some boards will require all new registrations be activated, either by yourself or by the administrator before you can logon. When you registered it would have told you whether activation was required. If you were sent an email then follow the instructions, if you did not receive the email then are you sure your email address is valid? One reason activation is used is to reduce the possibility of <em>rogue</em> users abusing the board anonymously. If you are sure the email address you used is valid then try contacting the board administrator.' ), array( 0 => 'I registered in the past but cannot login any more?!', 1 => 'The most likely reasons for this are; you entered an incorrect username or password (check the email you were sent when you first registered) or the administrator has deleted your account for some reason. If it is the later case then perhaps you did not post anything? It is usual for boards to periodically remove users who have not posted anything so as to reduce the size of the database. Try registering again and get involved in discussions.' ), array( + 0 => 'What is COPPA?', + 1 => 'COPPA, or Child Online Privacy and Protection Act of 1998 is a law in the United States that requires website that can potentially collect information from minors under the age of 13 to have written parental consent, or some other method of the legal guardians acknowledging they are allowing the collection of personally identifiable information from a minor under the age of 13. If you are unsure if this applies to you as someone trying to register, or to the website you are trying to register on, contact legal counsel for assistance. Please note that the phpBB Team cannot provide legal advice and are not the point of contact for legal concerns of any kind, except as outlined below.', + ), + array( + 0 => 'Why can’t I register?', + 1 => 'It is possible the website owner has banned your IP address or disallowed the username you are attempting to register. The website owner could have also disabled registration to prevent new visitors from signing up. Contact the board administrator for assistance.', + ), + array( + 0 => 'What does the “Delete all board cookies†do?', + 1 => 'Delete all board cookies deletes the cookies created by phpBB3 which keeps you authenticated and logged into the board, and also provides functions such as read tracking if set by the board owner.', + ), + array( 0 => '--', 1 => 'User Preferences and settings' ), array( 0 => 'How do I change my settings?', - 1 => 'All your settings (if you are registered) are stored in the database. To alter them click the <u>Profile</u> link (generally shown at the top of pages but this may not be the case). This will allow you to change all your settings' + 1 => 'All your settings (if you are registered) are stored in the database. To alter them click the <em>UCP</em> link (generally shown at the top of pages but this may not be the case). This will allow you to change all your settings and preferences.' ), array( 0 => 'The times are not correct!', - 1 => 'The times are almost certainly correct, however what you may be seeing are times displayed in a timezone different from the one you are in. If this is the case you should change your profile setting for the timezone to match your particular area, e.g. London, Paris, New York, Sydney, etc. Please note that changing the timezone, like most settings can only be done by registered users. So if you are not registered this is a good time to do so, if you pardon the pun!' + 1 => 'Though there are rare occurrences of the website’s server having the wrong time, the times are probably correct. However; what you may be seeing are times displayed in a timezone different from the one you are in. If this is the case you should change your profile setting for the timezone to match your particular area, e.g. London, Paris, New York, Sydney, etc. Please note that changing the timezone, like most settings can only be done by registered users. So if you are not registered this is a good time to do so, if you pardon the pun!' ), array( 0 => 'I changed the timezone and the time is still wrong!', @@ -74,11 +88,11 @@ $help = array( ), array( 0 => 'My language is not in the list!', - 1 => 'The most likely reasons for this are either the administrator did not install your language or someone has not translated this board into your language. Try asking the board administrator if they can install the language pack you need, if it does not exist then please feel free to create a new translation. More information can be found at the phpBB Group website (see link at bottom of pages)' + 1 => 'The most likely reasons for this are either the administrator did not install your language or someone has not translated this board into your language. Try asking the board administrator if they can install the language pack you need, if it does not exist then please feel free to create a new translation. More information can be found at the phpBB Group website (see link at bottom of pages).' ), array( 0 => 'How do I show an image below my username?', - 1 => 'There may be two images below a username when viewing posts. The first is an image associated with your rank, generally these take the form of stars or blocks indicating how many posts you have made or your status on the forums. Below this may be a larger image known as an avatar, this is generally unique or personal to each user. It is up to the board administrator to enable avatars and they have a choice over the way in which avatars can be made available. If you are unable to use avatars then this is the decision of the board admin, you should ask them their reasons (we\'re sure they\'ll be good!)' + 1 => 'There may be two images below a username when viewing posts. The first is an image associated with your rank, generally these take the form of stars or blocks indicating how many posts you have made or your status on the board. Below this may be a larger image known as an avatar, this is generally unique or personal to each user. It is up to the board administrator to enable avatars and they have a choice over the way in which avatars can be made available. If you are unable to use avatars then this is the decision of the board admin, you should ask them their reasons.' ), array( 0 => 'How do I change my rank?', @@ -94,33 +108,57 @@ $help = array( ), array( 0 => 'How do I post a topic in a forum?', - 1 => 'Easy, click the relevant button on either the forum or topic screens. You may need to register before you can post a message, the facilities available to you are listed at the bottom of the forum and topic screens (the <i>You can post new topics, You can vote in polls, etc.</i> list)' + 1 => 'To post a new topic in one of the forums, click the relevant button on either the forum or topic screens. You may need to register before you can post a message, the facilities available to you are listed at the bottom of the forum and topic screens (the <em>You can post new topics, You can vote in polls, etc.</em> list).' ), array( 0 => 'How do I edit or delete a post?', - 1 => 'Unless you are the board admin or forum moderator you can only edit or delete your own posts. You can edit a post (sometimes for only a limited time after it was made) by clicking the <i>edit</i> button for the relevant post. If someone has already replied to the post you will find a small piece of text output below the post when you return to the topic, this lists the number of times you edited it. This will only appear if no one has replied, it also will not appear if moderators or administrators edit the post (they should leave a message saying what they altered and why). Please note that normal users cannot delete a post once someone has replied.' + 1 => 'Unless you are the board admin or forum moderator you can only edit or delete your own posts. You can edit a post (sometimes for only a limited time after it was made) by clicking the <em>edit</em> button for the relevant post. If someone has already replied to the post you will find a small piece of text output below the post when you return to the topic, this lists the number of times you edited it. This will only appear if no one has replied, it also will not appear if moderators or administrators edit the post (they should leave a message saying what they altered and why). Please note that normal users cannot delete a post once someone has replied.' ), array( 0 => 'How do I add a signature to my post?', - 1 => 'To add a signature to a post you must first create one, this is done via your profile. Once created you can check the <i>Add Signature</i> box on the posting form to add your signature. You can also add a signature by default to all your posts by checking the appropriate radio box in your profile (you can still prevent a signature being added to individual posts by un-checking the add signature box on the posting form)' + 1 => 'To add a signature to a post you must first create one, this is done via your profile. Once created you can check the <em>Add Signature</em> box on the posting form to add your signature. You can also add a signature by default to all your posts by checking the appropriate radio box in your profile (you can still prevent a signature being added to individual posts by un-checking the add signature box on the posting form).' ), array( 0 => 'How do I create a poll?', - 1 => 'Creating a poll is easy, when you post a new topic (or edit the first post of a topic, if you have permission) you should see a <i>Add Poll</i> form below the main posting box (if you cannot see this then you probably do not have rights to create polls). You should enter a title for the poll and then at least two options (to set an option type in the poll question and click the <i>Add option</i> button. You can also set a time limit for the poll, 0 is an infinite poll. There will be a limit to the number of options you can list, this is set by the board administrator' + 1 => 'Creating a poll is easy, when you post a new topic (or edit the first post of a topic, if you have permission) you should see an <em>Add Poll</em> form below the main posting box (if you cannot see this then you probably do not have rights to create polls). You should enter a title for the poll and then at least two options (to set an option type in the poll question and click the <em>Add option</em> button. You can also set a time limit for the poll, 0 is an infinite poll. There will be a limit to the number of options you can list, this is set by the board administrator.' ), array( 0 => 'How do I edit or delete a poll?', 1 => 'As with posts, polls can only be edited by the original poster, a moderator or board admin. To edit a poll click the first post in the topic (this always has the poll associated with it). If no one has cast a vote then users can delete the poll or edit any poll option, however if people have already placed votes only moderators or administrators can edit or delete it. This is to prevent people rigging polls by changing options mid-way through a poll' ), array( - 0 => 'Why can\'t I access a forum?', - 1 => 'Some forums may be limited to certain users or groups. To view, read, post, etc. you may need special authorisation, only the forum moderator and board admin can grant this access, you should contact them.' + 0 => 'Why can’t I access a forum?', + 1 => 'Some forums may be limited to certain users or groups. To view, read, post, etc. you may need special authorization, only the forum moderator and board admin can grant this access, you should contact them.' ), array( - 0 => 'Why can\'t I vote in polls?', + 0 => 'Why can’t I vote in polls?', 1 => 'Only registered users can vote in polls (so as to prevent spoofing of results). If you have registered and still cannot vote then you probably do not have appropriate access rights.' ), array( + 0 => 'Why can’t I add attachements?', + 1 => 'The ability to add attachments can be done on a per forum, per group, or per user basis. The board administrator may not have allowed attachments to be added for the specific forum you are posting in, or perhaps only the administrator group can post attachments. Contact the board administrator if you are unsure about why you are unable to add attachments.' + ), + array( + 0 => 'Why did I receieve a warning?', + 1 => 'Each board administrator has their own set of rules for their site. If they feel you have broken one of your rules, they may issue you a warning. Please note that this is the board administrator’s decision, and the phpBB Group does not have anything to do with the warning on the given site.' + ), + array( + 0 => 'How can I report posts to a moderator?', + 1 => 'If the board administrator has allowed it, go to the post you want to report and you should see a button that is for reporting posts. Clicking this will walk you through the steps necessary to report the post.' + ), + array( + 0 => 'What is the “Save†button for in topic posting?', + 1 => 'This allows you to save messages to be completed and submitted at a later date. To reload them, go to the User Control Panel and follow the self explanatory options there.' + ), + array( + 0 => 'Why does my post need to be approved?', + 1 => 'The board administrator may decide that the forum you are posting to needs to have posts reviewed first. It is also possible that the administrator has placed you in to a group of users whom he or she feels is a group that needs to have their posts reviewed before being submitted to the site. Please contact the board administrator for further details.' + ), + array( + 0 => 'How do I bump my topic?', + 1 => 'By clicking the “Bump topic†link when you are viewing it, you can “bump†the topic to the top of the forum on the first page. However, if you do not see this, then topic bumping is disabled. It is also possible to bump the topic simply by replying to it. However, be sure to follow the rules of the site you are visiting.' + ), + array( 0 => '--', 1 => 'Formatting and Topic Types' ), @@ -130,39 +168,47 @@ $help = array( ), array( 0 => 'Can I use HTML?', - 1 => '...' + 1 => 'No. It is not possible to post HTML on this board and have it rendered as HTML. Most formatting which can be carried out using HTML can also be applied using BBCode instead.' + ), + array( + 0 => 'What are Smilies?', + 1 => 'Smilies, or Emoticons are small graphical images which can be used to express some feeling using a short code, e.g. :) means happy, :( means sad. The full list of emoticons can be seen via the posting form. Try not to overuse smileys though, they can quickly render a post unreadable and a moderator may decide to edit them out or remove the post altogether.' ), array( - 0 => 'What are Smileys?', - 1 => 'Smileys, or Emoticons are small graphical images which can be used to express some feeling using a short code, e.g. :) means happy, :( means sad. The full list of emoticons can be seen via the posting form. Try not to overuse smileys though, they can quickly render a post unreadable and a moderator may decide to edit them out or remove the post altogether' + 0 => 'Can I post images?', + 1 => 'Yes, images can be shown in your posts. However; if the administrator has allowed attachments, you may be able to upload the image to the board. Otherwise, you must link to an image stored on a publicly accessible web server, e.g. http://www.example.com/my-picture.gif. You cannot link to pictures stored on your own PC (unless it is a publicly accessible server) nor images stored behind authentication mechanisms, e.g. hotmail or yahoo mailboxes, password protected sites, etc. To display the image use the BBCode [img] tag.' ), array( - 0 => 'Can I post Images?', - 1 => 'Images can indeed be shown in your posts. However, there is no facility at present for uploading images directly to this board. Therefore you must link to an image stored on a publicly accessible web server, e.g. http://www.some-unknown-place.net/my-picture.gif. You cannot link to pictures stored on your own PC (unless it is a publicly accessible server) nor images stored behind authentication mechanisms, e.g. hotmail or yahoo mailboxes, password protected sites, etc. To display the image use either the BBCode [img] tag or appropriate HTML (if allowed).' + 0 => 'What are global announcements?', + 1 => 'Global announcements contain important information and you should read them as soon as possible. Global announcements will appear at the top of every forum and also within your User Control Panel. Whether or not you can post a gloabl announcement depends on the permissions required, these are set by the administrator.' ), array( - 0 => 'What are Announcements?', - 1 => 'Announcements often contain important information and you should read them as soon as possible. Announcements appear at the top of every page in the forum to which they are posted. Whether or not you can post an announcement depends on the permissions required, these are set by the administrator.' + 0 => 'What are announcements?', + 1 => 'Announcements often contain important information for the forum you are currently reading and you should read them as soon as possible. Announcements appear at the top of every page in the forum to which they are posted. As with global announcements, whether or not you can post an announcement depends on the permissions required, these are set by the administrator.' ), array( - 0 => 'What are Sticky topics?', + 0 => 'What are sticky topics?', 1 => 'Sticky topics appear below any announcements in viewforum and only on the first page. They are often quite important so you should read them where possible. As with announcements the board administrator determines what permissions are required to post sticky topics in each forum.' ), array( - 0 => 'What are Locked topics?', + 0 => 'What are locked topics?', 1 => 'Locked topics are set this way by either the forum moderator or board administrator. You cannot reply to locked topics and any poll it contained is automatically ended. Topics may be locked for many reasons.' ), array( + 0 => 'What are topic icons?', + 1 => 'Topic icons are images which can be assosciated with posts to indicate their content. The ability to use topic icons depends on the permissions set by the administrator.' + ), + array( 0 => '--', 1 => 'User Levels and Groups' ), array( 0 => 'What are Administrators?', - 1 => 'Administrators are people assigned the highest level of control over the entire board. These people can control all facets of board operation which includes setting permissions, banning users, creating usergroups or moderators, etc. They also have full moderator capabilities in all the forums.' + 1 => 'Administrators are people assigned the highest level of control over the entire board. These people can control all facets of board operation which includes setting permissions, banning users, creating usergroups or moderators, etc, dependant on the board founder and what permissions he or she has given the other administrators. They can also have full moderator capabilities in all the forums, depending on what the board founder has allowed.' ), array( 0 => 'What are Moderators?', - 1 => 'Moderators are individuals (or groups of individuals) whose job it is to look after the running of the forums from day to day. They have the power to edit or delete posts and lock, unlock, move, delete and split topics in the forum they moderate. Generally moderators are there to prevent people going <i>off-topic</i> or posting abusive or offensive material.' + 1 => 'Moderators are individuals (or groups of individuals) whose job it is to look after the running of the forums from day to day. They have the power to edit or delete posts and lock, unlock, move, delete and split topics in the forum they moderate. Generally moderators are there to prevent people going <em>off-topic</em> or posting abusive or offensive material.' ), array( 0 => 'What are Usergroups?', @@ -170,11 +216,23 @@ $help = array( ), array( 0 => 'How do I join a Usergroup?', - 1 => 'To join a usergroup click the usergroup link on the page header (dependent on template design), you can then view all usergroups. Not all groups are <i>open access</i>, some are closed and some may even have hidden memberships. If the board is open then you can request to join it by clicking the appropriate button. The user group moderator will need to approve your request, they may ask why you want to join the group. Please do not pester a group moderator if they turn your request down, they will have their reasons.' + 1 => 'To join a Usergroup click the Usergroup link within your User Control Panel, you can then view all usergroups. Not all groups are <em>open access</em>, some may require approval to join, some are closed and some may even have hidden memberships. If the group is open then you can join it by clicking the appropriate button. If a group requires approval to join you may request to join it by clicking the appropriate button. The user group moderator will need to approve your request, they may ask why you want to join the group. Please do not pester a group moderator if they turn your request down, they will have their reasons.' ), array( 0 => 'How do I become a Usergroup Moderator?', - 1 => 'Usergroups are initially created by the board admin, they also assign a board moderator. If you are interested in creating a usergroup then your first point of contact should be the admin, try dropping them a private message.' + 1 => 'When Usergroups are initially created by the board administrator, they also assign a Usergroup moderator. If you are interested in creating a Usergroup then your first point of contact should be the administrator, try sending them a private message.' + ), + array( + 0 => 'Why do some Usergroups appear in a different colour?', + 1 => 'It is possible for the board administrator to assign a colour to the members of a usergroup to make it easy to identify the members of this group.' + ), + array( + 0 => 'What is a “Default Usergroupâ€?', + 1 => 'If you are a member of more than one usergroup, your default is used to determine which group colour and group rank should be shown for you by default. The board administrator may grant you permission to change your default usergroup via your User Control Panel.' + ), + array( + 0 => 'What is “The team†link?', + 1 => 'This page provides you with a list of the board staff, including board administrators and moderators which includes details of which forums they moderate.' ), array( 0 => '--', @@ -182,11 +240,11 @@ $help = array( ), array( 0 => 'I cannot send private messages!', - 1 => 'There are three reasons for this; you are not registered and/or not logged on, the board administrator has disabled private messaging for the entire board or the board administrator has prevented you from sending messages. If it is the later case you should try asking the administrator why.' + 1 => 'There are three reasons for this; you are not registered and/or not logged on, the board administrator has disabled private messaging for the entire board, or the board administrator has prevented you from sending messages. If it is the latter case you should try asking the administrator why.' ), array( 0 => 'I keep getting unwanted private messages!', - 1 => 'In the future we will be adding an ignore list to the private messaging system. For now though if you keep receiving unwanted private messages from someone inform the board admin, they have the power to prevent a user from sending private messages at all.' + 1 => 'You may block a user from sending you private messages by using message rules within your User Control Panel. If you are receiving abusive private messages from someone inform the board admin, they have the power to prevent a user from sending private messages at all.' ), array( 0 => 'I have received a spamming or abusive email from someone on this board!', @@ -194,14 +252,78 @@ $help = array( ), array( 0 => '--', - 1 => 'phpBB 2 Issues' + 1 => 'Friends and Foes' + ), + array( + 0 => 'What is my Friends and Foes list?', + 1 => 'You can use these lists to organise other members of the forum. Members added to your friends list will be listed within your User Control Panel for quick access to see their online status and to send them private messages. Subject to template support, posts from these users may also be highlighted. If you add a user to your foes list them any posts made by them will be hidden by default.' + ), + array( + 0 => 'How can I add / remove users to my friends or foes list?', + 1 => 'You can add users to your list in two ways. Within each user’s profile, there is a link to add them to either your friend or foe list. Alternatively from your User Control Panel, you can directly add users by entering their member name. You may also remove users from your list using the same page.' + ), + array( + 0 => '--', + 1 => 'Searching the Forums' + ), + array( + 0 => 'How can I search the forum?', + 1 => 'By entering a search term in the search box located on the index view, forum view or topic view. Advanced search can be accessed by clicking the “Search†link which is available on all pages on the forum.' + ), + array( + 0 => 'Why does my search return no results?', + 1 => 'Your search was probably too vague and included many common terms which are not indexed by phpBB3. Be more specific and use the options available within Advanced search.' + ), + array( + 0 => 'Why does my search return a blank page!?', + 1 => 'Your search returned too many results for the webserver to handle. Use Advanced search and be more specific in the terms used and forums that are to be searched.' + ), + array( + 0 => 'How do I search for members?', + 1 => 'Go to the “Members†page and click the “Find a member†link. Once there, fill out the self explanatory options.' + ), + array( + 0 => 'How can I find my own posts and topics?', + 1 => 'Your own posts can be retrieved either by clicking the “Search user’s posts†within the User Control Panel or via your own profile page. To search for your topics, use the Advanced search page and fill in the various options appropiately.' + ), + array( + 0 => '--', + 1 => 'Topic Subscriptions and Bookmarks' + ), + array( + 0 => 'What is the difference between bookmarking and subscribing?', + 1 => 'Bookmarking in phpBB3 is much like bookmarking in your web browser. You aren’t necessarily alerted when there’s an update, but you can later come back to the topic. To contrast that with subscribing, subscribing will notify you when there is an update to the topic or forum on the board via your preferred method or methods.' + ), + array( + 0 => 'How do I subscribe to specific forums or topics?', + 1 => 'To subscribe to a specific forum, once you enter the forum, you will see a “Subscribe to forum†link. This will subscribe you to the forum just like you would for a topic. To subscribe to a topic, you can either reply to the topic and check the checkbox to subscribe or you can click the link that says subscribe to topic from within the topic itself.' + ), + array( + 0 => 'How do I remove my subscriptions?', + 1 => 'To remove your subscriptions, you simply go to your User Control Panel, or UCP for short, and follow the links to your subscriptions.' + ), + array( + 0 => '--', + 1 => 'Attachments' + ), + array( + 0 => 'What attachments are allowed on this board?', + 1 => 'Each board administrator can allow or disallow certain attachment types. If you are unsure what is allowed to be uploaded, contact the board administrator for assistance.' + ), + array( + 0 => 'How do I find all my attachments?', + 1 => 'To find your list of attachments that you have uploaded, go to your User Control Panel, or UCP, and follow the links to the attachments section.' + ), + array( + 0 => '--', + 1 => 'phpBB 3 Issues' ), array( 0 => 'Who wrote this bulletin board?', 1 => 'This software (in its unmodified form) is produced, released and is copyright <a href="http://www.phpbb.com/" target="_blank">phpBB Group</a>. It is made available under the GNU General Public Licence and may be freely distributed, see link for more details' ), array( - 0 => 'Why isn\'t X feature available?', + 0 => 'Why isn’t X feature available?', 1 => 'This software was written by and licensed through phpBB Group. If you believe a feature needs to be added then please visit the phpbb.com website and see what phpBB Group have to say. Please do not post feature requests to the board at phpbb.com, the Group uses sourceforge to handle tasking of new features. Please read through the forums and see what, if any, our position may already be for a feature and then follow the procedure given there.' ), array( diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index c93ccd78f4..86a1761bfe 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang)) // 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 @@ -37,7 +39,7 @@ $lang = array_merge($lang, array( 'ADMIN_USERNAME' => 'Administrator username', 'ADMIN_USERNAME_EXPLAIN' => '(Please enter a username between 3 and 20 characters in length)', 'APP_MAGICK' => 'Imagemagick support [ Attachments ]', - 'AUTHOR_NOTES' => 'Author Notes<br />» %s', + 'AUTHOR_NOTES' => 'Author Notes<br />» %s', 'AVAILABLE' => 'Available', 'AVAILABLE_CONVERTORS' => 'Available Convertors', @@ -61,22 +63,22 @@ $lang = array_merge($lang, array( 'CONTINUE_LAST' => 'Continue last statements', 'CONVERT' => 'Convert', 'CONVERT_COMPLETE' => 'Conversion completed', - 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.0. You can now login and <a href="../">access your forum </a>. Remember that help on using phpBB is available online via the <a href="http://www.phpbb.com/support/documentation/3.0/">Userguide</a> and the <a href="http://www.phpbb.com/phpBB/viewforum.php?f=46">Beta support forum</a>', + 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.0. You can now login and <a href="../">access your forum</a>. Remember that help on using phpBB is available online via the <a href="http://www.phpbb.com/support/documentation/3.0/">Userguide</a> and the <a href="http://www.phpbb.com/phpBB/viewforum.php?f=46">Beta support forum</a>', 'CONVERT_INTRO' => 'Welcome to the phpBB Unified Convertor Framework', 'CONVERT_INTRO_BODY' => 'From here, you are able to import data from other (installed) forum systems. The list below shows all the conversion modules currently available. If there is no convertor shown in this list for the forum software you wish to convert from, please check our website where further conversion modules may be available for download.', 'CONVERT_NOT_EXIST' => 'The specified convertor does not exist', 'CONVERT_SETTINGS_VERIFIED' => 'The information you entered has been verified. To start the conversion progress, push the button below to begin', - 'COULD_NOT_COPY' => 'Could not copy file <b>%1$s</b> to <b>%2$s</b><br /><br />Please check that the target directory exists and is writable by the webserver', - 'COULD_NOT_FIND_PATH' => 'Could not find path to your former forum. Please check your settings and try again.<br />» Specified source path was %s', + 'COULD_NOT_COPY' => 'Could not copy file <strong>%1$s</strong> to <strong>%2$s</strong><br /><br />Please check that the target directory exists and is writable by the webserver', + 'COULD_NOT_FIND_PATH' => 'Could not find path to your former forum. Please check your settings and try again.<br />» Specified source path was %s', 'DBMS' => 'Database type', 'DB_CONFIG' => 'Database Configuration', 'DB_CONNECTION' => 'Database Connection', - 'DB_ERR_INSERT' => 'Error while processing INSERT query', - 'DB_ERR_LAST' => 'Error while processing query_last', - 'DB_ERR_QUERY_FIRST' => 'Error while executing query_first', - 'DB_ERR_QUERY_FIRST_TABLE' => 'Error while executing query_first, %s ("%s")', - 'DB_ERR_SELECT' => 'Error while running SELECT query', + 'DB_ERR_INSERT' => 'Error while processing <code>INSERT</code> query', + 'DB_ERR_LAST' => 'Error while processing <var>query_last</var>', + 'DB_ERR_QUERY_FIRST' => 'Error while executing <var>query_first</var>', + 'DB_ERR_QUERY_FIRST_TABLE' => 'Error while executing <var>query_first</var>, %s ("%s")', + 'DB_ERR_SELECT' => 'Error while running <code>SELECT</code> query', 'DB_HOST' => 'Database server hostname or DSN', 'DB_HOST_EXPLAIN' => 'DSN stands for Data Source Name and is relevant only for ODBC installs.', 'DB_NAME' => 'Database name', @@ -90,21 +92,21 @@ $lang = array_merge($lang, array( 'DEV_NO_TEST_FILE' => 'No value has been specified for the test_file variable in the convertor. If you are a user of this convertor, you should not be seeing this error, please report this message to the convertor author. If you are a convertor author, you must specify the name of a file which exists in the source forum to allow the path to it to be verified.', 'DIRECTORIES_AND_FILES' => 'Directory and file setup', 'DISABLE_KEYS' => 'Disabling keys', - 'DLL_FIREBIRD' => 'Firebird 1.5+', + 'DLL_FIREBIRD' => 'Firebird', 'DLL_FTP' => 'Remote FTP support [ Installation ]', + 'DLL_GD' => 'GD graphics support [ Visual Confirmation ]', 'DLL_MBSTRING' => 'Multi-byte character support', 'DLL_MSSQL' => 'MSSQL Server 2000+', 'DLL_MSSQL_ODBC' => 'MSSQL Server 2000+ via ODBC', - 'DLL_MYSQL' => 'MySQL 3.23.x/4.x', - 'DLL_MYSQL4' => 'MySQL 4.x/5.x', - 'DLL_MYSQLI' => 'MySQL 4.1.x/5.x with MySQLi Extension', + 'DLL_MYSQL' => 'MySQL', + 'DLL_MYSQLI' => 'MySQL with MySQLi Extension', 'DLL_ORACLE' => 'Oracle', 'DLL_POSTGRES' => 'PostgreSQL 7.x/8.x', 'DLL_SQLITE' => 'SQLite', 'DLL_XML' => 'XML support [ Jabber ]', - 'DLL_ZLIB' => 'zlib Compression support [ gz, .tar.gz, .zip ]', + 'DLL_ZLIB' => 'zlib compression support [ gz, .tar.gz, .zip ]', 'DL_CONFIG' => 'Download config', - 'DL_CONFIG_EXPLAIN' => 'You may download the complete config.php to your own PC. You will then need to upload the file manually, replacing any existing config.php in your phpBB 3.0 root directory. Please remember to upload the file in ASCII format (see your FTP application documentation if you are unsure how to achieve this). When you have uploaded the config.php please click "Done" to move to the next stage.', + 'DL_CONFIG_EXPLAIN' => 'You may download the complete config.php to your own PC. You will then need to upload the file manually, replacing any existing config.php in your phpBB 3.0 root directory. Please remember to upload the file in ASCII format (see your FTP application documentation if you are unsure how to achieve this). When you have uploaded the config.php please click “Done†to move to the next stage.', 'DL_DOWNLOAD' => 'Download', 'DONE' => 'Done', @@ -113,8 +115,8 @@ $lang = array_merge($lang, array( 'FILES_OPTIONAL' => 'Optional Files and Directories', 'FILES_OPTIONAL_EXPLAIN' => '<strong>Optional</strong> - These files, directories or permissions are not required. The installation routines will attempt to use various techniques to complete if they do not exist or cannot be written to. However, the presence of these files, directories or permissions will speed installation.', 'FILES_REQUIRED' => 'Files and Directories', - '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 "Unwriteable" you need to change the permissions on the file or directory to allow phpBB to write to it.', - 'FILLING_TABLE' => 'Filling table <b>%s</b>', + '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 “Unwriteable†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', 'FINAL_STEP' => 'Process Final Step', 'FORUM_ADDRESS' => 'Forum address', @@ -133,7 +135,7 @@ $lang = array_merge($lang, array( 'INITIAL_CONFIG' => 'Basic Configuration', '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' => 'You have now successfully installed phpBB 3.0. 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/">Userguide</a> and the <a href="http://www.phpbb.com/phpBB/viewforum.php?f=46">Beta support forum</a>, see the %sREADME%s for further information.', + 'INSTALL_CONGRATS_EXPLAIN' => 'You have now successfully installed phpBB 3.0. 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/">Userguide</a> and the <a href="http://www.phpbb.com/phpBB/viewforum.php?f=46">Beta support forum</a>, see the %sREADME%s for further information.<br /><br /><strong>Please now delete, move or rename the install directory before you use your forum. If this directory is still present, 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 phpBB onto your server.</p><p>In order to proceed, you will need the following information to hand:</p> <ul> @@ -141,7 +143,7 @@ $lang = array_merge($lang, array( <li>Database name</li> <li>Database username and password</li> </ul> - <p>Some more introductory text can go here...', + <p>Some more introductory text can go here…', 'INSTALL_INTRO_NEXT' => 'To commence the installation, please press the button below.', 'INSTALL_LOGIN' => 'Login', 'INSTALL_NEXT' => 'Next stage', @@ -155,13 +157,17 @@ $lang = array_merge($lang, array( 'INST_ERR_DB_CONNECT' => 'Could not connect to the database, see error message below', 'INST_ERR_DB_FORUM_PATH' => 'The database file specified is within your forum directory tree. You should put this file in a non web-accessible location', 'INST_ERR_DB_NO_ERROR' => 'No error message given', - 'INST_ERR_DB_NO_MYSQL4' => 'The version of MySQL installed on this machine is incompatible with the "MySQL 4.x/5.x" option you have selected. Please try the "MySQL 3.23.x/4.x" option instead.', - 'INST_ERR_DB_NO_MYSQLI' => 'The version of MySQL installed on this machine is incompatible with the "MySQL 4.1.x/5.x with MySQLi Extension" option you have selected. Please try the "MySQL 4.x/5.x" or "MySQL 3.23.x/4.x" option instead.', + 'INST_ERR_DB_NO_MYSQL4' => 'The version of MySQL installed on this machine is incompatible with the “MySQL 4.x/5.x†option you have selected. Please try the “MySQL 3.23.x/4.x†option instead.', + 'INST_ERR_DB_NO_MYSQLI' => 'The version of MySQL installed on this machine is incompatible with the “MySQL 4.1.x/5.x with MySQLi Extension†option you have selected. Please try the “MySQL 3.23.x/4.x†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_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', 'INST_ERR_EMAIL_INVALID' => 'The email address you entered is invalid', 'INST_ERR_EMAIL_MISMATCH' => 'The emails you entered did not match.', 'INST_ERR_FATAL' => 'Fatal installation error', - 'INST_ERR_FATAL_DB' => 'A fatal and unrecoverable database error has occured. This may be because the specified user does not have appropriate rights to CREATE TABLES or INSERT data, etc. Further information may be given below. Please contact your hosting provider in the first instance or the support forums of phpBB for further assistance.', + 'INST_ERR_FATAL_DB' => 'A fatal and unrecoverable database error has occured. This may be because the specified user does not have appropriate rights to <code>CREATE TABLES</code> or <code>INSERT</code> data, etc. Further information may be given below. Please contact your hosting provider in the first instance or the support forums of phpBB for further assistance.', 'INST_ERR_FTP_PATH' => 'Could not change to the given directory, please check the path.', 'INST_ERR_FTP_LOGIN' => 'Could not login to FTP server, check your username and password', 'INST_ERR_MISSING_DATA' => 'You must fill out all fields in this block', @@ -170,13 +176,14 @@ $lang = array_merge($lang, array( 'INST_ERR_PASSWORD_TOO_LONG' => 'The password you entered is too long. The maximum length is 30 characters.', 'INST_ERR_PASSWORD_TOO_SHORT' => 'The password you entered is too short. The minimum length is 6 characters.', 'INST_ERR_PREFIX' => 'Tables with the specified prefix already exist, please choose an alternative.', + 'INST_ERR_PREFIX_INVALID' => 'The table prefix you have specified is invalid for your database. Please try another, removing characters such as the hyphen', 'INST_ERR_PREFIX_TOO_LONG' => 'The table prefix you have specified is too long. The maximum length is %d characters.', 'INST_ERR_USER_TOO_LONG' => 'The username you entered is too long. The maximum length is 20 characters.', 'INST_ERR_USER_TOO_SHORT' => 'The username you entered is too short. The minimum length is 3 characters.', 'INVALID_PRIMARY_KEY' => 'Invalid primary key : %s', - 'MAKE_FOLDER_WRITABLE' => 'Please make sure that this folder exists and is writable by the webserver then try again:<br />»<b>%s</b>', - 'MAKE_FOLDERS_WRITABLE' => 'Please make sure that these folders exist and are writable by the webserver then try again:<br />»<b>%s</b>', + 'MAKE_FOLDER_WRITABLE' => 'Please make sure that this folder exists and is writable by the webserver then try again:<br />»<strong>%s</strong>', + 'MAKE_FOLDERS_WRITABLE' => 'Please make sure that these folders exist and are writable by the webserver then try again:<br />»<strong>%s</strong>', 'NAMING_CONFLICT' => 'Naming conflict: %s and %s are both aliases<br /><br />%s', 'NEXT_STEP' => 'Proceed to next step', @@ -192,11 +199,11 @@ $lang = array_merge($lang, array( 'PHP_OPTIONAL_MODULE_EXPLAIN' => '<strong>Optional</strong> - These modules or applications are optional, you do not need these to use phpBB 3.0. However if you do have them they will will enable greater functionality.', 'PHP_SUPPORTED_DB' => 'Supported Databases', 'PHP_SUPPORTED_DB_EXPLAIN' => '<strong>Required</strong> - You must have support for at least one compatible database within PHP. If no database modules are shown as available you should contact your hosting provider or review the relevant PHP installation documentation for advice.', - 'PHP_REGISTER_GLOBALS' => 'PHP setting "register_globals" is disabled', + 'PHP_REGISTER_GLOBALS' => 'PHP setting <var>register_globals</var> is disabled', 'PHP_REGISTER_GLOBALS_EXPLAIN' => 'phpBB will still run if this setting is enabled, but if possible, it is recommended that register_globals is disabled on your PHP install for security reasons.', 'PHP_SAFE_MODE' => 'Safe Mode', 'PHP_SETTINGS' => 'PHP Version and Settings', - 'PHP_SETTINGS_EXPLAIN' => '<strong>Required</strong> - You must be running at least version 4.3.3 of PHP in order to install phpBB. If "safe mode" is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.', + 'PHP_SETTINGS_EXPLAIN' => '<strong>Required</strong> - You must be running at least version 4.3.3 of PHP in order to install phpBB. If <var>safe mode</var> is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.', 'PHP_VERSION_REQD' => 'PHP version >= 4.3.3', 'PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using <strong>%s</strong> as table prefix.', 'PREPROCESS_STEP' => 'Executing pre-processing functions/queries', @@ -228,23 +235,24 @@ $lang = array_merge($lang, array( 'STAGE_REQUIREMENTS' => 'Requirements', 'STAGE_SETTINGS' => 'Settings', 'STARTING_CONVERT' => 'Starting Conversion Process', - 'STEP_PERCENT_COMPLETED' => 'Step <b>%d</b> of <b>%d</b>: %d%% completed', + 'STEP_PERCENT_COMPLETED' => 'Step <strong>%d</strong> of <strong>%d</strong>: %d%% completed', 'SUB_INTRO' => 'Introduction', 'SUB_LICENSE' => 'License', 'SUB_SUPPORT' => 'Support', 'SUCCESSFUL_CONNECT' => 'Successful Connection', // TODO: Write some text on obtaining support - 'SUPPORT_BODY' => 'During the beta phase a minimal level of support will be given at <a href="http://www.phpbb.com/phpBB/viewforum.php?f=46">the phpBB 3.0 Beta support forum</a>. We will provide answers to general setup questions, configuration problems and support for determining common problems mostly related to bugs. We will not support modifications, custom code/style additions or any users using the beta packages within a live environment.</p><p>For additional assistance, please refer to our <a href="http://www.phpbb.com/support/documentation/3.0/quickstart/">Quick Start Guide</a>.</p><p>To ensure you stay up to date with the latest news and releases, why not <a href="http://www.phpbb.com/support/" target="_new">subscribe to our mailing list</a>', + 'SUPPORT_BODY' => 'During the beta phase a minimal level of support will be given at <a href="http://www.phpbb.com/phpBB/viewforum.php?f=46">the phpBB 3.0 Beta support forum</a>. We will provide answers to general setup questions, configuration problems and support for determining common problems mostly related to bugs. We will not support modifications, custom code/style additions or any users using the beta packages within a live environment.</p><p>For additional assistance, please refer to our <a href="http://www.phpbb.com/support/documentation/3.0/quickstart/">Quick Start Guide</a>.</p><p>To ensure you stay up to date with the latest news and releases, why not <a href="http://www.phpbb.com/support/">subscribe to our mailing list</a>', 'SYNC_FORUMS' => 'Starting to sync forums', 'SYNC_TOPICS' => 'Starting to sync topics', 'SYNC_TOPIC_ID' => 'Synchronising topics from topic_id $1%s to $2%s', - 'TABLES_MISSING' => 'Could not find these tables<br />» <b>%s</b>.', + 'TABLES_MISSING' => 'Could not find these tables<br />» <strong>%s</strong>.', 'TABLE_PREFIX' => 'Prefix for tables in database', - 'TABLE_PREFIX_SAME' => 'The table prefix needs to be the one used by the software you are converting from.<br />» Specified table prefix was %s', + 'TABLE_PREFIX_SAME' => 'The table prefix needs to be the one used by the software you are converting from.<br />» Specified table prefix was %s', 'TESTS_PASSED' => 'Tests passed', 'TESTS_FAILED' => 'Tests failed', + 'UNABLE_WRITE_LOCK' => 'Unable to write lock file', 'UNAVAILABLE' => 'Unavailable', 'UNWRITEABLE' => 'Unwriteable', @@ -254,4 +262,171 @@ $lang = array_merge($lang, array( 'WRITEABLE' => 'Writeable', )); +// Updater +$lang = array_merge($lang, array( + 'ALL_FILES_UP_TO_DATE' => 'All files are up to date with the latest phpBB version. You may want to run the database update tool now.', + 'ARCHIVE_FILE' => 'Source file within archive', + + 'BACK' => 'Back', + + 'CHECK_FILES' => 'Check files', + 'CHECK_FILES_AGAIN' => 'Check files again', + 'CHECK_FILES_EXPLAIN' => 'Within the next step all files will be checked against the update files - this can take a while if this is the first file check.', + 'CHECK_FILES_UP_TO_DATE' => 'According to your database your version is up to date. You may want to proceed with the file check to make sure all files are really up to date with the latest phpBB version.', + 'COLLECTED_INFORMATIONS' => 'Collected file informations', + 'COLLECTED_INFORMATIONS_EXPLAIN'=> 'The list below shows informations about the files needing an update. Please read the information in front of every status block to see what they mean and what you may need to do to perform a successful update.', + 'COMPLETE_LOGIN_TO_BOARD' => 'You should now <a href="../ucp.php?mode=login">login to your board</a> and check if everything is working fine. Don’t forget to delete, rename or move your install directory!', + 'CURRENT_FILE' => 'Current original file', + 'CURRENT_VERSION' => 'Current version', + + 'DATABASE_TYPE' => 'Database type', + 'DATABASE_UPDATE_INFO_OLD' => 'The database update file within the install directory is outdated. Please make sure you uploaded the correct version of the file.', + 'DESTINATION' => 'Destination file', + 'DIFF_INLINE' => 'Inline', + 'DIFF_RAW' => 'Raw unified diff', + 'DIFF_SEP_EXPLAIN' => 'End of current file / Begin of new updated file', + 'DIFF_SIDE_BY_SIDE' => 'Side by Side', + 'DIFF_UNIFIED' => 'Unified diff', + 'DO_NOT_UPDATE' => 'Do not update this file', + 'DONE' => 'Done', + 'DOWNLOAD' => 'Download', + 'DOWNLOAD_AS' => 'Download as', + 'DOWNLOAD_UPDATE_METHOD' => 'Download modified files archive', + 'DOWNLOAD_UPDATE_METHOD_EXPLAIN' => 'Once downloaded you should unpack the archive. You will find the modified files you need to upload to your phpBB root directory within it. Please upload the files to their respective locations then. After you have uploaded all files, please check the files again with the other button below.', + + 'ERROR' => 'Error', + + 'FILE_ALREADY_UP_TO_DATE' => 'File is already up to date', + 'FILE_USED' => 'Informations used from', + 'FILES_CONFLICT' => 'Conflict files', + 'FILES_CONFLICT_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. phpBB determined that these files create conflicts if they are tried to be merged. Please investigate the conflicts and try to manually resolve them or continue the update choosing the preferred merging method. If you resolve the conflicts manually check the files again after you modified the them. You are also able to choose between the preferred merge method for every file. The first one will result in a file where the conflicting lines from your old file will be lost, the other one will result in loosing the changes from the newer file.', + 'FILES_MODIFIED' => 'Modified files', + 'FILES_MODIFIED_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. The updated file will be a merge between your modifications and the new file.', + 'FILES_NEW' => 'New files', + 'FILES_NEW_EXPLAIN' => 'The following files currently do not exist within your installation.', + 'FILES_NEW_CONFLICT' => 'New conflicting files', + 'FILES_NEW_CONFLICT_EXPLAIN' => 'The following files are new within the latest version but it has been determined that there is already a file with the same name within the same position. This file will be overwritten by the new file.', + 'FILES_NOT_MODIFIED' => 'Not modified files', + 'FILES_NOT_MODIFIED_EXPLAIN' => 'The following files were not modified and represent the original phpBB files from the version you want to update from.', + 'FILES_UP_TO_DATE' => 'Already updated files', + 'FILES_UP_TO_DATE_EXPLAIN' => 'The following files are already up to date and do not need to be updated.', + 'FTP_SETTINGS' => 'FTP Settings', + 'FTP_UPDATE_METHOD' => 'FTP Upload', + + 'INCOMPATIBLE_UPDATE_FILES' => 'The update files found are incompatible with your installed version. Your installed version is %1$s and the update file is for updating phpBB %2$s to %3$s.', + 'INCOMPLETE_UPDATE_FILES' => 'The update files are incomplete', + + 'LATEST_VERSION' => 'Latest version', + 'LINE' => 'Line', + 'LINE_ADDED' => 'Added', + 'LINE_MODIFIED' => 'Modified', + 'LINE_REMOVED' => 'Removed', + 'LINE_UNMODIFIED' => 'Unmodified', + 'LOGIN_UPDATE_EXPLAIN' => 'In order to update your installation you need to login first.', + + 'MAPPING_FILE_STRUCTURE' => 'To ease the upload here are the file locations which map your phpBB installation.', + 'MERGE_MOD_FILE_OPTION' => 'Use modified file code on final merge', + 'MERGE_NEW_FILE_OPTION' => 'Use new file code on final merge', + 'MERGE_SELECT_ERROR' => 'Conflicting file merge modes are not correctly selected.', + + 'NEW_FILE' => 'New updated file', + 'NO_AUTH_UPDATE' => 'Not authorized to update', + 'NO_DATABASE_UPDATE_NEEDED' => 'All of your files seem to be up to date. Since you are already running the latest version you do not need to update your database.', + 'NO_ERRORS' => 'No errors', + 'NO_UPDATE_FILES' => 'Not updating the following files', + 'NO_UPDATE_FILES_EXPLAIN' => 'The following files are new or modified but the directory they normally reside in could not be found on your installation. If this list contains files to other directories than language/ or styles/ than you may have modified your directory structure and the update may be incomplete.', + 'NO_UPDATE_FILES_OUTDATED' => 'No valid update directory was found, please make sure you uploaded the relevant files.<br /><br />Your installation does <strong>not</strong> seem to be up to date. Updates are available for your version of phpBB %1$s, please visit <a href="http://www.phpbb.com/downloads.php" rel="external">http://www.phpbb.com/downloads.php</a> to obtain the correct package to update from Version %2$s to Version %3$s.', + 'NO_UPDATE_FILES_UP_TO_DATE' => 'Your version is up to date. There is no need to run the update tool. If you want to make an integrity check on your files make sure you uploaded the correct update files.', + 'NO_UPDATE_INFO' => 'Update file informations could not be found.', + 'NO_UPDATES_REQUIRED' => 'No updates required', + 'NO_VISIBLE_CHANGES' => 'No visible changes', + 'NOTICE' => 'Notice', + 'NUM_CONFLICTS' => 'Number of conflicts', + + 'OLD_UPDATE_FILES' => 'Update files are out of date. The update files found are for updating to phpBB %1$s to phpBB %2$s but the latest version of phpBB is %3$s.', + + 'PERFORM_DATABASE_UPDATE' => 'Perform database update', + 'PERFORM_DATABASE_UPDATE_EXPLAIN' => 'Below you will find a link to the database update script. This script needs to be run seperatly because updating the database might result in unexpected behaviour if you are logged in. The database update can take a while, so please do not stop the execution if it only seems to hang. After you clicked the link and the update finished you can close this window too.', + 'PREVIOUS_VERSION' => 'Previous version', + 'PROGRESS' => 'Progress', + + 'RESULT' => 'Result', + 'RUN_DATABASE_SCRIPT' => 'Update my database now', + + 'SELECT_DIFF_MODE' => 'Select diff mode', + 'SELECT_DOWNLOAD_FORMAT' => 'Select download archive format', + 'SELECT_FTP_SETTINGS' => 'Select FTP Settings', + 'SHOW_DIFF_CONFLICT' => 'Show differences/conflicts', + 'SHOW_DIFF_MODIFIED' => 'Show merged differences', + 'SHOW_DIFF_NEW' => 'Show file contents', + 'SHOW_DIFF_NEW_CONFLICT' => 'Show differences', + 'SHOW_DIFF_NOT_MODIFIED' => 'Show differences', + 'SOME_QUERIES_FAILED' => 'Some queries failed, the statements and errors are listing below', + 'SQL' => 'SQL', + 'SQL_FAILURE_EXPLAIN' => 'This is probably nothing to worry about, update will continue. Should this fail to complete you may need to seek help at our support forums. See <a href="../docs/README.html">README</a> for details on how to obtain advice.', + 'STAGE_FILE_CHECK' => 'Check files', + 'STAGE_UPDATE_DB' => 'Update database', + 'STAGE_UPDATE_FILES' => 'Update files', + 'STAGE_VERSION_CHECK' => 'Version Check', + 'STATUS_CONFLICT' => 'Modified file producing conflicts', + 'STATUS_MODIFIED' => 'Modified file', + 'STATUS_NEW' => 'New file', + 'STATUS_NEW_CONFLICT' => 'Conflicting new file', + 'STATUS_NOT_MODIFIED' => 'Not modified file', + 'STATUS_UP_TO_DATE' => 'Already updated file', + + 'UPDATE_COMPLETED' => 'Update completed', + 'UPDATE_DATABASE' => 'Update database', + 'UPDATE_DATABASE_SCHEMA' => 'Updating database schema', + 'UPDATE_FILES' => 'Update files', + 'UPDATE_FILES_NOTICE' => 'Please make sure you have updated your board files too, this file is only updating your database.', + 'UPDATE_INSTALLATION' => 'Update phpBB Installation', + 'UPDATE_INSTALLATION_EXPLAIN' => 'With this option, it is possible to update your phpBB installation to the latest version.<br />During the process all of your files will be checked for their integrity. You are able to review all differences and files before the update.<br /><br />The file update itself can be done in two different ways.</p><h2>Manual Update</h2><p>With this update you only download your personal set of changed files to make sure you do not loose your file modifications you may have done. After you downloaded this package you need to manually upload the files to their correct position under your phpBB root directory. Once done, you are able to do the file check stage again to see if you moved the files to their correct location. If everything is correctly updated you will be forwarded to the database updater.</p><h2>Automatic Update with FTP</h2><p>This method is similar to the first one but without the need to download the changed files and uploading them on your own. This will be done for you. In order to use this method you need to know your FTP login details since you will be asked for them. Once finished you will be redirected to the file check again to make sure everything got updated correctly. If so, you will be forwarded to the database updater.', + 'UPDATE_INSTRUCTIONS' => ' + + <h1>Release announcement</h1> + + <p>Please read <a href="%1$s" title="%1$s">the release announcement for the latest version</a> before you continue your update process, it may contain useful information. It also contains full download links as well as the change log.</p> + + <br /> + + <h1>How to update your installation</h1> + + <p>The recommended way of updating your installation only takes the following steps:</p> + + <ul style="margin-left: 20px; font-size: 1.1em;"> + <li>Go to the <a href="http://www.phpbb.com/downloads.php" title="http://www.phpbb.com/downloads.php">phpBB.com downloads page</a> and download the correct archive. If you are unsure you can <a href="%2$s" title="%2$s">download the correct archive directly</a> as a zip file.<br /><br /></li> + <li>Unpack the archive<br /><br /></li> + <li>Upload the complete uncompressed install folder to your phpBB root directory (where your config.php file is).<br /><br /></li> + </ul> + + <p>Once uploaded your board will be offline for normal users.<br /><br /> + <strong><a href="%3$s" title="%3$s">Now start the update process by pointing your browser to the install folder</a>.</strong><br /> + <br /> + You will then be guided through the update process. The update is complete after the database update script has been completed successfully - this is the last step within the udpate process. + </p> + + ', + 'UPDATE_METHOD' => 'Update method', + 'UPDATE_METHOD_EXPLAIN' => 'You are now able to choose your preferred update method. Using the FTP Upload will present you with a form you need to enter your FTP account details into. With this method the files will be automatically moved to the new location and backups of the old files being created by appending .bak to the filename. If you choose to download the modified files you are able to unpack and upload them to their correct location manually later.', + 'UPDATE_SUCCESS' => 'Update was successful', + 'UPDATE_SUCCESS_EXPLAIN' => 'Successfully updated all files. The next step involves checking all files again to make sure the files got updated correctly.', + 'UPDATE_VERSION_OPTIMIZE' => 'Updating version and optimizing tables', + 'UPDATING_DATA' => 'Updating data', + 'UPDATING_TO_LATEST_STABLE' => 'Updating database to latest stable release', + 'UPDATED_VERSION' => 'Updated version', + 'UPLOAD_METHOD' => 'Upload method', + + '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', + + 'WRONG_INFO_FILE_FORMAT' => 'Wrong info file format', +)); + ?>
\ No newline at end of file diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php index 46c9b90418..35f537f9db 100644 --- a/phpBB/language/en/mcp.php +++ b/phpBB/language/en/mcp.php @@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang)) // 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 @@ -45,8 +47,8 @@ $lang = array_merge($lang, array( 'APPROVE_POSTS' => 'Approve posts', 'APPROVE_POSTS_CONFIRM' => 'Are you sure you want to approve the selected posts?', - 'CANNOT_MOVE_SAME_FORUM'=> 'You cannot move a topic to the forum it\'s already in', - 'CANNOT_WARN_ANONYMOUS' => 'You cannot warn an guest user', + 'CANNOT_MOVE_SAME_FORUM'=> 'You cannot move a topic to the forum it’s already in', + 'CANNOT_WARN_ANONYMOUS' => 'You cannot warn unregistered guest users', 'CANNOT_WARN_SELF' => 'You cannot warn yourself', 'CAN_LEAVE_BLANK' => 'This can be left blank.', 'CHANGE_POSTER' => 'Change poster', @@ -55,26 +57,26 @@ $lang = array_merge($lang, array( 'CLOSE_REPORTS' => 'Close reports', 'CLOSE_REPORTS_CONFIRM' => 'Are you sure you want to close the selected 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?', - 'DELETE_REPORT' => 'Delete report', - 'DELETE_REPORT_CONFIRM' => 'Are you sure you want to delete the selected report?', - 'DELETE_REPORTS' => 'Delete 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?', + 'DELETE_REPORT' => 'Delete report', + 'DELETE_REPORT_CONFIRM' => 'Are you sure you want to delete the selected report?', + 'DELETE_REPORTS' => 'Delete reports', 'DELETE_REPORTS_CONFIRM' => 'Are you sure you want to delete the selected reports?', - 'DELETE_TOPICS' => 'Delete selected topics', - 'DELETE_TOPICS_CONFIRM' => 'Are you sure you want to delete these topics?', - 'DELETE_TOPIC_CONFIRM' => 'Are you sure you want to delete this topic?', - 'DISAPPROVE' => 'Disapprove', - 'DISAPPROVE_REASON' => 'Reason for disapproval', - 'DISAPPROVE_POST' => 'Disapprove post', + 'DELETE_TOPICS' => 'Delete selected topics', + 'DELETE_TOPICS_CONFIRM' => 'Are you sure you want to delete these topics?', + 'DELETE_TOPIC_CONFIRM' => 'Are you sure you want to delete this topic?', + 'DISAPPROVE' => 'Disapprove', + 'DISAPPROVE_REASON' => 'Reason for disapproval', + 'DISAPPROVE_POST' => 'Disapprove post', 'DISAPPROVE_POST_CONFIRM' => 'Are you sure you want to disapprove this post?', - 'DISAPPROVE_POSTS' => 'Disapprove posts', + 'DISAPPROVE_POSTS' => 'Disapprove posts', 'DISAPPROVE_POSTS_CONFIRM' => 'Are you sure you want to disapprove the selected posts?', - 'DISPLAY_LOG' => 'Display entries from previous', - 'DISPLAY_OPTIONS' => 'Display options', + 'DISPLAY_LOG' => 'Display entries from previous', + 'DISPLAY_OPTIONS' => 'Display options', - 'EMPTY_REPORT' => 'You must enter a description when selecting this reason', + 'EMPTY_REPORT' => 'You must enter a description when selecting this reason', 'EMPTY_TOPICS_REMOVED_WARNING' => 'Please note that one or several topics have been removed from the database because they were or become empty', 'FEEDBACK' => 'Feedback', @@ -192,114 +194,115 @@ $lang = array_merge($lang, array( 'MOVE_TOPICS' => 'Move selected topics', 'MOVE_TOPICS_CONFIRM' => 'Are you sure you want to move the selected topics into a new forum?', - 'NOTIFY_POSTER_APPROVAL'=> 'Notify poster about approval?', - 'NOTIFY_POSTER_DISAPPROVAL' => 'Notify poster about disapproval?', - 'NOTIFY_USER_WARN' => 'Notify user about warning?', - 'NOT_MODERATOR' => 'You are not a moderator of this forum', - 'NO_DESTINATION_FORUM' => 'Please select a forum for destination', + 'NOTIFY_POSTER_APPROVAL' => 'Notify poster about approval?', + 'NOTIFY_POSTER_DISAPPROVAL' => 'Notify poster about disapproval?', + 'NOTIFY_USER_WARN' => 'Notify user about warning?', + 'NOT_MODERATOR' => 'You are not a moderator of this forum', + 'NO_DESTINATION_FORUM' => 'Please select a forum for destination', 'NO_DESTINATION_FORUM_FOUND' => 'There is no destination forum available.', - 'NO_ENTRIES' => 'No log entries for this period', - 'NO_FEEDBACK' => 'No feedback exists for this user', - 'NO_FINAL_TOPIC_SELECTED' => 'You have to select a destination topic for merging posts', - 'NO_MATCHES_FOUND' => 'No matches found', - 'NO_POST' => 'You have to select a post in order to warn the user for a post', - 'NO_POST_REPORT' => 'This post was not reported.', - 'NO_POST_SELECTED' => 'You must select at least one post to perform this action', - 'NO_REASON_DISAPPROVAL' => 'Please give an appropiate reason for disapproval', - 'NO_TOPIC_ICON' => 'None', - 'NO_TOPIC_SELECTED' => 'You must select at least one topic to perform this action', + 'NO_ENTRIES' => 'No log entries for this period', + 'NO_FEEDBACK' => 'No feedback exists for this user', + 'NO_FINAL_TOPIC_SELECTED' => 'You have to select a destination topic for merging posts', + 'NO_MATCHES_FOUND' => 'No matches found', + 'NO_POST' => 'You have to select a post in order to warn the user for a post', + 'NO_POST_REPORT' => 'This post was not reported.', + 'NO_POST_SELECTED' => 'You must select at least one post to perform this action', + 'NO_REASON_DISAPPROVAL' => 'Please give an appropiate reason for disapproval', + 'NO_TOPIC_ICON' => 'None', + 'NO_TOPIC_SELECTED' => 'You must select at least one topic to perform this action', 'OTHER_IPS' => 'Other IP addresses this user has posted from', 'ONLY_TOPIC' => 'Only topic "%s"', 'OTHER_USERS' => 'Users posting from this IP', - 'POSTER' => 'Poster', - 'POSTS_APPROVED_SUCCESS'=> 'The selected posts have been approved', - 'POSTS_DELETED_SUCCESS' => 'The selected posts have been successfully removed from the database', - 'POSTS_DISAPPROVED_SUCCESS'=> 'The selected posts have been disapproved', - 'POSTS_LOCKED_SUCCESS' => 'The selected posts have been locked successfully', - 'POSTS_MERGED_SUCCESS' => 'The selected posts have been merged', - 'POSTS_UNLOCKED_SUCCESS'=> 'The selected posts have been unlocked successfully', - 'POSTS_PER_PAGE' => 'Posts per page', - 'POSTS_PER_PAGE_EXPLAIN'=> '(Set to 0 to view all posts)', - 'POST_APPROVED_SUCCESS' => 'The selected post has been approved', - 'POST_DELETED_SUCCESS' => 'The selected post has been successfully removed from the database', + 'POSTER' => 'Poster', + 'POSTS_APPROVED_SUCCESS' => 'The selected posts have been approved', + 'POSTS_DELETED_SUCCESS' => 'The selected posts have been successfully removed from the database', + 'POSTS_DISAPPROVED_SUCCESS' => 'The selected posts have been disapproved', + 'POSTS_LOCKED_SUCCESS' => 'The selected posts have been locked successfully', + 'POSTS_MERGED_SUCCESS' => 'The selected posts have been merged', + 'POSTS_UNLOCKED_SUCCESS' => 'The selected posts have been unlocked successfully', + 'POSTS_PER_PAGE' => 'Posts per page', + 'POSTS_PER_PAGE_EXPLAIN' => '(Set to 0 to view all posts)', + 'POST_APPROVED_SUCCESS' => 'The selected post has been approved', + 'POST_DELETED_SUCCESS' => 'The selected post has been successfully removed from the database', 'POST_DISAPPROVED_SUCCESS' => 'The selected post has been disapproved', - 'POST_LOCKED_SUCCESS' => 'Post locked successfully', - 'POST_NOT_EXIST' => 'The post you requested does not exist', - 'POST_REPORTED_SUCCESS' => 'This post has been successfully reported', - 'POST_UNLOCKED_SUCCESS' => 'Post unlocked successfully', - - 'READ_USERNOTES' => 'User notes', - 'READ_WARNINGS' => 'User warnings', - 'REPORTER' => 'Reporter', - 'REPORTED' => 'Reported', - 'REPORTED_BY' => 'Reported by', - 'REPORTED_ON_DATE' => 'on', + 'POST_LOCKED_SUCCESS' => 'Post locked successfully', + 'POST_NOT_EXIST' => 'The post you requested does not exist', + 'POST_REPORTED_SUCCESS' => 'This post has been successfully reported', + 'POST_UNLOCKED_SUCCESS' => 'Post unlocked successfully', + + 'READ_USERNOTES' => 'User notes', + 'READ_WARNINGS' => 'User warnings', + 'REPORTER' => 'Reporter', + 'REPORTED' => 'Reported', + 'REPORTED_BY' => 'Reported by', + 'REPORTED_ON_DATE' => 'on', 'REPORTS_CLOSED_SUCCESS' => 'The selected reports have been closed successfully.', 'REPORTS_DELETED_SUCCESS' => 'The selected reports have been deleted successfully.', - 'REPORTS_TOTAL' => 'In total there are <strong>%d</strong> reports to review', - 'REPORTS_ZERO_TOTAL' => 'There are no reports to review', - 'REPORT_CLOSED' => 'This report has previously been closed.', - 'REPORT_CLOSED_SUCCESS' => 'The selected report has been closed successfully.', + 'REPORTS_TOTAL' => 'In total there are <strong>%d</strong> reports to review', + 'REPORTS_ZERO_TOTAL' => 'There are no reports to review', + 'REPORT_CLOSED' => 'This report has previously been closed.', + 'REPORT_CLOSED_SUCCESS' => 'The selected report has been closed successfully.', '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 to the board administrators. Reporting should generally be used only if the message breaks forum rules.', - '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.', - 'REPORT_REASON' => 'Report reason', - 'REPORT_TIME' => 'Report time', - 'REPORT_TOTAL' => 'In total there is <strong>1</strong> report to review', - 'RESYNC' => 'Resync', - 'RETURN_MESSAGE' => '%sReturn to the message%s', - 'RETURN_NEW_FORUM' => '%sReturn to the new forum%s', - 'RETURN_NEW_TOPIC' => '%sReturn to the new topic%s', - 'RETURN_POST' => '%sReturn to the post%s', - 'RETURN_QUEUE' => '%sReturn to the queue%s', - 'RETURN_REPORTS' => '%sReturn to the reports%s', - - 'SEARCH_POSTS_BY_USER' => 'Search posts by', - 'SELECT_ACTION' => 'Select desired action', - 'SELECT_TOPIC' => 'Select topic', - 'SELECT_USER' => 'Select user', - 'SORT_ACTION' => 'Log action', - 'SORT_DATE' => 'Date', - 'SORT_IP' => 'IP address', - 'SORT_WARNINGS' => 'Warnings', - 'SPLIT_AFTER' => 'Split from selected post', - 'SPLIT_FORUM' => 'Forum for new topic', - 'SPLIT_POSTS' => 'Split selected posts', - 'SPLIT_SUBJECT' => 'New topic title', - 'SPLIT_TOPIC_ALL' => 'Split topic from selected posts', + 'REPORT_DETAILS' => 'Report details', + 'REPORT_MESSAGE' => 'Report this message', + 'REPORT_MESSAGE_EXPLAIN' => 'Use this form to report the selected message to the board administrators. Reporting should generally be used only if the message breaks forum rules.', + '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.', + 'REPORT_REASON' => 'Report reason', + 'REPORT_TIME' => 'Report time', + 'REPORT_TOTAL' => 'In total there is <strong>1</strong> report to review', + 'RESYNC' => 'Resync', + 'RETURN_MESSAGE' => '%sReturn to the message%s', + 'RETURN_NEW_FORUM' => '%sReturn to the new forum%s', + 'RETURN_NEW_TOPIC' => '%sReturn to the new topic%s', + 'RETURN_POST' => '%sReturn to the post%s', + 'RETURN_QUEUE' => '%sReturn to the queue%s', + 'RETURN_REPORTS' => '%sReturn to the reports%s', + + 'SEARCH_POSTS_BY_USER' => 'Search posts by', + 'SELECT_ACTION' => 'Select desired action', + 'SELECT_TOPICS_FROM' => 'Select topics from', + 'SELECT_TOPIC' => 'Select topic', + 'SELECT_USER' => 'Select user', + 'SORT_ACTION' => 'Log action', + 'SORT_DATE' => 'Date', + 'SORT_IP' => 'IP address', + 'SORT_WARNINGS' => 'Warnings', + 'SPLIT_AFTER' => 'Split from selected post', + 'SPLIT_FORUM' => 'Forum for new topic', + 'SPLIT_POSTS' => 'Split selected posts', + 'SPLIT_SUBJECT' => 'New topic title', + 'SPLIT_TOPIC_ALL' => 'Split topic from selected posts', 'SPLIT_TOPIC_ALL_CONFIRM' => 'Are you sure you want to split this topic?', - 'SPLIT_TOPIC_BEYOND' => 'Split topic at selected post', - 'SPLIT_TOPIC_BEYOND_CONFIRM' => 'Are you sure you want to split this topic at the selected post?', - 'SPLIT_TOPIC_EXPLAIN' => 'Using the form below you can split a topic in two, either by selecting the posts individually or by splitting at a selected post', + 'SPLIT_TOPIC_BEYOND' => 'Split topic at selected post', + 'SPLIT_TOPIC_BEYOND_CONFIRM'=> 'Are you sure you want to split this topic at the selected post?', + 'SPLIT_TOPIC_EXPLAIN' => 'Using the form below you can split a topic in two, either by selecting the posts individually or by splitting at a selected post', - 'THIS_POST_IP' => 'IP for this post', + 'THIS_POST_IP' => 'IP for this post', 'TOPICS_APPROVED_SUCCESS' => 'The selected topics have been approved', - 'TOPICS_DELETED_SUCCESS'=> 'The selected topics have been successfully removed from the database', - 'TOPICS_DISAPPROVED_SUCCESS' => 'The selected topics have been disapproved', - 'TOPICS_FORKED_SUCCESS' => 'The selected topics have been copied successfully', - 'TOPICS_LOCKED_SUCCESS' => 'The selected topics have been locked', - 'TOPICS_MOVED_SUCCESS' => 'The selected topics have been moved successfully', - 'TOPICS_RESYNC_SUCCESS' => 'The selected topics have been resynchronised', + 'TOPICS_DELETED_SUCCESS' => 'The selected topics have been successfully removed from the database', + 'TOPICS_DISAPPROVED_SUCCESS'=> 'The selected topics have been disapproved', + 'TOPICS_FORKED_SUCCESS' => 'The selected topics have been copied successfully', + 'TOPICS_LOCKED_SUCCESS' => 'The selected topics have been locked', + 'TOPICS_MOVED_SUCCESS' => 'The selected topics have been moved successfully', + 'TOPICS_RESYNC_SUCCESS' => 'The selected topics have been resynchronised', 'TOPICS_UNLOCKED_SUCCESS' => 'The selected topics have been unlocked', 'TOPIC_APPROVED_SUCCESS' => 'The selected topic has been approved', - 'TOPIC_DELETED_SUCCESS' => 'The selected topic has been successfully removed from the database', + 'TOPIC_DELETED_SUCCESS' => 'The selected topic has been successfully removed from the database', 'TOPIC_DISAPPROVED_SUCCESS' => 'The selected topic has been disapproved', - 'TOPIC_FORKED_SUCCESS' => 'The selected topic has been copied successfully', - 'TOPIC_LOCKED_SUCCESS' => 'The selected topic has been locked', - 'TOPIC_MOVED_SUCCESS' => 'The selected topic has been moved successfully', - 'TOPIC_NOT_EXIST' => 'The topic you selected does not exist', - 'TOPIC_RESYNC_SUCCESS' => 'The selected topic has been resynchronised', - 'TOPIC_SPLIT_SUCCESS' => 'The selected topic has been split successfully', - 'TOPIC_TIME' => 'Topic time', - 'TOPIC_TYPE_CHANGED' => 'Topic type changed successfully.', - 'TOPIC_UNLOCKED_SUCCESS'=> 'The selected topic has been unlocked', - 'TOTAL_WARNINGS' => 'Total Warnings', + 'TOPIC_FORKED_SUCCESS' => 'The selected topic has been copied successfully', + 'TOPIC_LOCKED_SUCCESS' => 'The selected topic has been locked', + 'TOPIC_MOVED_SUCCESS' => 'The selected topic has been moved successfully', + 'TOPIC_NOT_EXIST' => 'The topic you selected does not exist', + 'TOPIC_RESYNC_SUCCESS' => 'The selected topic has been resynchronised', + 'TOPIC_SPLIT_SUCCESS' => 'The selected topic has been split successfully', + 'TOPIC_TIME' => 'Topic time', + 'TOPIC_TYPE_CHANGED' => 'Topic type changed successfully.', + 'TOPIC_UNLOCKED_SUCCESS' => 'The selected topic has been unlocked', + 'TOTAL_WARNINGS' => 'Total Warnings', 'UNAPPROVED_POSTS_TOTAL' => 'In total there are <strong>%d</strong> posts waiting for approval', 'UNAPPROVED_POSTS_ZERO_TOTAL' => 'There are no posts waiting for approval', @@ -317,8 +320,8 @@ $lang = array_merge($lang, array( 'UNLOCK_TOPICS_CONFIRM' => 'Are you sure you want to unlock all selected topics?', 'USER_CANNOT_POST' => 'You cannot post in this forum', 'USER_CANNOT_REPORT' => 'You cannot report posts in this forum', - 'USER_FEEDBACK_ADDED' => 'User feedback added successfully', - 'USER_WARNING_ADDED' => 'User warned successfully', + 'USER_FEEDBACK_ADDED' => 'User feedback added successfully.', + 'USER_WARNING_ADDED' => 'User warned successfully.', 'VIEW_DETAILS' => 'View details', diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php index 37f937edda..b46fe1c621 100644 --- a/phpBB/language/en/memberlist.php +++ b/phpBB/language/en/memberlist.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -34,8 +36,7 @@ $lang = array_merge($lang, array( 'ACTIVE_IN_TOPIC' => 'Most active topic', 'ADD_FOE' => 'Add foe', 'ADD_FRIEND' => 'Add friend', - 'AFTER' => 'After', - 'AIM' => 'AIM', + 'AFTER' => 'After', 'BEFORE' => 'Before', @@ -55,14 +56,13 @@ $lang = array_merge($lang, array( 'EMPTY_SUBJECT_EMAIL' => 'You must specify a subject for the email.', 'EQUAL_TO' => 'Equal to', - 'FIND_USERNAME_EXPLAIN' => 'Use this form to search for specific members. You do not need to fill out all fields. To match partial data use * as a wildcard. When entering dates use the format yyyy-mm-dd, e.g. 2002-01-01. Use the mark checkboxes to select one or more usernames (several usernames may be accepted depending on the form itself) and click the Select Marked button to return to the previous form.', + 'FIND_USERNAME_EXPLAIN' => 'Use this form to search for specific members. You do not need to fill out all fields. To match partial data use * as a wildcard. When entering dates use the format <kbd>YYYY-MM-DD</kbd>, e.g. <samp>2004-02-29</samp>. Use the mark checkboxes to select one or more usernames (several usernames may be accepted depending on the form itself) and click the Select Marked button to return to the previous form.', 'FLOOD_EMAIL_LIMIT' => 'You cannot send another email at this time. Please try again later.', 'GROUP_LEADER' => 'Group leader', 'HIDE_MEMBER_SEARCH' => 'Hide member search', - 'ICQ' => 'ICQ', 'IM_ADD_CONTACT' => 'Add Contact', 'IM_AIM' => 'Please note that you need AOL Instant Messenger installed to use this.', 'IM_AIM_EXPRESS' => 'AIM Express', @@ -72,6 +72,8 @@ $lang = array_merge($lang, array( 'IM_JABBER_SUBJECT' => 'This is an automated message please do not reply! Message from user %1$s at %2$s', '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_NAME' => 'Your Name', 'IM_NO_JABBER' => 'Sorry, direct messaging of Jabber users is not supported on this server. You will need a Jabber client installed on your system to contact the recipient above.', 'IM_RECIPIENT' => 'Recipient', @@ -80,8 +82,6 @@ $lang = array_merge($lang, array( 'IM_SENT_JABBER' => 'Your message to %1$s has been sent successfully.', 'IM_USER' => 'Send an instant message', - 'JABBER' => 'Jabber', - 'LAST_ACTIVE' => 'Last active', 'LESS_THAN' => 'Less than', 'LIST_USER' => '1 user', @@ -98,14 +98,17 @@ $lang = array_merge($lang, array( 'NO_VIEW_USERS' => 'You are not authorised to view the member list or profiles.', 'ORDER' => 'Order', + 'OTHER' => 'Other', 'POST_IP' => 'Posted from IP/domain', 'RANK' => 'Rank', 'REAL_NAME' => 'Recipient name', 'RECIPIENT' => 'Recipient', + 'REMOVE_FOE' => 'Remove foe', + 'REMOVE_FRIEND' => 'Remove friend', - 'SEARCH_USER_POSTS' => 'Search user\'s posts', + 'SEARCH_USER_POSTS' => 'Search user’s posts', 'SELECT_MARKED' => 'Select marked', 'SELECT_SORT_METHOD' => 'Select sort method', 'SEND_IM' => 'Instant messaging', @@ -124,8 +127,6 @@ $lang = array_merge($lang, array( 'VISITED' => 'Last visited', 'WWW' => 'Website', - - 'YIM' => 'YIM', )); ?>
\ No newline at end of file diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index 30ed20d2f2..e0008603bc 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -29,7 +31,7 @@ if (empty($lang) || !is_array($lang)) // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine $lang = array_merge($lang, array( - 'ADD_ATTACHMENT' => 'Attachment uploading', + 'ADD_ATTACHMENT' => 'Upload attachment', 'ADD_ATTACHMENT_EXPLAIN' => 'If you wish to attach one or more files enter the details below', 'ADD_FILE' => 'Add the file', 'ADD_POLL' => 'Poll creation', @@ -53,7 +55,7 @@ $lang = array_merge($lang, array( 'BBCODE_S_HELP' => 'Font color: [color=red]text[/color] Tip: you can also use color=#FF0000', 'BBCODE_U_HELP' => 'Underline text: [u]text[/u] (alt+u)', 'BBCODE_W_HELP' => 'Insert URL: [url]http://url[/url] or [url=http://url]URL text[/url] (alt+w)', - 'BBCODE_D_HELP' => 'Flash: [flash=height,width]http://url[/flash] (alt+d)', + 'BBCODE_D_HELP' => 'Flash: [flash=width,height]http://url[/flash] (alt+d)', 'BUMP_ERROR' => 'You cannot bump this topic so soon after the last post.', 'CANNOT_DELETE_REPLIED' => 'Sorry but you may only delete posts which have not been replied to.', @@ -76,7 +78,7 @@ $lang = array_merge($lang, array( 'DISABLE_MAGIC_URL' => 'Do not automatically parse URLs', 'DISABLE_SMILIES' => 'Disable smilies', 'DISALLOWED_EXTENSION' => 'The extension %s is not allowed', - 'DRAFT_LOADED' => 'Draft loaded into posting area, you may want to finish your post now.<br />Your Draft will be deleted after submitting this post.', + 'DRAFT_LOADED' => 'Draft loaded into posting area, you may want to finish your post now.<br />Your draft will be deleted after submitting this post.', 'DRAFT_SAVED' => 'Draft successfully saved.', 'DRAFT_TITLE' => 'Draft title', @@ -127,8 +129,8 @@ $lang = array_merge($lang, array( 'NO_TOPIC_ICON' => 'None', 'PARTIAL_UPLOAD' => 'The uploaded file was only partially uploaded', - 'PHP_SIZE_NA' => 'The attachment\'s filesize is too large.<br />Could not determine the maximum size defined by PHP in php.ini.', - 'PHP_SIZE_OVERRUN' => 'The attachment\'s filesize is too large, the maximum upload size is %d MB.<br />Please note this is set in php.ini and cannot be overriden.', + 'PHP_SIZE_NA' => 'The attachment’s filesize is too large.<br />Could not determine the maximum size defined by PHP in php.ini.', + 'PHP_SIZE_OVERRUN' => 'The attachment’s filesize is too large, the maximum upload size is %d MB.<br />Please note this is set in php.ini and cannot be overriden.', 'PLACE_INLINE' => 'Place inline', 'POLL_DELETE' => 'Delete poll', 'POLL_FOR' => 'Run poll for', @@ -187,13 +189,13 @@ $lang = array_merge($lang, array( 'UPDATE_COMMENT' => 'Update comment', 'URL_INVALID' => 'The URL you specified is invalid.', 'URL_NOT_FOUND' => 'The file specified could not be found.', + 'URL_IS_OFF' => '[url] is <em>OFF</em>', + 'URL_IS_ON' => '[url] is <em>ON</em>', 'USER_CANNOT_BUMP' => 'You cannot bump topics in this forum', 'USER_CANNOT_DELETE' => 'You cannot delete posts in this forum', 'USER_CANNOT_EDIT' => 'You cannot edit posts in this forum', 'USER_CANNOT_REPLY' => 'You cannot reply in this forum', 'USER_CANNOT_FORUM_POST' => 'You are not able to do posting operations on this forum due to the forum type not supporting it.', - 'USERNAME_DISALLOWED' => 'The username you entered has been banned.', - 'USERNAME_TAKEN' => 'The username you entered is already in use, please select an alternative.', 'VIEW_MESSAGE' => '%sView your submitted message%s', diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php index 25d0000bb8..db922f340b 100644 --- a/phpBB/language/en/search.php +++ b/phpBB/language/en/search.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 @@ -34,14 +36,14 @@ $lang = array_merge($lang, array( 'DISPLAY_RESULTS' => 'Display results as', - 'FOUND_SEARCH_MATCH' => 'Search found %d match', - 'FOUND_SEARCH_MATCHES' => 'Search found %d matches', + 'FOUND_SEARCH_MATCH' => 'Search found %d match', + 'FOUND_SEARCH_MATCHES' => 'Search found %d matches', 'FOUND_MORE_SEARCH_MATCHES' => 'Search found more than %d matches', - 'GLOBAL' => 'Global topic', + 'GLOBAL' => 'Global announcement', 'IGNORED_TERMS' => 'ignored', - 'IGNORED_TERMS_EXPLAIN' => 'The following words in your search query were ignored: <b>%s</b>', + 'IGNORED_TERMS_EXPLAIN' => 'The following words in your search query were ignored: <strong>%s</strong>', 'NO_KEYWORDS' => 'You must specify at least one word to search for. Each word must consist of at least %d characters and must not contain more than %d characters excluding wildcards.', 'NO_RECENT_SEARCHES' => 'No searches have been carried out recently', @@ -58,30 +60,30 @@ $lang = array_merge($lang, array( 'RESULT_SORT' => 'Sort results by', 'RETURN_FIRST' => 'Return first', - 'SEARCHED_FOR' => 'Search term used', - 'SEARCHED_TOPIC' => 'Searched topic', - 'SEARCH_ALL_TERMS' => 'Search for all terms or use query as entered', - 'SEARCH_ANY_TERMS' => 'Search for any terms', - 'SEARCH_AUTHOR' => 'Search for author', - 'SEARCH_AUTHOR_EXPLAIN' => 'Use * as a wildcard for partial matches', - 'SEARCH_FIRST_POST' => 'First post of topics only', - 'SEARCH_FORUMS' => 'Search in forums', - 'SEARCH_FORUMS_EXPLAIN' => 'Select the forum or forums you wish to search in. For speed all subforums can be searched by selecting the parent and setting enable search subforums below.', - 'SEARCH_IN_RESULTS' => 'Search these results', + 'SEARCHED_FOR' => 'Search term used', + 'SEARCHED_TOPIC' => 'Searched topic', + 'SEARCH_ALL_TERMS' => 'Search for all terms or use query as entered', + 'SEARCH_ANY_TERMS' => 'Search for any terms', + 'SEARCH_AUTHOR' => 'Search for author', + 'SEARCH_AUTHOR_EXPLAIN' => 'Use * as a wildcard for partial matches', + 'SEARCH_FIRST_POST' => 'First post of topics only', + 'SEARCH_FORUMS' => 'Search in forums', + 'SEARCH_FORUMS_EXPLAIN' => 'Select the forum or forums you wish to search in. For speed all subforums can be searched by selecting the parent and setting enable search subforums below.', + 'SEARCH_IN_RESULTS' => 'Search these results', 'SEARCH_KEYWORDS_EXPLAIN' => 'Place <strong>+</strong> in front of a word which must be found and <strong>-</strong> in front of a word which must not be found. Put a list of words seperated by <strong>|</strong> into brackets if only one of the words must be found. Use * as a wildcard for partial matches.', - 'SEARCH_MSG_ONLY' => 'Message text only', - 'SEARCH_OPTIONS' => 'Search Options', - 'SEARCH_QUERY' => 'Search Query', - 'SEARCH_SUBFORUMS' => 'Search subforums', - 'SEARCH_TITLE_MSG' => 'Post subjects and message text', - 'SEARCH_TITLE_ONLY' => 'Topic titles only', - 'SEARCH_WITHIN' => 'Search within', - 'SORT_ASCENDING' => 'Ascending', - 'SORT_AUTHOR' => 'Author', - 'SORT_DESCENDING' => 'Descending', - 'SORT_FORUM' => 'Forum', - 'SORT_POST_SUBJECT' => 'Post subject', - 'SORT_TIME' => 'Post time', + 'SEARCH_MSG_ONLY' => 'Message text only', + 'SEARCH_OPTIONS' => 'Search Options', + 'SEARCH_QUERY' => 'Search Query', + 'SEARCH_SUBFORUMS' => 'Search subforums', + 'SEARCH_TITLE_MSG' => 'Post subjects and message text', + 'SEARCH_TITLE_ONLY' => 'Topic titles only', + 'SEARCH_WITHIN' => 'Search within', + 'SORT_ASCENDING' => 'Ascending', + 'SORT_AUTHOR' => 'Author', + 'SORT_DESCENDING' => 'Descending', + 'SORT_FORUM' => 'Forum', + 'SORT_POST_SUBJECT' => 'Post subject', + 'SORT_TIME' => 'Post time', 'TOO_FEW_AUTHOR_CHARS' => 'You must specify at least %d characters of the authors name.', )); diff --git a/phpBB/language/en/search_ignore_words.php b/phpBB/language/en/search_ignore_words.php index 0ef17669fa..63dfca8354 100644 --- a/phpBB/language/en/search_ignore_words.php +++ b/phpBB/language/en/search_ignore_words.php @@ -263,4 +263,5 @@ $words = array( 'ROTFLMAO', 'YMMV', ); -
\ No newline at end of file + +?>
\ No newline at end of file diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 679857fabd..9d51c0d7bb 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang)) // 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 @@ -30,38 +32,38 @@ if (empty($lang) || !is_array($lang)) // Privacy policy and T&C $lang = array_merge($lang, array( - 'TERMS_OF_USE_CONTENT' => 'By accessing "%1$s" (hereinafter "we", "us", "our", "%1$s", "%2$s"), you agree to be legally bound by the following terms. If you do not agree to be legally bound by all of the following terms then please do not access and/or use "%1$s". We may change these at any time and we\'ll do our utmost in informing you, though it would be prudent to review this regularly yourself as your continued usage of "%1$s" after changes mean you agree to be legally bound by these terms as they are updated and/or amended.<br /> + 'TERMS_OF_USE_CONTENT' => 'By accessing “%1$s†(hereinafter “weâ€, “usâ€, “ourâ€, “%1$sâ€, “%2$sâ€), you agree to be legally bound by the following terms. If you do not agree to be legally bound by all of the following terms then please do not access and/or use “%1$sâ€. We may change these at any time and we’ll do our utmost in informing you, though it would be prudent to review this regularly yourself as your continued usage of “%1$s†after changes mean you agree to be legally bound by these terms as they are updated and/or amended.<br /> <br /> - Our forums are powered by phpBB (hereinafter "they", "them", "their", "phpBB software", "www.phpbb.com", "phpBB Group", "phpBB Teams") which is a bulletin board solution released under the "<a href="http://www.gnu.org/licenses/gpl.html">General Public License</a>" (hereinafter "GPL") and can be downloaded from <a href="http://www.phpbb.com/">www.phpbb.com</a>. The phpBB software only facilitates Internet based discussions and the GPL strictly forbids them in what we allow and/or disallow as permissible content and/or conduct. For further information about phpBB, please see: <a href="http://www.phpbb.com/">http://www.phpbb.com/</a>.<br /> + Our forums are powered by phpBB (hereinafter “theyâ€, “themâ€, “theirâ€, “phpBB softwareâ€, “www.phpbb.comâ€, “phpBB Groupâ€, “phpBB Teamsâ€) which is a bulletin board solution released under the “<a href="http://www.gnu.org/licenses/gpl.html">General Public License</a>†(hereinafter “GPLâ€) and can be downloaded from <a href="http://www.phpbb.com/">www.phpbb.com</a>. The phpBB software only facilitates Internet based discussions and the GPL strictly forbids them in what we allow and/or disallow as permissible content and/or conduct. For further information about phpBB, please see: <a href="http://www.phpbb.com/">http://www.phpbb.com/</a>.<br /> <br /> - You agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate any laws be it of your country, the country where "%1$s" is hosted or International Law. Doing so may lead to you being immediately and permanently banned, with notification of your Internet Service Provider if deemed required by us. The IP address of all posts are recorded to aid in enforcing these conditions. You agree that "%1$s" have the right to remove, edit, move or close any topic at any time should we see fit. As a user you agree to any information you have entered to being stored in a database. While this information will not be disclosed to any third party without your consent, neither "%1$s" nor phpBB shall be held responsible for any hacking attempt that may lead to the data being compromised. + You agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate any laws be it of your country, the country where “%1$s†is hosted or International Law. Doing so may lead to you being immediately and permanently banned, with notification of your Internet Service Provider if deemed required by us. The IP address of all posts are recorded to aid in enforcing these conditions. You agree that “%1$s†have the right to remove, edit, move or close any topic at any time should we see fit. As a user you agree to any information you have entered to being stored in a database. While this information will not be disclosed to any third party without your consent, neither “%1$s†nor phpBB shall be held responsible for any hacking attempt that may lead to the data being compromised. ', - 'PRIVACY_POLICY' => 'This policy explains in detail how "%1$s" along with its affiliated companies (hereinafter "we", "us", "our", "%1$s", "%2$s") and phpBB (hereinafter "they", "them", "their", "phpBB software", "www.phpbb.com", "phpBB Group", "phpBB Teams") use any information collected during any session of usage by you (hereinafter "your information").<br /> + 'PRIVACY_POLICY' => 'This policy explains in detail how “%1$s†along with its affiliated companies (hereinafter “weâ€, “usâ€, “ourâ€, “%1$sâ€, “%2$sâ€) and phpBB (hereinafter “theyâ€, “themâ€, “theirâ€, “phpBB softwareâ€, “www.phpbb.comâ€, “phpBB Groupâ€, “phpBB Teamsâ€) use any information collected during any session of usage by you (hereinafter “your informationâ€).<br /> <br /> - Your information is collected via two ways. Firstly, by browsing "%1$s" will cause the phpBB software to create a number of cookies, which are small text files that are downloaded on to your computer\'s web browser temporary files. The first two cookies just contain a user identifier (hereinafter "user-id") and an anonymous session identifier (hereinafter "session-id"), automatically assigned to you by the phpBB software. A third cookie will be created once you have browsed topics within "%1$s" and is used to store which topics have been read, thereby improving your user experience.<br /> + Your information is collected via two ways. Firstly, by browsing “%1$s†will cause the phpBB software to create a number of cookies, which are small text files that are downloaded on to your computer’s web browser temporary files. The first two cookies just contain a user identifier (hereinafter “user-idâ€) and an anonymous session identifier (hereinafter “session-idâ€), automatically assigned to you by the phpBB software. A third cookie will be created once you have browsed topics within “%1$s†and is used to store which topics have been read, thereby improving your user experience.<br /> <br /> - We may also create cookies external to the phpBB software whilst browsing "%1$s", though these are outside the scope of this document which is intended to only cover the pages created by the phpBB software. The second way in which we collect your information is by what you submit to us. This can be, and is not limited to: posting as an anonymous user (hereinafter "anonymous posts"), registering on "%1$s" (hereinafter "your account") and posts submitted by you after registration and whilst logged in (hereinafter "your posts").<br /> + We may also create cookies external to the phpBB software whilst browsing “%1$sâ€, though these are outside the scope of this document which is intended to only cover the pages created by the phpBB software. The second way in which we collect your information is by what you submit to us. This can be, and is not limited to: posting as an anonymous user (hereinafter “anonymous postsâ€), registering on “%1$s†(hereinafter “your accountâ€) and posts submitted by you after registration and whilst logged in (hereinafter “your postsâ€).<br /> <br /> - Your account will at a bare minimum contain a uniquely identifiable name (hereinafter "your user name"), a personal password used for logging into your account (hereinafter "your password") and a personal, valid email address (hereinafter "your email"). Your information for your account at "%1$s" is protected by data-protection laws applicable in the country that hosts us. Any information beyond your user name, your password and your email required by "%1$s" during the registration process are at our digression what is mandatory and what is optional. In all cases, you have the option of what information in your account is publicly displayed. Furthermore, within your account, you have the option to opt-in or opt-out of automatically generated emails from the phpBB software.<br /> + Your account will at a bare minimum contain a uniquely identifiable name (hereinafter “your user nameâ€), a personal password used for logging into your account (hereinafter “your passwordâ€) and a personal, valid email address (hereinafter “your emailâ€). Your information for your account at “%1$s†is protected by data-protection laws applicable in the country that hosts us. Any information beyond your user name, your password and your email required by “%1$s†during the registration process are at our digression what is mandatory and what is optional. In all cases, you have the option of what information in your account is publicly displayed. Furthermore, within your account, you have the option to opt-in or opt-out of automatically generated emails from the phpBB software.<br /> <br /> - Your password is ciphered (a one-way hash) so that it is secure. However, it is recommended that you do not reuse the same password across a number of different websites. Your password is the means of accessing your account at "%1$s", so please guard it carefully and under no circumstance will anyone affiliated with "%1$s", phpBB or another 3rd party, legitimately ask you for your password. Should you forget your password for your account, you can use the "I forgot my password" feature provided by the phpBB software. This process will ask you to submit your user name and your email, then the phpBB software will generate a new password to reclaim your account.<br /> + Your password is ciphered (a one-way hash) so that it is secure. However, it is recommended that you do not reuse the same password across a number of different websites. Your password is the means of accessing your account at “%1$sâ€, so please guard it carefully and under no circumstance will anyone affiliated with “%1$sâ€, phpBB or another 3rd party, legitimately ask you for your password. Should you forget your password for your account, you can use the “I forgot my password†feature provided by the phpBB software. This process will ask you to submit your user name and your email, then the phpBB software will generate a new password to reclaim your account.<br /> ', )); $lang = array_merge($lang, array( 'CAPTCHA' =>array( 'cells' => array( - 'Enter the code on', - ' the right, in ', - ' the order shown ', - ' on the left ', + 'Enter the code on', + ' the right, in ', + ' the order shown ', + ' on the left ', ), 'shape' => array( - 'Enter the code on', - ' the right which ', - 'matches the image', - ' on the left ', + 'Enter the code on', + ' the right which ', + 'matches the image', + ' on the left ', ) ) )); @@ -91,8 +93,8 @@ $lang = array_merge($lang, array( 'ALLOW_PM_EXPLAIN' => 'Note that admins and moderators will always be able to send you messages.', 'ALREADY_ACTIVATED' => 'You have already activated your account', 'ATTACHMENTS_EXPLAIN' => 'This is a list of attachements you have made in posts to this forum.', - 'ATTACHMENTS_DELETED' => 'Attachments successfully deleted', - 'ATTACHMENT_DELETED' => 'Attachment successfully deleted', + 'ATTACHMENTS_DELETED' => 'Attachments successfully deleted.', + 'ATTACHMENT_DELETED' => 'Attachment successfully deleted.', 'AVATAR_CATEGORY' => 'Category', 'AVATAR_EXPLAIN' => 'Maximum dimensions; width %1$d pixels, height %2$d pixels, filesize %3$dkB.', 'AVATAR_GALLERY' => 'Local gallery', @@ -104,7 +106,7 @@ $lang = array_merge($lang, array( 'BIRTHDAY' => 'Birthday', 'BIRTHDAY_EXPLAIN' => 'Setting a year will list your age when it is your birthday.', 'BOARD_DATE_FORMAT' => 'My date format', - 'BOARD_DATE_FORMAT_EXPLAIN' => 'The syntax used is identical to the PHP <a href="http://www.php.net/date" onclick="this.target=\'_blank\';" title="Opens in a new window">date()</a> function', + 'BOARD_DATE_FORMAT_EXPLAIN' => 'The syntax used is identical to the PHP <a href="http://www.php.net/date">date()</a> function', 'BOARD_DST' => 'Daylight Saving Time is in effect', 'BOARD_LANGUAGE' => 'My language', 'BOARD_STYLE' => 'My board style', @@ -118,9 +120,9 @@ $lang = array_merge($lang, array( 'CANNOT_MOVE_TO_SAME_FOLDER'=> 'Messages can not be moved to the folder you want to remove.', 'CANNOT_RENAME_FOLDER' => 'This folder can not be renamed.', 'CANNOT_REMOVE_FOLDER' => 'This folder can not be removed.', + 'CHANGE_DEFAULT_GROUP' => 'Change default group', 'CHANGE_PASSWORD' => 'Change password', - 'CHANGE_PASSWORD_EXPLAIN' => 'Must be between %1$d and %2$d characters.', - 'CLICK_RETURN_FOLDER' => '%1$sReturn to your "%3$s" folder%2$s', + 'CLICK_RETURN_FOLDER' => '%1$sReturn to your “%3$s†folder%2$s', 'CONFIRMATION' => 'Confirmation of registration', 'CONFIRM_EMAIL' => 'Confirm email address', 'CONFIRM_EMAIL_EXPLAIN' => 'You only need to specify this if you are changing your email address.', @@ -130,12 +132,12 @@ $lang = array_merge($lang, array( 'COPPA_BIRTHDAY' => 'To continue with the registration procedure please tell us when you were born.', 'COPPA_COMPLIANCE' => 'COPPA compliance', 'COPPA_EXPLAIN' => 'Please note that clicking submit will create your account. However it cannot be activated until a parent or guardian approves your registration. You will be emailed a copy of the necessary form with details of where to send it.', - 'CREATE_FOLDER' => 'Add folder...', + 'CREATE_FOLDER' => 'Add folder…', 'CURRENT_IMAGE' => 'Current image', 'CURRENT_PASSWORD' => 'Current password', 'CURRENT_PASSWORD_EXPLAIN' => 'You must confirm your current password if you wish to change it, alter your email address or username.', 'CUR_PASSWORD_ERROR' => 'The current password you entered is incorrect.', - 'CUSTOM_DATEFORMAT' => 'Custom...', + 'CUSTOM_DATEFORMAT' => 'Custom…', 'DEFAULT_ACTION' => 'Default action', 'DEFAULT_ACTION_EXPLAIN' => 'This action will be triggered if none of the above is applicable', @@ -162,6 +164,7 @@ $lang = array_merge($lang, array( 'DEMOTE_SELECTED' => 'Demote selected', 'DISABLE_CENSORS' => 'Enable word censoring', 'DISPLAY_GALLERY' => 'Display gallery', + 'DOMAIN_NO_MX_RECORD_EMAIL' => 'The entered email domain has no valid MX record.', 'DOWNLOADS' => 'Downloads', 'DRAFTS_DELETED' => 'All selected drafts were successfully deleted.', 'DRAFTS_EXPLAIN' => 'Here you can view, edit and delete your saved drafts.', @@ -181,15 +184,15 @@ $lang = array_merge($lang, array( 'EXPORT_AS_MSG' => 'Export as MSG', 'EXPORT_FOLDER' => 'Export Folder', - 'FIELD_REQUIRED' => 'The field "%s" must be completed.', - 'FIELD_TOO_SHORT' => 'The field "%1$s" is too short, a minimum of %2$d characters is required.', - 'FIELD_TOO_LONG' => 'The field "%1$s" is too long, a maximum of %2$d characters is allowed.', - 'FIELD_TOO_SMALL' => 'The value of "%1$s" is too small, a minimum value of %2$d is required.', - 'FIELD_TOO_LARGE' => 'The value of "%1$s" is too large, a maximum value of %2$d is allowed.', - 'FIELD_INVALID_CHARS_NUMBERS_ONLY' => 'The field "%s" has invalid characters, only numbers are allowed.', - 'FIELD_INVALID_CHARS_ALPHA_ONLY' => 'The field "%s" has invalid characters, only alphanumeric characters are allowed.', - 'FIELD_INVALID_CHARS_SPACERS_ONLY' => 'The field "%s" has invalid characters, only alphanumeric, space or -+_[] characters are allowed.', - 'FIELD_INVALID_DATE' => 'The field "%s" has an invalid date.', + 'FIELD_REQUIRED' => 'The field “%s†must be completed.', + 'FIELD_TOO_SHORT' => 'The field “%1$s†is too short, a minimum of %2$d characters is required.', + 'FIELD_TOO_LONG' => 'The field “%1$s†is too long, a maximum of %2$d characters is allowed.', + 'FIELD_TOO_SMALL' => 'The value of “%1$s†is too small, a minimum value of %2$d is required.', + 'FIELD_TOO_LARGE' => 'The value of “%1$s†is too large, a maximum value of %2$d is allowed.', + 'FIELD_INVALID_CHARS_NUMBERS_ONLY' => 'The field “%s†has invalid characters, only numbers are allowed.', + 'FIELD_INVALID_CHARS_ALPHA_ONLY' => 'The field “%s†has invalid characters, only alphanumeric characters are allowed.', + 'FIELD_INVALID_CHARS_SPACERS_ONLY' => 'The field “%s†has invalid characters, only alphanumeric, space or -+_[] characters are allowed.', + 'FIELD_INVALID_DATE' => 'The field “%s†has an invalid date.', 'FOE_MESSAGE' => 'Message from foe', 'FOES_EXPLAIN' => 'Foes are users which will be ignored by default. Posts by these users will not be fully visible and personal messages will not be permitted. Please note that you cannot ignore moderators or administrators.', @@ -224,6 +227,8 @@ $lang = array_merge($lang, array( 'IF_FOLDER_FULL' => 'If folder is full', 'IMPORTANT_NEWS' => 'Important announcements', + 'INVALID_CHARS_USERNAME' => 'The username contains forbidden characters.', + 'INVALID_CHARS_NEW_PASSWORD'=> 'The password does not contain the required characters.', 'ITEMS_REQUIRED' => 'The items marked with * are required profile fields and need to be filled out', 'JOIN_SELECTED' => 'Join selected', @@ -237,50 +242,49 @@ $lang = array_merge($lang, array( 'LOGIN_REDIRECT' => 'You have been successfully logged in.', 'LOGOUT_REDIRECT' => 'You have been successfully logged out.', - 'MARK_IMPORTANT' => 'Mark as important', - 'MARKED_MESSAGE' => 'Marked message', - 'MAX_FOLDER_REACHED' => 'Maximum number of allowed user defined folder reached', - 'MESSAGE_BY_AUTHOR' => 'by', - 'MESSAGE_COLOURS' => 'Message colours', - 'MESSAGE_DELETED' => 'Message successfully deleted', - 'MESSAGE_HISTORY' => 'Message history', - 'MESSAGE_REMOVED_FROM_OUTBOX' => 'This message has been removed by it\'s author before it was delivered', - 'MESSAGE_SENT_ON' => 'on', - 'MESSAGE_STORED' => 'Your message has been sent successfully', - 'MESSAGE_TO' => 'To', - 'MESSAGES_DELETED' => 'Messages successfully deleted', - 'MOVE_DELETED_MESSAGES_TO' => 'Move messages from removed folder to', - 'MOVE_DOWN' => 'Move down', - 'MOVE_MARKED_TO_FOLDER' => 'Move marked to %s', - 'MOVE_PM_ERROR' => 'An error occurred while moving the messages to the new folder, only %1d from %2d messages were moved.', - 'MOVE_TO_FOLDER' => 'Move to Folder', - 'MOVE_UP' => 'Move up', - - 'NEW_EMAIL_ERROR' => 'The email addresses you entered do not match.', - 'NEW_FOLDER_NAME' => 'New folder name', - 'NEW_PASSWORD' => 'Password', - 'NEW_PASSWORD_ERROR' => 'The passwords you entered do not match.', - 'NEW_PASSWORD_EXPLAIN' => 'Must be between %1$d and %2$d characters.', - 'NOTIFY_METHOD' => 'Notification method', - 'NOTIFY_METHOD_BOTH' => 'Both', - 'NOTIFY_METHOD_EMAIL' => 'Email only', - 'NOTIFY_METHOD_EXPLAIN' => 'Method for sending messages sent via this board.', - 'NOTIFY_METHOD_IM' => 'Jabber only', - 'NOTIFY_ON_PM' => 'Email me on new private messages', + 'MARK_IMPORTANT' => 'Mark as important', + 'MARKED_MESSAGE' => 'Marked message', + 'MAX_FOLDER_REACHED' => 'Maximum number of allowed user defined folder reached', + 'MESSAGE_BY_AUTHOR' => 'by', + 'MESSAGE_COLOURS' => 'Message colours', + 'MESSAGE_DELETED' => 'Message successfully deleted', + 'MESSAGE_HISTORY' => 'Message history', + 'MESSAGE_REMOVED_FROM_OUTBOX' => 'This message has been removed by it’s author before it was delivered', + 'MESSAGE_SENT_ON' => 'on', + 'MESSAGE_STORED' => 'Your message has been sent successfully', + 'MESSAGE_TO' => 'To', + 'MESSAGES_DELETED' => 'Messages successfully deleted', + 'MOVE_DELETED_MESSAGES_TO' => 'Move messages from removed folder to', + 'MOVE_DOWN' => 'Move down', + 'MOVE_MARKED_TO_FOLDER' => 'Move marked to %s', + 'MOVE_PM_ERROR' => 'An error occurred while moving the messages to the new folder, only %1d from %2d messages were moved.', + 'MOVE_TO_FOLDER' => 'Move to Folder', + 'MOVE_UP' => 'Move up', + + 'NEW_EMAIL_ERROR' => 'The email addresses you entered do not match.', + 'NEW_FOLDER_NAME' => 'New folder name', + 'NEW_PASSWORD' => 'Password', + 'NEW_PASSWORD_ERROR' => 'The passwords you entered do not match.', + 'NOTIFY_METHOD' => 'Notification method', + 'NOTIFY_METHOD_BOTH' => 'Both', + 'NOTIFY_METHOD_EMAIL' => 'Email only', + 'NOTIFY_METHOD_EXPLAIN' => 'Method for sending messages sent via this board.', + '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_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_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', - 'NOT_ENOUGH_SPACE_FOLDER' => 'The destination folder "%s" seems to be full. The requested action has not been taken.', - 'NOT_MOVED_MESSAGE' => 'You have 1 private message currently on hold because of full folder.', - 'NOT_MOVED_MESSAGES' => 'You have %d private messages currently on hold because of full folder.', - 'NO_ACTION_MODE' => 'No message action specified', - 'NO_AUTHOR' => 'No author defined for this message', - 'NO_AVATAR_CATEGORY' => 'None', + '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_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', + 'NOT_ENOUGH_SPACE_FOLDER' => 'The destination folder “%s†seems to be full. The requested action has not been taken.', + 'NOT_MOVED_MESSAGE' => 'You have 1 private message currently on hold because of full folder.', + 'NOT_MOVED_MESSAGES' => 'You have %d private messages currently on hold because of full folder.', + 'NO_ACTION_MODE' => 'No message action specified.', + 'NO_AUTHOR' => 'No author defined for this message', + 'NO_AVATAR_CATEGORY' => 'None', 'NO_AUTH_DELETE_MESSAGE' => 'You are not authorised to delete private messages.', 'NO_AUTH_EDIT_MESSAGE' => 'You are not authorised to edit private messages.', @@ -312,12 +316,17 @@ $lang = array_merge($lang, array( 'NO_WATCHED_FORUMS' => 'You are not watching any forums.', 'NO_WATCHED_TOPICS' => 'You are not watching any topics.', + 'PASS_TYPE_ALPHA_EXPLAIN' => 'Password must be between %1$d and %2$d chars long and must contain alphanumerics', + 'PASS_TYPE_ANY_EXPLAIN' => 'Must be between %1$d and %2$d characters.', + 'PASS_TYPE_CASE_EXPLAIN' => 'Password must be between %1$d and %2$d chars long and must be mixed case', + 'PASS_TYPE_SYMBOL_EXPLAIN' => 'Password must be between %1$d and %2$d chars long and must contain symbols', 'PASSWORD_ACTIVATED' => 'Your new password has been activated', 'PASSWORD_UPDATED' => 'Your password has been sent successfully to your original email address.', 'PERMISSIONS_RESTORED' => 'Successfully restored original permissions.', 'PERMISSIONS_TRANSFERED' => 'Successfully transfered permissions from <strong>%s</strong>, you are now able to browse the forum with the users permissions.<br />Please note that admin permissions were not transfered. You are able to revert to your permission set at any time.', 'PM_DISABLED' => 'Private messaging has been disabled on this board', 'PM_FROM' => 'From', + 'PM_FROM_REMOVED_AUTHOR' => 'This message was sent by a user no longer registered.', 'PM_ICON' => 'PM icon', 'PM_INBOX' => 'Inbox', 'PM_OUTBOX' => 'Outbox', @@ -337,28 +346,29 @@ $lang = array_merge($lang, array( 'PROFILE_INFO_NOTICE' => 'Please note that this information will be viewable to other members. Be careful when including any personal details. Any fields marked with a * must be completed.', 'PROFILE_UPDATED' => 'Your profile has been updated.', - 'RECIPIENT' => 'Recipient', - 'RECIPIENTS' => 'Recipients', - 'REGISTRATION' => 'Registration', - 'RELATIVE_DAYS' => 'Relative days', - 'RELEASE_MESSAGES' => '%sRelease all on-hold messages%s... they will be re-sorted into the appropiate folder if enough space is made available.', - 'REMOVE_ADDRESS' => 'Remove address', - 'REMOVE_SELECTED_BOOKMARKS' => 'Remove selected bookmarks', - 'REMOVE_SELECTED_BOOKMARKS_CONFIRM' => 'Are you sure you want to delete all selected bookmarks?', - 'REMOVE_BOOKMARK_MARKED' => 'Remove marked bookmarks', - 'REMOVE_FOLDER' => 'Remove folder', - 'REMOVE_FOLDER_CONFIRM' => 'Are you sure you want to remove this folder?', - 'RENAME' => 'Rename', - 'RENAME_FOLDER' => 'Rename folder', - 'REPLIED_MESSAGE' => 'Replied to message', - 'RESIGN_SELECTED' => 'Resign selected', - 'RETURN_FOLDER' => '%1$sReturn to previous folder%2$s', - 'RETURN_UCP' => '%sReturn to the User Control Panel%s', - 'RULE_ADDED' => 'Rule successfully added', - 'RULE_ALREADY_DEFINED' => 'This rule was defined previously', - 'RULE_DELETED' => 'Rule successfully removed', - 'RULE_NOT_DEFINED' => 'Rule not correctly specified', - + 'RECIPIENT' => 'Recipient', + 'RECIPIENTS' => 'Recipients', + 'REGISTRATION' => 'Registration', + 'RELATIVE_DAYS' => 'Relative days', + 'RELEASE_MESSAGES' => '%sRelease all on-hold messages%s… they will be re-sorted into the appropiate folder if enough space is made available.', + 'REMOVE_ADDRESS' => 'Remove address', + 'REMOVE_SELECTED_BOOKMARKS' => 'Remove selected bookmarks', + 'REMOVE_SELECTED_BOOKMARKS_CONFIRM' => 'Are you sure you want to delete all selected bookmarks?', + 'REMOVE_BOOKMARK_MARKED' => 'Remove marked bookmarks', + 'REMOVE_FOLDER' => 'Remove folder', + 'REMOVE_FOLDER_CONFIRM' => 'Are you sure you want to remove this folder?', + 'RENAME' => 'Rename', + 'RENAME_FOLDER' => 'Rename folder', + 'REPLIED_MESSAGE' => 'Replied to message', + 'RESIGN_SELECTED' => 'Resign selected', + 'RETURN_FOLDER' => '%1$sReturn to previous folder%2$s', + 'RETURN_UCP' => '%sReturn to the User Control Panel%s', + 'RULE_ADDED' => 'Rule successfully added', + 'RULE_ALREADY_DEFINED' => 'This rule was defined previously', + 'RULE_DELETED' => 'Rule successfully removed', + 'RULE_NOT_DEFINED' => 'Rule not correctly specified', + + 'SAME_PASSWORD_ERROR' => 'The new password you entered is the same as your current password', 'SEARCH_YOUR_POSTS' => 'Show your posts', 'SEND_PASSWORD' => 'Send password', 'SENT_AT' => 'Sent at', @@ -371,7 +381,7 @@ $lang = array_merge($lang, array( 'SORT_DOWNLOADS' => 'Downloads', 'SORT_EXTENSION' => 'Extension', 'SORT_FILENAME' => 'Filename', - 'SORT_POST_TIME' => 'Post Time', + 'SORT_POST_TIME' => 'Post time', 'SORT_SIZE' => 'Filesize', 'TIMEZONE' => 'Timezone', @@ -391,36 +401,37 @@ $lang = array_merge($lang, array( 'UCP_JABBER' => 'Jabber address', 'UCP_MAIN' => 'Overview', - 'UCP_MAIN_BOOKMARKS' => 'Bookmarks', - 'UCP_MAIN_DRAFTS' => 'Saved drafts', + 'UCP_MAIN_ATTACHMENTS' => 'Manage attachments', + 'UCP_MAIN_BOOKMARKS' => 'Manage bookmarks', + 'UCP_MAIN_DRAFTS' => 'Manage drafts', 'UCP_MAIN_FRONT' => 'Front page', - 'UCP_MAIN_SUBSCRIBED' => 'Subscribed', + 'UCP_MAIN_SUBSCRIBED' => 'Manage subscriptions', 'UCP_MSNM' => 'MSN Messenger', 'UCP_NO_ATTACHMENTS' => 'You have posted no files', 'UCP_PREFS' => 'Forum preferences', - 'UCP_PREFS_PERSONAL' => 'Personal settings', - 'UCP_PREFS_POST' => 'Posting messages', - 'UCP_PREFS_VIEW' => 'Viewing posts', + 'UCP_PREFS_PERSONAL' => 'Edit global settings', + 'UCP_PREFS_POST' => 'Edit posting defaults', + 'UCP_PREFS_VIEW' => 'Edit display options', 'UCP_PM' => 'Private messages', 'UCP_PM_COMPOSE' => 'Compose message', - 'UCP_PM_DRAFTS' => 'PM drafts', - 'UCP_PM_OPTIONS' => 'Options', + 'UCP_PM_DRAFTS' => 'Manage PM drafts', + 'UCP_PM_OPTIONS' => 'Edit options', 'UCP_PM_POPUP' => 'Private messages', 'UCP_PM_POPUP_TITLE' => 'Private message popup', 'UCP_PM_UNREAD' => 'Unread messages', 'UCP_PM_VIEW' => 'View messages', 'UCP_PROFILE' => 'Profile', - 'UCP_PROFILE_AVATAR' => 'Your avatar', - 'UCP_PROFILE_PROFILE_INFO' => 'Your profile', - 'UCP_PROFILE_REG_DETAILS' => 'Registration details', - 'UCP_PROFILE_SIGNATURE' => 'Your signature', + 'UCP_PROFILE_AVATAR' => 'Edit avatar', + 'UCP_PROFILE_PROFILE_INFO' => 'Edit profile', + 'UCP_PROFILE_REG_DETAILS' => 'Edit account settings', + 'UCP_PROFILE_SIGNATURE' => 'Edit signature', 'UCP_USERGROUPS' => 'Usergroups', - 'UCP_USERGROUPS_MEMBER' => 'Memberships', + 'UCP_USERGROUPS_MEMBER' => 'Edit memberships', 'UCP_USERGROUPS_MANAGE' => 'Manage groups', 'UCP_REGISTER_DISABLE' => 'Creating a new account is currently not possible.', @@ -428,9 +439,9 @@ $lang = array_merge($lang, array( 'UCP_RESEND' => 'Send activation email', 'UCP_WELCOME' => 'Welcome to the User Control Panel. From here you can monitor, view and update your profile, preferences, subscribed forums and topics. You can also send messages to other users (if permitted). Please ensure you read any announcements before continuing.', 'UCP_YIM' => 'Yahoo Messenger', - 'UCP_ZEBRA' => 'Friends and Foes', - 'UCP_ZEBRA_FOES' => 'Foes', - 'UCP_ZEBRA_FRIENDS' => 'Friends', + 'UCP_ZEBRA' => 'Friends & Foes', + 'UCP_ZEBRA_FOES' => 'Manage foes', + 'UCP_ZEBRA_FRIENDS' => 'Manage friends', 'UNKNOWN_FOLDER' => 'Unknown folder', 'UNWATCH_MARKED' => 'Unwatch marked', 'UPLOAD_AVATAR_FILE' => 'Upload from your machine', @@ -507,7 +518,7 @@ $lang = array_merge($lang, array( ), - 'GROUPS_EXPLAIN' => 'Usergroups enable board admins to better administer users. By default you will be placed in a specific group, this is your default group. This group defines how you may appear to other users, for example your username colouration, avatar, rank, etc. Depending on whether the administrator allows it you may be allowed to change your default group. You may also be placed in or allowed to join other groups. Some groups may give you extra rights to view content or increase your capabilities in other areas.', + 'GROUPS_EXPLAIN' => 'Usergroups enable board admins to better administer users. By default you will be placed in a specific group, this is your default group. This group defines how you may appear to other users, for example your username colouration, avatar, rank, etc. Depending on whether the administrator allows it you may be allowed to change your default group. You may also be placed in or allowed to join other groups. Some groups may give you extra rights to view content or increase your capabilities in other areas.', 'GROUP_LEADER' => 'Leaderships', 'GROUP_MEMBER' => 'Memberships', 'GROUP_PENDING' => 'Pending memberships', diff --git a/phpBB/language/en/viewforum.php b/phpBB/language/en/viewforum.php index 99d2d446d6..f995aa4d78 100644 --- a/phpBB/language/en/viewforum.php +++ b/phpBB/language/en/viewforum.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// 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 diff --git a/phpBB/language/en/viewtopic.php b/phpBB/language/en/viewtopic.php index 0c50afb689..44276689a7 100644 --- a/phpBB/language/en/viewtopic.php +++ b/phpBB/language/en/viewtopic.php @@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang)) // 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 @@ -65,15 +67,16 @@ $lang = array_merge($lang, array( 'MISSING_INLINE_ATTACHMENT' => 'The attachment <strong>%s</strong> is no longer available', 'MOVE_TOPIC' => 'Move topic', - 'NO_ATTACHMENT_SELECTED'=> 'You haven\'t selected an attachment to download or view.', + 'NO_ATTACHMENT_SELECTED'=> 'You haven’t selected an attachment to download or view.', 'NO_NEWER_TOPICS' => 'There are no newer topics in this forum', 'NO_OLDER_TOPICS' => 'There are no older topics in this forum', 'NO_UNREAD_POSTS' => 'There are no new unread posts for this topic.', 'NO_VOTE_OPTION' => 'You must specify an option when voting.', + 'NO_VOTES' => 'No votes', + 'POLL_ENDED_AT' => 'Poll ended at %s', 'POLL_RUN_TILL' => 'Poll runs till %s', 'POLL_VOTED_OPTION' => 'You voted for this option', - 'POST_ENCODING' => 'This post by <strong>%1$s</strong> was made in a character set different to yours. %2$sView this post in its proper encoding%3$s.', 'PRINT_TOPIC' => 'Print view', 'QUICK_MOD' => 'Quick-mod tools', diff --git a/phpBB/mcp.php b/phpBB/mcp.php index 0ecef72efa..fe64058418 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -72,7 +72,7 @@ $post_id = request_var('p', 0); $topic_id = request_var('t', 0); $forum_id = request_var('f', 0); $user_id = request_var('u', 0); -$username = request_var('username', ''); +$username = request_var('username', '', true); if ($post_id) { @@ -106,7 +106,6 @@ if (!$auth->acl_getf_global('m_')) // Except he is using one of the quickmod tools for users $user_quickmod_actions = array( 'lock' => 'f_user_lock', - 'unlock' => 'f_user_lock', 'make_sticky' => 'f_sticky', 'make_announce' => 'f_announce', 'make_global' => 'f_announce', @@ -421,7 +420,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, { global $db, $user, $auth, $template; - $sort_days = request_var('sort_days', 0); + $sort_days = request_var('st', 0); $min_time = ($sort_days) ? time() - ($sort_days * 86400) : 0; switch ($mode) @@ -468,8 +467,12 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, $sql = 'SELECT COUNT(post_id) AS total FROM ' . POSTS_TABLE . " $where_sql " . $db->sql_in_set('forum_id', ($forum_id) ? array($forum_id) : get_forum_list('m_approve')) . ' - AND post_approved = 0 - AND post_time >= ' . $min_time; + AND post_approved = 0'; + + if ($min_time) + { + $sql .= ' AND post_time >= ' . $min_time; + } break; case 'unapproved_topics': @@ -480,8 +483,12 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, $sql = 'SELECT COUNT(topic_id) AS total FROM ' . TOPICS_TABLE . " $where_sql " . $db->sql_in_set('forum_id', ($forum_id) ? array($forum_id) : get_forum_list('m_approve')) . ' - AND topic_approved = 0 - AND topic_time >= ' . $min_time; + AND topic_approved = 0'; + + if ($min_time) + { + $sql .= ' AND topic_time >= ' . $min_time; + } break; case 'reports': @@ -569,6 +576,11 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, break; } + if (!isset($sort_by_sql[$sort_key])) + { + $sort_key = $default_key; + } + $sort_order_sql = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); $s_limit_days = $s_sort_key = $s_sort_dir = $sort_url = ''; diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 0c29bd6559..50fa8e4954 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -25,7 +25,7 @@ $user->setup(array('memberlist', 'groups')); $mode = request_var('mode', ''); $action = request_var('action', ''); $user_id = request_var('u', ANONYMOUS); -$username = request_var('un', ''); +$username = request_var('un', '', true); $group_id = request_var('g', 0); $topic_id = request_var('t', 0); @@ -52,13 +52,13 @@ switch ($mode) $start = request_var('start', 0); $submit = (isset($_POST['submit'])) ? true : false; -$sort_key = request_var('sk', 'c'); +$default_key = 'c'; +$sort_key = request_var('sk', $default_key); $sort_dir = request_var('sd', 'a'); // Grab rank information for later -$ranks = array(); -$cache->obtain_ranks($ranks); +$ranks = $cache->obtain_ranks(); // What do you want to do today? ... oops, I think that line is taken ... @@ -168,6 +168,7 @@ switch ($mode) } $s_forum_select = ''; + $undisclosed_forum = false; if (isset($forum_id_ary[$row['user_id']])) { @@ -175,14 +176,28 @@ switch ($mode) { foreach ($forum_id_ary[$row['user_id']] as $forum_id) { - if (isset($forums[$forum_id]) && $auth->acl_get('f_list', $forum_id)) + if (isset($forums[$forum_id])) { - $s_forum_select .= '<option value="">' . $forums[$forum_id] . '</option>'; + if ($auth->acl_get('f_list', $forum_id)) + { + $s_forum_select .= '<option value="">' . $forums[$forum_id] . '</option>'; + } + else + { + $undisclosed_forum = true; + } } } } } + // If the mod is only moderating non-viewable forums let us display this circumstance + // instead of saying they are moderating all forums + if (!$s_forum_select && $undisclosed_forum) + { + $s_forum_select = $user->lang['FORUM_UNDISCLOSED']; + } + if ($row['group_type'] == GROUP_HIDDEN && !$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $user->data['user_id']) { $group_name = $user->lang['GROUP_UNDISCLOSED']; @@ -282,17 +297,16 @@ switch ($mode) $messenger = new messenger(false); $messenger->template('profile_send_im', $row['user_lang']); - $messenger->subject(html_entity_decode($subject)); + $messenger->subject(htmlspecialchars_decode($subject)); $messenger->replyto($user->data['user_email']); $messenger->im($row['user_jabber'], $row['username']); $messenger->assign_vars(array( - 'SITENAME' => $config['sitename'], 'BOARD_EMAIL' => $config['board_contact'], - 'FROM_USERNAME' => html_entity_decode($user->data['username']), - 'TO_USERNAME' => html_entity_decode($row['username']), - 'MESSAGE' => html_entity_decode($message)) + 'FROM_USERNAME' => htmlspecialchars_decode($user->data['username']), + 'TO_USERNAME' => htmlspecialchars_decode($row['username']), + 'MESSAGE' => htmlspecialchars_decode($message)) ); $messenger->send(NOTIFY_IM); @@ -332,7 +346,7 @@ switch ($mode) { $sql = 'SELECT * FROM ' . USERS_TABLE . " - WHERE LOWER(username) = '" . strtolower($db->sql_escape($username)) . "' + WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "' AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')'; } else @@ -367,6 +381,19 @@ switch ($mode) { $group_options .= '<option value="' . $row['group_id'] . '"' . (($row['group_id'] == $member['group_id']) ? ' selected="selected"' : '') . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>'; } + $db->sql_freeresult($result); + + // What colour is the zebra + $sql = 'SELECT friend, foe + FROM ' . ZEBRA_TABLE . " + WHERE zebra_id = $user_id + AND user_id = {$user->data['user_id']}"; + + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $foe = ($row['foe']) ? true : false; + $friend = ($row['friend']) ? true : false; + $db->sql_freeresult($result); if ($config['load_onlinetrack']) { @@ -396,16 +423,20 @@ switch ($mode) $posts_per_day = $member['user_posts'] / $memberdays; $percentage = ($config['num_posts']) ? min(100, ($member['user_posts'] / $config['num_posts']) * 100) : 0; - if ($member['user_sig_bbcode_bitfield'] && $member['user_sig']) - { - include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); - $bbcode = new bbcode(); - $bbcode->bbcode_second_pass($member['user_sig'], $member['user_sig_bbcode_uid'], $member['user_sig_bbcode_bitfield']); - } if ($member['user_sig']) { - $member['user_sig'] = censor_text(smiley_text($member['user_sig'])); + $member['user_sig'] = censor_text($member['user_sig']); + $member['user_sig'] = str_replace("\n", '<br />', $member['user_sig']); + + if ($member['user_sig_bbcode_bitfield']) + { + include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); + $bbcode = new bbcode(); + $bbcode->bbcode_second_pass($member['user_sig'], $member['user_sig_bbcode_uid'], $member['user_sig_bbcode_bitfield']); + } + + $member['user_sig'] = smiley_text($member['user_sig']); } $poster_avatar = ''; @@ -459,7 +490,7 @@ switch ($mode) 'OCCUPATION' => (!empty($member['user_occ'])) ? censor_text($member['user_occ']) : '', 'INTERESTS' => (!empty($member['user_interests'])) ? censor_text($member['user_interests']) : '', - 'SIGNATURE' => (!empty($member['user_sig'])) ? str_replace("\n", '<br />', $member['user_sig']) : '', + 'SIGNATURE' => $member['user_sig'], 'AVATAR_IMG' => $poster_avatar, 'PM_IMG' => $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE']), @@ -475,15 +506,16 @@ switch ($mode) 'S_PROFILE_ACTION' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group'), 'S_GROUP_OPTIONS' => $group_options, 'S_CUSTOM_FIELDS' => (isset($profile_fields['row']) && sizeof($profile_fields['row'])) ? true : false, - 'S_SHOW_ACTIVITY' => ($config['load_user_activity']) ? true : false, 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", 'i=users&mode=overview&u=' . $user_id, 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&u={$user_id}") : '', 'S_ZEBRA' => ($user->data['user_id'] != $user_id && $user->data['is_registered'] && $zebra_enabled) ? true : false, - 'U_ADD_FRIEND' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&add=' . urlencode($member['username'])), - 'U_ADD_FOE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&mode=foes&add=' . urlencode($member['username']))) - ); + 'U_ADD_FRIEND' => (!$friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&add=' . urlencode($member['username'])) : '', + 'U_ADD_FOE' => (!$foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&mode=foes&add=' . urlencode($member['username'])) : '', + 'U_REMOVE_FRIEND' => ($friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&usernames[]=' . $user_id) : '', + 'U_REMOVE_FOE' => ($foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&usernames[]=' . $user_id) : '', + )); if (!empty($profile_fields['row'])) { @@ -606,11 +638,11 @@ switch ($mode) $error = array(); - $name = request_var('name', ''); + $name = request_var('name', '', true); $email = request_var('email', ''); $email_lang = request_var('lang', $config['default_lang']); - $subject = request_var('subject', ''); - $message = request_var('message', ''); + $subject = request_var('subject', '', true); + $message = request_var('message', '', true); $cc = (isset($_POST['cc_email'])) ? true : false; $submit = (isset($_POST['submit'])) ? true : false; @@ -694,7 +726,7 @@ switch ($mode) if ($user_id) { - $messenger->subject(html_entity_decode($subject)); + $messenger->subject(htmlspecialchars_decode($subject)); $messenger->im($row['user_jabber'], $row['username']); $notify_type = $row['user_notify_type']; } @@ -709,17 +741,16 @@ switch ($mode) $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); $messenger->assign_vars(array( - 'SITENAME' => $config['sitename'], 'BOARD_EMAIL' => $config['board_contact'], - 'TO_USERNAME' => html_entity_decode($row['to_name']), - 'FROM_USERNAME' => html_entity_decode($user->data['username']), - 'MESSAGE' => html_entity_decode($message)) + 'TO_USERNAME' => htmlspecialchars_decode($row['to_name']), + 'FROM_USERNAME' => htmlspecialchars_decode($user->data['username']), + 'MESSAGE' => htmlspecialchars_decode($message)) ); if ($topic_id) { $messenger->assign_vars(array( - 'TOPIC_NAME' => html_entity_decode($row['topic_title']), + 'TOPIC_NAME' => htmlspecialchars_decode($row['topic_title']), 'U_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=" . $row['forum_id'] . "&t=$topic_id") ); } @@ -768,8 +799,8 @@ switch ($mode) $template_html = 'memberlist_body.html'; // Sorting - $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_LOCATION'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT'], 'e' => $user->lang['SORT_EMAIL'], 'f' => $user->lang['WEBSITE'], 'g' => $user->lang['ICQ'], 'h' => $user->lang['AIM'], 'i' => $user->lang['MSNM'], 'j' => $user->lang['YIM'], 'k' => $user->lang['JABBER'], 'l' => $user->lang['SORT_LAST_ACTIVE'], 'm' => $user->lang['SORT_RANK'], 'n' => $user->lang['LOCATION'] ); - $sort_key_sql = array('a' => 'u.username', 'b' => 'u.user_from', 'c' => 'u.user_regdate', 'd' => 'u.user_posts', 'e' => 'u.user_email', 'f' => 'u.user_website', 'g' => 'u.user_icq', 'h' => 'u.user_aim', 'i' => 'u.user_msnm', 'j' => 'u.user_yim', 'k' => 'u.user_jabber', 'l' => 'u.user_lastvisit', 'm' => 'u.user_rank DESC, u.user_posts', 'n' => 'u.user_from'); + $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_LOCATION'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT'], 'e' => $user->lang['SORT_EMAIL'], 'f' => $user->lang['WEBSITE'], 'g' => $user->lang['ICQ'], 'h' => $user->lang['AIM'], 'i' => $user->lang['MSNM'], 'j' => $user->lang['YIM'], 'k' => $user->lang['JABBER'], 'l' => $user->lang['SORT_LAST_ACTIVE'], 'm' => $user->lang['SORT_RANK'] ); + $sort_key_sql = array('a' => 'u.username', 'b' => 'u.user_from', 'c' => 'u.user_regdate', 'd' => 'u.user_posts', 'e' => 'u.user_email', 'f' => 'u.user_website', 'g' => 'u.user_icq', 'h' => 'u.user_aim', 'i' => 'u.user_msnm', 'j' => 'u.user_yim', 'k' => 'u.user_jabber', 'l' => 'u.user_lastvisit', 'm' => 'u.user_rank DESC, u.user_posts'); $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); @@ -796,7 +827,7 @@ switch ($mode) if ($mode == 'searchuser' && ($config['load_search'] || $auth->acl_get('a_'))) { - $username = request_var('username', ''); + $username = request_var('username', '', true); $email = request_var('email', ''); $icq = request_var('icq', ''); $aim = request_var('aim', ''); @@ -838,7 +869,7 @@ switch ($mode) $s_find_active_time .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>'; } - $sql_where .= ($username) ? " AND u.username LIKE '" . str_replace('*', '%', $db->sql_escape($username)) . "'" : ''; + $sql_where .= ($username) ? " AND u.username_clean LIKE '" . str_replace('*', '%', $db->sql_escape(utf8_clean_string($username))) . "'" : ''; $sql_where .= ($email) ? " AND u.user_email LIKE '" . str_replace('*', '%', $db->sql_escape($email)) . "' " : ''; $sql_where .= ($icq) ? " AND u.user_icq LIKE '" . str_replace('*', '%', $db->sql_escape($icq)) . "' " : ''; $sql_where .= ($aim) ? " AND u.user_aim LIKE '" . str_replace('*', '%', $db->sql_escape($aim)) . "' " : ''; @@ -917,14 +948,14 @@ switch ($mode) if ($first_char == 'other') { - for ($i = 65; $i < 91; $i++) + for ($i = 97; $i < 123; $i++) { - $sql_where .= " AND u.username NOT LIKE '" . chr($i) . "%'"; + $sql_where .= " AND u.username_clean NOT LIKE '" . chr($i) . "%'"; } } else if ($first_char) { - $sql_where .= " AND u.username LIKE '" . $db->sql_escape(substr($first_char, 0, 1)) . "%'"; + $sql_where .= " AND u.username_clean LIKE '" . $db->sql_escape(substr($first_char, 0, 1)) . "%'"; } // Are we looking at a usergroup? If so, fetch additional info @@ -999,7 +1030,7 @@ switch ($mode) { $rank_title = $ranks['special'][$group_row['group_rank']]['rank_title']; } - $rank_img = (!empty($ranks['special'][$group_row['group_rank']]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$group_row['group_rank']]['rank_image'] . '" border="0" alt="' . $ranks['special'][$group_row['group_rank']]['rank_title'] . '" title="' . $ranks['special'][$group_row['group_rank']]['rank_title'] . '" /><br />' : ''; + $rank_img = (!empty($ranks['special'][$group_row['group_rank']]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$group_row['group_rank']]['rank_image'] . '" alt="' . $ranks['special'][$group_row['group_rank']]['rank_title'] . '" title="' . $ranks['special'][$group_row['group_rank']]['rank_title'] . '" /><br />' : ''; $rank_img_src = (!empty($ranks['special'][$group_row['group_rank']]['rank_image'])) ? $config['ranks_path'] . '/' . $ranks['special'][$group_row['group_rank']]['rank_image'] : ''; } else @@ -1031,6 +1062,11 @@ switch ($mode) } // Sorting and order + if (!isset($sort_key_sql[$sort_key])) + { + $sort_key = $default_key; + } + $order_by .= $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); // Count the users ... @@ -1050,11 +1086,11 @@ switch ($mode) } $s_char_options = '<option value=""' . ((!$first_char) ? ' selected="selected"' : '') . '> </option>'; - for ($i = 65; $i < 91; $i++) + for ($i = 97; $i < 123; $i++) { - $s_char_options .= '<option value="' . chr($i) . '"' . (($first_char == chr($i)) ? ' selected="selected"' : '') . '>' . chr($i) . '</option>'; + $s_char_options .= '<option value="' . chr($i) . '"' . (($first_char == chr($i)) ? ' selected="selected"' : '') . '>' . chr($i-32) . '</option>'; } - $s_char_options .= '<option value="other"' . (($first_char == 'other') ? ' selected="selected"' : '') . '>Other</option>'; + $s_char_options .= '<option value="other"' . (($first_char == 'other') ? ' selected="selected"' : '') . '>' . $user->lang['OTHER'] . '</option>'; // Build a relevant pagination_url $params = array(); @@ -1072,7 +1108,7 @@ switch ($mode) continue; } - $params[] = $key . '=' . urlencode(htmlspecialchars($var)); + $params[] = urlencode($key) . '=' . urlencode(htmlspecialchars($var)); } } @@ -1329,19 +1365,19 @@ function show_profile($data) if ($bday_year) { - $time = time() + $user->timezone + $user->dst; + $now = getdate(time() + $user->timezone + $user->dst - (date('H', time()) - gmdate('H', time())) * 3600); - $diff = date('n', $time) - $bday_month; + $diff = $now['mon'] - $bday_month; if ($diff == 0) { - $diff = (date('j', $time) - $bday_day < 0) ? 1 : 0; + $diff = ($now['mday'] - $bday_day < 0) ? 1 : 0; } else { $diff = ($diff < 0) ? 1 : 0; } - $age = (int) (date('Y', $time) - $bday_year - $diff); + $age = (int) ($now['year'] - $bday_year - $diff); } } diff --git a/phpBB/posting.php b/phpBB/posting.php index 8210767ec2..d2d9ef0e27 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -118,12 +118,12 @@ switch ($mode) default: $sql = ''; - trigger_error('NO_POST_MODE'); break; } if (!$sql) { + $user->setup(array('posting', 'mcp', 'viewtopic')); trigger_error('NO_POST_MODE'); } @@ -131,6 +131,11 @@ $result = $db->sql_query($sql); $post_data = $db->sql_fetchrow($result); $db->sql_freeresult($result); +if (!$post_data) +{ + trigger_error(($mode == 'post' || $mode == 'bump' || $mode == 'reply') ? 'NO_TOPIC' : 'NO_POST'); +} + if ($mode == 'popup') { upload_popup($post_data['forum_style']); @@ -353,15 +358,18 @@ foreach ($uninit as $var_name => $default_value) } unset($uninit); +// Always check if the submitted attachment data is valid and belongs to the user. +// Further down (especially in submit_post()) we do not check this again. $message_parser->get_submitted_attachment_data($post_data['poster_id']); if ($post_data['post_attachment'] && !$submit && !$refresh && !$preview && $mode == 'edit') { // Do not change to SELECT * - $sql = 'SELECT attach_id, physical_filename, attach_comment, real_filename, extension, mimetype, filesize, filetime, thumbnail + $sql = 'SELECT attach_id, is_orphan, attach_comment, real_filename FROM ' . ATTACHMENTS_TABLE . " WHERE post_msg_id = $post_id AND in_message = 0 + AND is_orphan = 0 ORDER BY filetime " . ((!$config['display_order']) ? 'DESC' : 'ASC'); $result = $db->sql_query($sql); $message_parser->attachment_data = array_merge($message_parser->attachment_data, $db->sql_fetchrowset($result)); @@ -430,6 +438,7 @@ if ($mode == 'edit' && $post_data['bbcode_uid']) $bbcode_status = ($config['allow_bbcode'] && $auth->acl_get('f_bbcode', $forum_id)) ? true : false; $smilies_status = ($config['allow_smilies'] && $auth->acl_get('f_smilies', $forum_id)) ? true : false; $img_status = ($auth->acl_get('f_img', $forum_id)) ? true : false; +$url_status = ($config['allow_post_links']) ? true : false; $flash_status = ($auth->acl_get('f_flash', $forum_id)) ? true : false; $quote_status = ($auth->acl_get('f_reply', $forum_id)) ? true : false; @@ -439,6 +448,8 @@ if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts')) $subject = request_var('subject', '', true); $subject = (!$subject && $mode != 'post') ? $post_data['topic_title'] : $subject; $message = request_var('message', '', true); + + utf8_normalize_nfc(array(&$subject, &$message)); if ($subject && $message) { @@ -513,22 +524,18 @@ if ($load && $post_data['drafts']) load_drafts($topic_id, $forum_id); } +$solved_captcha = false; + if ($submit || $preview || $refresh) { $post_data['topic_cur_post_id'] = request_var('topic_cur_post_id', 0); $post_data['post_subject'] = request_var('subject', '', true); - - // If subject is all-uppercase then we make all lowercase (we do not want to be yelled at too :P) - // Admins/Mods might want to create all-uppercase topics, therefore we do not apply this check to them (they should know better ;)) - if ($post_data['post_subject'] && !$auth->acl_gets('a_', 'm_', $forum_id) && strcmp($post_data['post_subject'], strtoupper($post_data['post_subject'])) == 0) - { - $post_data['post_subject'] = strtolower($post_data['post_subject']); - } - $message_parser->message = request_var('message', '', true); - $post_data['username'] = request_var('username', $post_data['username']); + $post_data['username'] = request_var('username', $post_data['username'], true); $post_data['post_edit_reason'] = (!empty($_POST['edit_reason']) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? request_var('edit_reason', '', true) : ''; + + utf8_normalize_nfc(array(&$post_data['post_subject'], &$message_parser->message, &$post_data['username'], &$post_data['post_edit_reason'])); $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)); @@ -566,27 +573,30 @@ if ($submit || $preview || $refresh) if ($poll_delete && $mode == 'edit' && sizeof($post_data['poll_options']) && ((!$post_data['poll_last_vote'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))) { - $sql = 'DELETE FROM ' . POLL_OPTIONS_TABLE . " - WHERE topic_id = $topic_id"; - $db->sql_query($sql); + if ($submit) + { + $sql = 'DELETE FROM ' . POLL_OPTIONS_TABLE . " + WHERE topic_id = $topic_id"; + $db->sql_query($sql); - $sql = 'DELETE FROM ' . POLL_VOTES_TABLE . " - WHERE topic_id = $topic_id"; - $db->sql_query($sql); - - $topic_sql = array( - 'poll_title' => '', - 'poll_start' => 0, - 'poll_length' => 0, - 'poll_last_vote' => 0, - 'poll_max_options' => 0, - 'poll_vote_change' => 0 - ); + $sql = 'DELETE FROM ' . POLL_VOTES_TABLE . " + WHERE topic_id = $topic_id"; + $db->sql_query($sql); + + $topic_sql = array( + 'poll_title' => '', + 'poll_start' => 0, + 'poll_length' => 0, + 'poll_last_vote' => 0, + 'poll_max_options' => 0, + 'poll_vote_change' => 0 + ); - $sql = 'UPDATE ' . TOPICS_TABLE . ' - SET ' . $db->sql_build_array('UPDATE', $topic_sql) . " - WHERE topic_id = $topic_id"; - $db->sql_query($sql); + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $topic_sql) . " + WHERE topic_id = $topic_id"; + $db->sql_query($sql); + } $post_data['poll_title'] = $post_data['poll_option_text'] = ''; $post_data['poll_vote_change'] = $post_data['poll_max_options'] = $post_data['poll_length'] = 0; @@ -598,6 +608,8 @@ if ($submit || $preview || $refresh) $post_data['poll_option_text'] = request_var('poll_option_text', '', true); $post_data['poll_max_options'] = request_var('poll_max_options', 1); $post_data['poll_vote_change'] = ($auth->acl_get('f_votechg', $forum_id) && isset($_POST['poll_vote_change'])) ? 1 : 0; + + utf8_normalize_nfc(array(&$post_data['poll_title'], &$post_data['poll_option_text'])); } // If replying/quoting and last post id has changed @@ -606,7 +618,7 @@ if ($submit || $preview || $refresh) if (($mode == 'reply' || $mode == 'quote') && $post_data['topic_cur_post_id'] && $post_data['topic_cur_post_id'] != $post_data['topic_last_post_id']) { // Only do so if it is allowed forum-wide - if ($post_data['forum_flags'] & 32) + if ($post_data['forum_flags'] & FORUM_FLAG_POST_REVIEW) { if (topic_review($topic_id, $forum_id, 'post_review', $post_data['topic_cur_post_id'])) { @@ -630,7 +642,19 @@ if ($submit || $preview || $refresh) // Parse message if ($update_message) { - $message_parser->parse($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies'], $img_status, $flash_status, $quote_status); + if (sizeof($message_parser->warn_msg)) + { + $error[] = implode('<br />', $message_parser->warn_msg); + $message_parser->warn_msg = array(); + } + + $message_parser->parse($post_data['enable_bbcode'], ($config['allow_post_links']) ? $post_data['enable_urls'] : false, $post_data['enable_smilies'], $img_status, $flash_status, $quote_status, $config['allow_post_links']); + + // On a refresh we do not care about message parsing errors + if (sizeof($message_parser->warn_msg) && $refresh) + { + $message_parser->warn_msg = array(); + } } else { @@ -667,13 +691,14 @@ if ($submit || $preview || $refresh) } // Validate username - if (($post_data['username'] && !$user->data['is_registered']) || ($mode == 'edit' && $post_data['post_username'])) + if (($post_data['username'] && !$user->data['is_registered']) || ($mode == 'edit' && $post_data['username'] && $post_data['post_username'] && $post_data['post_username'] != $post_data['username'])) { include($phpbb_root_path . 'includes/functions_user.' . $phpEx); - if (($result = validate_username(($mode == 'edit' && $post_data['post_username']) ? $post_data['post_username'] : $post_data['username'])) != false) + if (($result = validate_username($post_data['username'])) !== false) { - $error[] = $user->lang[$result]; + $user->add_lang('ucp'); + $error[] = $user->lang[$result . '_USERNAME']; } } @@ -695,10 +720,14 @@ if ($submit || $preview || $refresh) { $error[] = $user->lang['CONFIRM_CODE_WRONG']; } + else + { + $solved_captcha = true; + } } // Parse subject - if (!$post_data['post_subject'] && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id))) + if (!$refresh && !$post_data['post_subject'] && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id))) { $error[] = $user->lang['EMPTY_SUBJECT']; } @@ -768,6 +797,15 @@ if ($submit || $preview || $refresh) $error[] = implode('<br />', $message_parser->warn_msg); } + // DNSBL check + if ($config['check_dnsbl'] && !$refresh) + { + if (($dnsbl = $user->check_dnsbl()) !== false) + { + $error[] = sprintf($user->lang['IP_BLACKLISTED'], $user->ip, $dnsbl[1]); + } + } + // Store message, sync counters if (!sizeof($error) && $submit) { @@ -808,7 +846,7 @@ if ($submit || $preview || $refresh) { // Lock/Unlock Topic $change_topic_status = $post_data['topic_status']; - $perm_lock_unlock = ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && !empty($post_data['topic_poster']) && $user->data['user_id'] == $post_data['topic_poster'])); + $perm_lock_unlock = ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && !empty($post_data['topic_poster']) && $user->data['user_id'] == $post_data['topic_poster'] && $post_data['topic_status'] == ITEM_UNLOCKED)) ? true : false; if ($post_data['topic_status'] == ITEM_LOCKED && !$topic_lock && $perm_lock_unlock) { @@ -919,7 +957,7 @@ if (!sizeof($error) && $preview) $preview_subject = censor_text($post_data['post_subject']); // Poll Preview - if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id'] && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id)))) + if (!$poll_delete && ($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id'] && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id)))) && $auth->acl_get('f_poll', $forum_id)) { $parse_poll = new parse_message($post_data['poll_title']); @@ -999,7 +1037,7 @@ if ($mode == 'quote' && !$submit && !$preview && !$refresh) if (($mode == 'reply' || $mode == 'quote') && !$submit && !$preview && !$refresh) { - $post_data['post_subject'] = ((!preg_match('/^Re:/', $post_data['post_subject'])) ? 'Re: ' : '') . censor_text($post_data['post_subject']); + $post_data['post_subject'] = ((strpos($post_data['post_subject'], 'Re: ') !== 0) ? 'Re: ' : '') . censor_text($post_data['post_subject']); } $attachment_data = $message_parser->attachment_data; @@ -1053,8 +1091,9 @@ $sig_checked = $post_data['enable_sig']; $lock_topic_checked = (isset($topic_lock)) ? $topic_lock : (($post_data['topic_status'] == ITEM_LOCKED) ? 1 : 0); $lock_post_checked = (isset($post_lock)) ? $post_lock : $post_data['post_edit_locked']; -// If in edit mode, and the user is not the poster, we do not take the notification into account -$notify_checked = (isset($notify)) ? $notify : (($mode == 'post') ? $user->data['user_notify'] : $post_data['notify_set']); +// If the user is replying or posting and not already watching this topic but set to always being notified we need to overwrite this setting +$notify_set = ($mode != 'edit' && $config['allow_topic_notify'] && $user->data['is_registered'] && !$post_data['notify_set']) ? $user->data['user_notify'] : $post_data['notify_set']; +$notify_checked = (isset($notify)) ? $notify : (($mode == 'post') ? $user->data['user_notify'] : $notify_set); // Page title & action URL, include session_id for security purpose $s_action = append_sid("{$phpbb_root_path}posting.$phpEx", "mode=$mode&f=$forum_id", true, $user->session_id); @@ -1093,30 +1132,33 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'] && ($mode == $db->sql_query($sql); // Generate code - $code = gen_rand_string(mt_rand(5, 8)); - $confirm_id = md5(unique_id($user->ip)); - - $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) - ); - $db->sql_query($sql); + if ($solved_captcha === false) + { + $code = gen_rand_string(mt_rand(5, 8)); + $confirm_id = md5(unique_id($user->ip)); + + $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) + ); + $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&id=' . $confirm_id . '&type=' . CONFIRM_POST) . '" alt="" title="" />', - 'L_POST_CONFIRM_EXPLAIN' => sprintf($user->lang['POST_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlentities($config['board_contact']) . '">', '</a>'), - )); + $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&id=' . $confirm_id . '&type=' . CONFIRM_POST) . '" alt="" title="" />', + 'L_POST_CONFIRM_EXPLAIN' => sprintf($user->lang['POST_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'), + )); + } } $s_hidden_fields = ($mode == 'reply' || $mode == 'quote') ? '<input type="hidden" name="topic_cur_post_id" value="' . $post_data['topic_last_post_id'] . '" />' : ''; $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) . '" />' : ''; -$form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_uploads')) == 'off' || @ini_get('file_uploads') == '0' || !$config['allow_attachments'] || !$auth->acl_gets('f_attach', 'u_attach', $forum_id)) ? '' : ' enctype="multipart/form-data"'; +$form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_uploads')) == 'off' || @ini_get('file_uploads') == '0' || !$config['allow_attachments'] || !$auth->acl_get('u_attach') || !$auth->acl_get('f_attach', $forum_id)) ? '' : ' enctype="multipart/form-data"'; // Start assigning vars for main posting page ... $template->assign_vars(array( @@ -1131,10 +1173,11 @@ $template->assign_vars(array( 'USERNAME' => ((!$preview && $mode != 'quote') || $preview) ? $post_data['username'] : '', 'SUBJECT' => $post_data['post_subject'], 'MESSAGE' => $post_data['post_text'], - 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '" onclick="target=\'_phpbbcode\';">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '" onclick="target=\'_phpbbcode\';">', '</a>'), + 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'), 'IMG_STATUS' => ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], 'FLASH_STATUS' => ($flash_status) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], 'SMILIES_STATUS' => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], + 'URL_STATUS' => ($url_status) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'], 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']), 'POST_DATE' => ($post_data['post_time']) ? $user->format_date($post_data['post_time']) : '', 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', @@ -1160,10 +1203,11 @@ $template->assign_vars(array( 'S_SIGNATURE_CHECKED' => ($sig_checked) ? ' checked="checked"' : '', 'S_NOTIFY_ALLOWED' => (!$user->data['is_registered'] || ($mode == 'edit' && $user->data['user_id'] != $post_data['poster_id']) || !$config['allow_topic_notify']) ? false : true, 'S_NOTIFY_CHECKED' => ($notify_checked) ? ' checked="checked"' : '', - 'S_LOCK_TOPIC_ALLOWED' => (($mode == 'edit' || $mode == 'reply' || $mode == 'quote') && ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && !empty($post_data['topic_poster']) && $user->data['user_id'] == $post_data['topic_poster']))) ? true : false, + 'S_LOCK_TOPIC_ALLOWED' => (($mode == 'edit' || $mode == 'reply' || $mode == 'quote') && ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && !empty($post_data['topic_poster']) && $user->data['user_id'] == $post_data['topic_poster'] && $post_data['topic_status'] == ITEM_UNLOCKED))) ? true : false, 'S_LOCK_TOPIC_CHECKED' => ($lock_topic_checked) ? ' checked="checked"' : '', 'S_LOCK_POST_ALLOWED' => ($mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? true : false, 'S_LOCK_POST_CHECKED' => ($lock_post_checked) ? ' checked="checked"' : '', + 'S_LINKS_ALLOWED' => $url_status, 'S_MAGIC_URL_CHECKED' => ($urls_checked) ? ' checked="checked"' : '', 'S_TYPE_TOGGLE' => $topic_type_toggle, 'S_SAVE_ALLOWED' => ($auth->acl_get('u_savedrafts') && $user->data['is_registered']) ? true : false, @@ -1171,6 +1215,7 @@ $template->assign_vars(array( 'S_FORM_ENCTYPE' => $form_enctype, 'S_BBCODE_IMG' => $img_status, + 'S_BBCODE_URL' => $url_status, 'S_BBCODE_FLASH' => $flash_status, 'S_BBCODE_QUOTE' => $quote_status, @@ -1189,6 +1234,7 @@ if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_ 'S_SHOW_POLL_BOX' => true, 'S_POLL_VOTE_CHANGE' => ($auth->acl_get('f_votechg', $forum_id)), 'S_POLL_DELETE' => ($mode == 'edit' && sizeof($post_data['poll_options']) && ((!$post_data['poll_last_vote'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))), + 'S_POLL_DELETE_CHECKED' => (!empty($poll_delete)) ? true : false, 'L_POLL_OPTIONS_EXPLAIN' => sprintf($user->lang['POLL_OPTIONS_EXPLAIN'], $config['max_poll_options']), diff --git a/phpBB/report.php b/phpBB/report.php index 5e5a9870d8..348b2e91b6 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -22,16 +22,19 @@ $user->session_begin(); $auth->acl($user->data); $user->setup('mcp'); -$forum_id = request_var('f', 0); -$post_id = request_var('p', 0); -$reason_id = request_var('reason_id', 0); -$report_text = request_var('report_text', '', true); +$forum_id = request_var('f', 0); +$post_id = request_var('p', 0); +$reason_id = request_var('reason_id', 0); +$report_text = request_var('report_text', '', true); + +utf8_normalize_nfc(&$report_text); + $user_notify = (isset($_POST['notify']) && $user->data['is_registered']) ? true : false; $submit = (isset($_POST['submit'])) ? true : false; if (!$post_id) { - trigger_error('INVALID_MODE'); + trigger_error('NO_POST_SELECTED'); } $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&p=$post_id") . "#p$post_id"; @@ -64,6 +67,7 @@ $sql = 'SELECT * WHERE forum_id = ' . $forum_id; $result = $db->sql_query($sql); $forum_data = $db->sql_fetchrow($result); +$db->sql_freeresult($result); if (!$forum_data) { @@ -99,7 +103,7 @@ if ($submit && $reason_id) $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if (!$row || (!$report_text && $row['reason_title'] == 'other')) + if (!$row || (!$report_text && strtolower($row['reason_title']) == 'other')) { trigger_error('EMPTY_REPORT'); } diff --git a/phpBB/search.php b/phpBB/search.php index d85eb4b1a0..44ef053014 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -47,11 +47,6 @@ $sort_dir = request_var('sd', 'd'); $return_chars = request_var('ch', ($topic_id) ? -1 : 200); $search_forum = request_var('fid', array(0)); -if ($search_forum == array(0)) -{ - $search_forum = array(); -} - // Is user able to search? Has search been disabled? if (!$auth->acl_get('u_search') || !$auth->acl_getf_global('f_search') || !$config['load_search']) { @@ -103,7 +98,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $reset_search_forum = true; while ($row = $db->sql_fetchrow($result)) { - if ($row['forum_password'] && ($row['user_id'] != $user->data['user_id'])) + if ($row['forum_password'] && $row['user_id'] != $user->data['user_id']) { $ex_fid_ary[] = (int) $row['forum_id']; continue; @@ -259,24 +254,23 @@ if ($keywords || $author || $author_id || $search_id || $submit) $sort_key = 't'; $sort_dir = 'd'; $sort_by_sql['t'] = 't.topic_last_post_time'; - $sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); if (!$sort_days) { - $sort_days = 1; + $sort_days = 3; } 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_sort_key = $s_sort_dir = ''; + $u_sort_param = 'st=' . $sort_days; $last_post_time = (time() - ($sort_days * 24 * 3600)); - $sql = 'SELECT DISTINCT t.topic_last_post_time, t.topic_id - FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t - WHERE p.post_time > $last_post_time + $sql = 'SELECT t.topic_last_post_time, t.topic_id + FROM ' . TOPICS_TABLE . " t + WHERE t.topic_last_post_time > $last_post_time AND t.topic_moved_id = 0 - AND p.topic_id = t.topic_id - $m_approve_fid_sql - " . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . ' + " . 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) : '') . ' ORDER BY t.topic_last_post_time DESC'; $field = 'topic_id'; break; @@ -291,6 +285,15 @@ if ($keywords || $author || $author_id || $search_id || $submit) $sort_join = ($sort_key == 'f') ? FORUMS_TABLE . ' f, ' : ''; $sql_sort = ($sort_key == 'f') ? ' AND f.forum_id = p.forum_id ' . $sql_sort : $sql_sort; + if ($sort_days) + { + $last_post_time = 'AND p.post_time > ' . (time() - ($sort_days * 24 * 3600)); + } + else + { + $last_post_time = ''; + } + if ($show_results == 'posts') { if ($sort_key == 'a') @@ -303,6 +306,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t WHERE t.topic_replies = 0 AND p.topic_id = t.topic_id + $last_post_time $m_approve_fid_sql " . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . " $sql_sort"; @@ -315,6 +319,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) WHERE t.topic_replies = 0 AND t.topic_moved_id = 0 AND p.topic_id = t.topic_id + $last_post_time $m_approve_fid_sql " . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . " $sql_sort"; @@ -330,10 +335,6 @@ if ($keywords || $author || $author_id || $search_id || $submit) $sort_by_sql['t'] = ($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time'; $sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); - if (!$sort_days) - { - $sort_days = 1; - } 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 = ''; @@ -420,8 +421,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) } // Grab icons - $icons = array(); - $cache->obtain_icons($icons); + $icons = $cache->obtain_icons(); // Output header if ($search_id && ($total_match_count > 1000)) @@ -494,7 +494,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) } $db->sql_freeresult($result); - $sql = 'SELECT p.*, f.forum_id, f.forum_name, t.*, u.username, u.user_sig, u.user_sig_bbcode_uid + $sql = 'SELECT p.*, f.forum_id, f.forum_name, t.*, u.username, u.user_sig, u.user_sig_bbcode_uid, u.user_colour FROM ' . POSTS_TABLE . ' p LEFT JOIN ' . TOPICS_TABLE . ' t ON (p.topic_id = t.topic_id) LEFT JOIN ' . FORUMS_TABLE . ' f ON (p.forum_id = f.forum_id) @@ -609,11 +609,62 @@ if ($keywords || $author || $author_id || $search_id || $submit) } else { + $bbcode_bitfield = ''; + $attach_list = array(); + while ($row = $db->sql_fetchrow($result)) { $rowset[] = $row; + if (($return_chars == -1) || (utf8_strlen($row['post_text']) < $return_chars + 3)) + { + $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']); + + // Does this post have an attachment? If so, add it to the list + if ($row['post_attachment'] && $config['allow_attachments']) + { + $attach_list[$row['forum_id']][] = $row['post_id']; + } + } } $db->sql_freeresult($result); + + // Instantiate BBCode if needed + if ($bbcode_bitfield !== '') + { + include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); + $bbcode = new bbcode(base64_encode($bbcode_bitfield)); + } + + // Pull attachment data + if (sizeof($attach_list)) + { + $use_attach_list = $attach_list; + $attach_list = array(); + + foreach ($use_attach_list as $forum_id => $_list) + { + if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id)) + { + $attach_list = array_merge($attach_list, $_list); + } + } + } + + if (sizeof($attach_list)) + { + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('post_msg_id', $attach_list) . ' + AND in_message = 0 + ORDER BY filetime ' . ((!$config['display_order']) ? 'DESC' : 'ASC') . ', post_msg_id ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $attachments[$row['post_msg_id']][] = $row; + } + $db->sql_freeresult($result); + } } if ($hilit) @@ -672,16 +723,20 @@ if ($keywords || $author || $author_id || $search_id || $submit) $unread_topic = (isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']]) ? true : false; - $topic_unapproved = (!$row['topic_approved'] && $auth->acl_gets('m_approve', $forum_id)) ? true : false; - $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_gets('m_approve', $forum_id)) ? true : false; + $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; $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$result_topic_id", true, $user->session_id) : ''; $tpl_ary = array( - 'TOPIC_AUTHOR' => topic_topic_author($row), - 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), - 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), - 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), - 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'], + 'TOPIC_AUTHOR' => ($row['topic_first_poster_name']) ? $row['topic_first_poster_name'] : $user->lang['GUEST'], + 'TOPIC_AUTHOR_COLOUR' => ($row['topic_first_poster_colour']) ? '#' . $row['topic_first_poster_colour'] : '', + 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), + 'LAST_POST_SUBJECT' => $row['topic_last_post_subject'], + 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), + 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), + 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'], + 'LAST_POST_AUTHOR_COLOUR' => ($row['topic_last_poster_colour']) ? '#' . $row['topic_last_poster_colour'] : '', + 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url), 'TOPIC_TYPE' => $topic_type, @@ -691,7 +746,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '', - 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '', 'S_TOPIC_GLOBAL' => (!$forum_id) ? true : false, @@ -699,12 +754,13 @@ if ($keywords || $author || $author_id || $search_id || $submit) 'S_USER_POSTED' => (!empty($row['mark_type'])) ? true : false, 'S_UNREAD_TOPIC' => $unread_topic, - 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_report', $forum_id)) ? true : false, + 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $forum_id)) ? true : false, 'S_TOPIC_UNAPPROVED' => $topic_unapproved, 'S_POSTS_UNAPPROVED' => $posts_unapproved, 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR' => ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_last_poster_id']) : '', + 'U_TOPIC_AUTHOR' => ($row['topic_poster'] != ANONYMOUS && $row['topic_poster']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_poster']) : '', 'U_NEWEST_POST' => $view_topic_url . '&view=unread#unread', 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&t=' . $result_topic_id, true, $user->session_id), 'U_MCP_QUEUE' => $u_mcp_queue, @@ -723,28 +779,61 @@ if ($keywords || $author || $author_id || $search_id || $submit) continue; } - decode_message($row['post_text'], $row['bbcode_uid']); + // Replace naughty words such as farty pants + $row['post_subject'] = censor_text($row['post_subject']); + $message = $row['post_text']; - if ($return_chars != -1) + if ($return_chars != -1 && utf8_strlen($message) >= ($return_chars + 3)) { - $row['post_text'] = (strlen($row['post_text']) < $return_chars + 3) ? $row['post_text'] : substr($row['post_text'], 0, $return_chars) . '...'; + $message = censor_text($message); + + // make list items visible as such + $message = str_replace('[*:' . $row['bbcode_uid'] . ']', '⋅ ', $message); + + // do not display raw bbcode + strip_bbcode($message, $row['bbcode_uid']); + + // now find context for the searched words + $message = get_context($message, array_filter(explode('|', $hilit), 'strlen'), $return_chars); + + $message = str_replace("\n", '<br />', $message); } + else + { + $message = censor_text($message); + $message = str_replace("\n", '<br />', $message); - // Replace naughty words such as farty pants - $row['post_subject'] = censor_text($row['post_subject']); - $row['post_text'] = str_replace("\n", '<br />', censor_text($row['post_text'])); + // Second parse bbcode here + if ($row['bbcode_bitfield']) + { + $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']); + } - // post highlighting - $row['post_text'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*>)#i', '<span class="posthilit">$1</span>', $row['post_text']); + if (isset($attachments[$row['post_id']]) && sizeof($attachments[$row['post_id']])) + { + parse_inline_attachments($message, $attachments[$row['post_id']], $update_count, $forum_id); + + // we only display inline attachments + unset($attachments[$row['post_id']]); + } + + // Always process smilies after parsing bbcodes + $message = smiley_text($message); + } - $row['post_text'] = smiley_text($row['post_text']); + if ($hilit) + { + // post highlighting + $message = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $message); + } $tpl_ary = array( 'POSTER_NAME' => ($row['poster_id'] == ANONYMOUS) ? ((!empty($row['post_username'])) ? $row['post_username'] : $user->lang['GUEST']) : $row['username'], + 'POSTER_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '', 'U_PROFILE' => ($row['poster_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['poster_id']) : '', 'POST_SUBJECT' => $row['post_subject'], 'POST_DATE' => (!empty($row['post_time'])) ? $user->format_date($row['post_time']) : '', - 'MESSAGE' => $row['post_text'] + 'MESSAGE' => $message ); } @@ -859,6 +948,11 @@ while ($row = $db->sql_fetchrow($result)) $db->sql_freeresult($result); unset($pad_store); +if (!$s_forums) +{ + trigger_error($user->lang['NO_SEARCH']); +} + // Number of chars returned $s_characters = '<option value="-1">' . $user->lang['ALL_AVAILABLE'] . '</option>'; $s_characters .= '<option value="0">0</option>'; @@ -881,10 +975,24 @@ $template->assign_vars(array( 'S_SELECT_SORT_DAYS' => $s_limit_days) ); -$sql = 'SELECT search_time, search_keywords - FROM ' . SEARCH_RESULTS_TABLE . ' - WHERE search_keywords <> \'\' - ORDER BY search_time DESC'; +// Can't do comparisons w/ TEXT on MSSQL, CAST is good enough +switch ($db->sql_layer) +{ + case 'mssql': + case 'mssql_odbc': + $sql = 'SELECT search_time, search_keywords + FROM ' . SEARCH_RESULTS_TABLE . ' + WHERE CAST(search_keywords AS varchar) <> \'\' + ORDER BY search_time DESC'; + break; + + default: + $sql = 'SELECT search_time, search_keywords + FROM ' . SEARCH_RESULTS_TABLE . ' + WHERE search_keywords <> \'\' + ORDER BY search_time DESC'; + break; +} $result = $db->sql_query_limit($sql, 5); while ($row = $db->sql_fetchrow($result)) diff --git a/phpBB/style.php b/phpBB/style.php index 075f20db3d..496ae7c8e0 100644 --- a/phpBB/style.php +++ b/phpBB/style.php @@ -54,6 +54,7 @@ if ($id && $sid) require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx); require($phpbb_root_path . 'includes/cache.' . $phpEx); require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); + require($phpbb_root_path . 'includes/constants.' . $phpEx); $db = new $sql_db(); $cache = new cache(); @@ -64,6 +65,8 @@ if ($id && $sid) exit; } + $config = $cache->obtain_config(); + $sql = "SELECT s.session_id, u.user_lang FROM {$table_prefix}sessions s, {$table_prefix}users u WHERE s.session_id = '" . $db->sql_escape($sid) . "' @@ -89,11 +92,26 @@ if ($id && $sid) exit; } - /** - * @todo What happens if the theme_data value is older than the file? - * It should be re-cached as is done with templates and the template cache - * if ($theme['theme_mtime'] < filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css')) - */ + // Re-cache stylesheet data if necessary + if ($config['load_tplcompile'] && $theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css')) + { + include_once($phpbb_root_path . 'includes/acp/acp_styles.' . $phpEx); + + $theme['theme_data'] = acp_styles::db_theme_data($theme); + $theme['theme_mtime'] = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'); + + // Save CSS contents + $sql_ary = array( + 'theme_mtime' => $theme['theme_mtime'], + 'theme_data' => $theme['theme_data'] + ); + + $sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE theme_id = $id"; + $db->sql_query($sql); + + $cache->destroy('sql', STYLES_THEME_TABLE); + } header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 3600)); header('Content-type: text/css'); diff --git a/phpBB/styles/subSilver/template/attachment.html b/phpBB/styles/subSilver/template/attachment.html index 4e91dcfde3..2f4ac0d268 100644 --- a/phpBB/styles/subSilver/template/attachment.html +++ b/phpBB/styles/subSilver/template/attachment.html @@ -28,53 +28,74 @@ <!-- ENDIF --> <!-- IF _file.S_WM_FILE --> - <object id="wmp" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"> - <param name="FileName" value="{_file.U_DOWNLOAD_LINK}"> - <param name="ShowControls" value="1"> - <param name="ShowDisplay" value="0"> + <object classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"> + <param name="FileName" VALUE="{_file.U_DOWNLOAD_LINK}"> + <param name="ShowControls" value="1"> + <param name="ShowDisplay" value="0"> <param name="ShowStatusBar" value="1"> <param name="AutoSize" value="1"> <param name="AutoStart" value="0"> <param name="Visible" value="1"> <param name="AnimationStart" value="0"> <param name="Loop" value="0"> - <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows95/downloads/contents/wurecommended/s_wufeatured/mediaplayer/default.asp" src="{_file.U_DOWNLOAD_LINK}" name=MediaPlayer2 showcontrols=1 showdisplay=0 showstatusbar=1 autosize=1 autostart=0 visible=1 animationatstart=0 loop=0></embed> + <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/AllDownloads.aspx/" filename="{_file.U_DOWNLOAD_LINK}" src="{_file.U_DOWNLOAD_LINK}" name="MediaPlayer" ShowControls="1" ShowDisplay="0" ShowStatusBar="1" AutoSize="1" AutoStart="0" Visible="1" AnimationStart="0" Loop="0"></embed> </object> - <br /> - <span class="gensmall">{_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOADED_VIEWED} {_file.L_DOWNLOAD_COUNT} ]</span> - <!-- ENDIF --> - <!-- IF _file.S_RM_FILE --> - <object id=rmstream_{_file.ATTACH_ID} classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="200" height="50"> - <param name="src" value="{_file.U_FORUM}/{_file.U_DOWNLOAD_LINK}"> + <!-- ELSEIF _file.S_FLASH_FILE --> + <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{_file.WIDTH}" height="{_file.HEIGHT}"> + <param name="movie" value="{_file.U_DOWNLOAD_LINK}" /> + <param name="play" value="true" /> + <param name="loop" value="true" /> + <param name="quality" value="high" /> + <param name="allowScriptAccess" value="never" /> + <embed src="{_file.U_DOWNLOAD_LINK}" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="{_file.WIDTH}" height="{_file.HEIGHT}" play="true" loop="true" quality="high" allowscriptaccess="never"></embed> + </object> + <!-- ELSEIF _file.S_QUICKTIME_FILE --> + <object id="qtstream_{_file.ATTACH_ID}" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" width="0" height="16"> + <param name="src" value="{_file.U_DOWNLOAD_LINK}"> + <param name="controller" value="true"> + <param name="autoplay" value="false" /> + <param name="type" value="video/quicktime"> + <embed name="qtstream_{_file.ATTACH_ID}" src="{_file.U_DOWNLOAD_LINK}" pluginspage="http://www.apple.com/quicktime/download/" enablejavascript="true" controller="true" width="0" height="16" type="video/quicktime" autoplay="false"> + </object> + <!-- ELSEIF _file.S_RM_FILE --> + <object id="rmstream_{_file.ATTACH_ID}" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="200" height="50"> + <param name="src" value="{_file.U_DOWNLOAD_LINK}"> <param name="autostart" value="false"> <param name="controls" value="ImageWindow"> - <param name="console" value="{_file.U_DOWNLOAD_LINK}"> - <param name="prefetch" value="true"> - <embed name=rmstream_{_file.ATTACH_ID} type="audio/x-pn-realaudio-plugin" src="{_file.U_FORUM}/{_file.U_DOWNLOAD_LINK}" width="0" height="0" autostart="false" controls="ImageWindow" console="video" prefetch="true"></embed> + <param name="console" value="ctrls_{_file.ATTACH_ID}"> + <param name="prefetch" value="false"> + <embed name="rmstream_{_file.ATTACH_ID}" type="audio/x-pn-realaudio-plugin" src="{_file.U_DOWNLOAD_LINK}" width="0" height="0" autostart="false" controls="ImageWindow" console="ctrls_{_file.ATTACH_ID}" prefetch="false"></embed> </object> <br /> - <object id=ctrls_{_file.ATTACH_ID} classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="0" height="36"> + <object id="ctrls_{_file.ATTACH_ID}" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="0" height="36"> <param name="controls" value="ControlPanel"> - <param name="console" value="{_file.U_DOWNLOAD_LINK}"> - <embed name=ctrls_{_file.ATTACH_ID} type="audio/x-pn-realaudio-plugin" width="200" height="36" controls="ControlPanel" console="video"></embed> + <param name="console" value="ctrls_{_file.ATTACH_ID}"> + <embed name="ctrls_{_file.ATTACH_ID}" type="audio/x-pn-realaudio-plugin" width="200" height="36" controls="ControlPanel" console="ctrls_{_file.ATTACH_ID}"></embed> </object> <script language="Javascript"> <!-- - while (!document.rmstream_{_file.ATTACH_ID}.GetClipWidth()) + if (document.rmstream_{_file.ATTACH_ID}.GetClipWidth) { - } + while (!document.rmstream_{_file.ATTACH_ID}.GetClipWidth()) + { + } - var width = document.rmstream_{_file.ATTACH_ID}.GetClipWidth(); - var height = document.rmstream_{_file.ATTACH_ID}.GetClipHeight(); + var width = document.rmstream_{_file.ATTACH_ID}.GetClipWidth(); + var height = document.rmstream_{_file.ATTACH_ID}.GetClipHeight(); - document.rmstream_{_file.ATTACH_ID}.width = width; - document.rmstream_{_file.ATTACH_ID}.height = height; - document.ctrls_{_file.ATTACH_ID}.width = width; + document.rmstream_{_file.ATTACH_ID}.width = width; + document.rmstream_{_file.ATTACH_ID}.height = height; + document.ctrls_{_file.ATTACH_ID}.width = width; + } //--> </script> + <!-- ENDIF --> + + <!-- IF _file.S_WM_FILE or _file.S_RM_FILE or _file.S_FLASH_FILE or _file.S_QUICKTIME_FILE --> <br /> + <!-- IF _file.S_QUICKTIME_FILE --><a href="javascript:play_qt_file(document.qtstream_{_file.ATTACH_ID});">[ {L_PLAY_QUICKTIME_FILE} ]</a> <!-- ENDIF --> <span class="gensmall">{_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOADED_VIEWED} {_file.L_DOWNLOAD_COUNT} ]</span> <!-- ENDIF --> diff --git a/phpBB/styles/subSilver/template/breadcrumbs.html b/phpBB/styles/subSilver/template/breadcrumbs.html new file mode 100644 index 0000000000..ad180250ce --- /dev/null +++ b/phpBB/styles/subSilver/template/breadcrumbs.html @@ -0,0 +1,8 @@ + <table class="tablebg" width="100%" cellspacing="1" cellpadding="0" style="margin-top: 5px;"> + <tr> + <td class="row1"> + <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> + <p class="datetime">{S_TIMEZONE}</p> + </td> + </tr> + </table>
\ No newline at end of file diff --git a/phpBB/styles/subSilver/template/confirm_body.html b/phpBB/styles/subSilver/template/confirm_body.html index af69325446..27d9aa0444 100644 --- a/phpBB/styles/subSilver/template/confirm_body.html +++ b/phpBB/styles/subSilver/template/confirm_body.html @@ -19,14 +19,7 @@ <br clear="all" /> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <br clear="all" /> diff --git a/phpBB/styles/subSilver/template/editor.js b/phpBB/styles/subSilver/template/editor.js index f1f7c85706..5ce917d1b2 100644 --- a/phpBB/styles/subSilver/template/editor.js +++ b/phpBB/styles/subSilver/template/editor.js @@ -23,7 +23,7 @@ var is_mac = (clientPC.indexOf('mac') != -1); */ function helpline(help) { - document.forms[form_name].helpbox.value = eval(help + '_help'); + document.forms[form_name].helpbox.value = help_line[help]; } /** @@ -33,7 +33,7 @@ function getarraysize(thearray) { for (i = 0; i < thearray.length; i++) { - if (thearray[i] == 'undefined' || thearray[i] == '' || thearray[i] == null) + if (typeof thearray[i] == 'undefined' || thearray[i] == '' || thearray[i] == null) { return i; } @@ -65,32 +65,6 @@ function arraypop(thearray) } /** -* Insert emoticon -*/ -function smiley(text) -{ - text = ' ' + text + ' '; - - if (document.forms[form_name].elements[text_name].createTextRange && document.forms[form_name].elements[text_name].caretPos) - { - var caretPos = document.forms[form_name].elements[text_name].caretPos; - - caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text; - document.forms[form_name].elements[text_name].focus(); - } - else - { - var selStart = document.forms[form_name].elements[text_name].selectionStart; - var selEnd = document.forms[form_name].elements[text_name].selectionEnd; - - mozWrap(document.forms[form_name].elements[text_name], text, '') - document.forms[form_name].elements[text_name].focus(); - document.forms[form_name].elements[text_name].selectionStart = selStart + text.length; - document.forms[form_name].elements[text_name].selectionEnd = selEnd + text.length; - } -} - -/** * Apply bbcodes */ function bbfontstyle(bbopen, bbclose) @@ -145,25 +119,38 @@ function bbfontstyle(bbopen, bbclose) /** * Insert text at position */ -function insert_text(text) +function insert_text(text, spaces, popup) { - if (document.forms[form_name].elements[text_name].createTextRange && !isNaN(document.forms[form_name].elements[text_name].caretPos)) + var textarea; + + if (!popup) + { + textarea = document.forms[form_name].elements[text_name]; + } else { - var caretPos = document.forms[form_name].elements[text_name].caretPos; - caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text; + textarea = opener.document.forms[form_name].elements[text_name]; } - else if (!isNaN(document.forms[form_name].elements[text_name].selectionStart)) + if (spaces) { - var selStart = document.forms[form_name].elements[text_name].selectionStart; - var selEnd = document.forms[form_name].elements[text_name].selectionEnd; + text = ' ' + text + ' '; + } + if (textarea.createTextRange && !isNaN(textarea.caretPos)) + { + var caret_pos = textarea.caretPos; + caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text; + } + else if (!isNaN(textarea.selectionStart)) + { + var sel_start = textarea.selectionStart; + var sel_end = textarea.selectionEnd; - mozWrap(document.forms[form_name].elements[text_name], text, '') - document.forms[form_name].elements[text_name].selectionStart = selStart + text.length; - document.forms[form_name].elements[text_name].selectionEnd = selEnd + text.length; + mozWrap(textarea, text, '') + textarea.selectionStart = sel_start + text.length; + textarea.selectionEnd = sel_end + text.length; } else { - document.forms[form_name].elements[text_name].value = document.forms[form_name].elements[text_name].value + text; + textarea.value = textarea.value + text; } } @@ -187,11 +174,11 @@ function addquote(post_id, username) if (document.all) { - eval('divarea = document.all.' + message_name + ';'); + divarea = document.all[message_name]; } else { - eval("divarea = document.getElementById('" + message_name + "');"); + divarea = document.getElementById(message_name); } // Get text selection - not only the post content :( @@ -208,12 +195,15 @@ function addquote(post_id, username) theSelection = document.selection.createRange().text; } - if (theSelection == '') + if (theSelection == '' || typeof theSelection == 'undefined' || theSelection == null) { if (divarea.innerHTML) { theSelection = divarea.innerHTML.replace(/<br>/ig, '\n'); theSelection = theSelection.replace(/<br\/>/ig, '\n'); + theSelection = theSelection.replace(/<\;/ig, '<'); + theSelection = theSelection.replace(/>\;/ig, '>'); + theSelection = theSelection.replace(/&\;/ig, '&'); } else if (document.all) { @@ -254,11 +244,11 @@ function bbstyle(bbnumber) { butnumber = arraypop(bbcode) - 1; document.forms[form_name].elements[text_name].value += bbtags[butnumber + 1]; - buttext = eval('document.forms[form_name].addbbcode' + butnumber + '.value'); + buttext = document.forms[form_name]['addbbcode' + butnumber].value; if (buttext != '[*]') { - eval('document.forms[form_name].addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); + document.forms[form_name]['addbbcode' + butnumber].value = buttext.substr(0,(buttext.length - 1)); } } @@ -366,11 +356,11 @@ function bbstyle(bbnumber) insert_text(bbtags[butnumber]); } - buttext = eval('document.forms[form_name].addbbcode' + butnumber + '.value'); + buttext = document.forms[form_name]['addbbcode' + butnumber].value; if (bbtags[butnumber] != '[*]') { - eval('document.forms[form_name].addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); + document.forms[form_name]['addbbcode' + butnumber].value = buttext.substr(0,(buttext.length - 1)); } imageTag = false; } @@ -406,7 +396,7 @@ function bbstyle(bbnumber) if (bbtags[bbnumber] != '[*]') { arraypush(bbcode, bbnumber + 1); - eval('document.forms[form_name].addbbcode'+bbnumber+'.value += "*"'); + document.forms[form_name]['addbbcode' + bbnumber].value += "*"; } document.forms[form_name].elements[text_name].focus(); @@ -490,7 +480,7 @@ function colorPalette(dir, width, height) { color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]); document.write('<td bgcolor="#' + color + '">'); - document.write('<a href="javascript:bbfontstyle(\'[color=#' + color + ']\', \'[/color]\');" onmouseover="helpline(\'s\');"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" border="0" alt="#' + color + '" title="#' + color + '" /></a>'); + document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;" onmouseover="helpline(\'s\');"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>'); document.writeln('</td>'); } @@ -506,4 +496,4 @@ function colorPalette(dir, width, height) } } document.writeln('</table>'); -} +}
\ No newline at end of file diff --git a/phpBB/styles/subSilver/template/faq_body.html b/phpBB/styles/subSilver/template/faq_body.html index 55821f289e..81c9b6296c 100644 --- a/phpBB/styles/subSilver/template/faq_body.html +++ b/phpBB/styles/subSilver/template/faq_body.html @@ -54,14 +54,7 @@ </div> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <br clear="all" /> diff --git a/phpBB/styles/subSilver/template/viewforum_subforum.html b/phpBB/styles/subSilver/template/forumlist_body.html index 64a31583ee..5d0108d1f9 100644 --- a/phpBB/styles/subSilver/template/viewforum_subforum.html +++ b/phpBB/styles/subSilver/template/forumlist_body.html @@ -1,13 +1,12 @@ - -<table class="tablebg" width="100%" cellspacing="1"> +<table class="tablebg" cellspacing="1" width="100%"> <tr> <td class="cat" colspan="5" align="right"><a class="nav" href="{U_MARK_FORUMS}">{L_MARK_FORUMS_READ}</a> </td> </tr> <tr> - <th colspan="2" nowrap="nowrap"> {L_FORUM} </th> - <th width="50" nowrap="nowrap"> {L_TOPICS} </th> - <th width="50" nowrap="nowrap"> {L_POSTS} </th> - <th nowrap="nowrap"> {L_LAST_POST} </th> + <th colspan="2"> {L_FORUM} </th> + <th width="50"> {L_TOPICS} </th> + <th width="50"> {L_POSTS} </th> + <th> {L_LAST_POST} </th> </tr> <!-- BEGIN forumrow --> <!-- IF forumrow.S_IS_CAT --> @@ -17,20 +16,28 @@ </tr> <!-- ELSEIF forumrow.S_IS_LINK --> <tr> - <td class="row1" width="50" align="center" valign="middle">{forumrow.FORUM_FOLDER_IMG}</td> - <td class="row1"><a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><br /> - <table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td><span class="gensmall">{forumrow.FORUM_DESC}</span></td> - </tr> - </table> + <td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td> + <td class="row1"> + <!-- IF forumrow.FORUM_IMAGE --> + <div style="float: left;">{forumrow.FORUM_IMAGE}</div><div style="float: left;"> + <!-- 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> - <td class="row2" colspan="3" align="center" valign="middle"><!-- IF forumrow.CLICKS --><span class="genmed">{L_REDIRECTS}: {forumrow.CLICKS}</span><!-- ENDIF --></td> + <!-- IF forumrow.CLICKS --> + <td class="row2" colspan="3" align="center"><span class="genmed">{L_REDIRECTS}: {forumrow.CLICKS}</span></td> + <!-- ELSE --> + <td class="row2" colspan="3" align="center"> </td> + <!-- ENDIF --> </tr> <!-- ELSE --> <tr> - <td class="row1" width="50" align="center" valign="middle">{forumrow.FORUM_FOLDER_IMG}</td> + <td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td> <td class="row1" width="100%"> + <!-- IF forumrow.FORUM_IMAGE --> + <div style="float: left;">{forumrow.FORUM_IMAGE}</div><div style="float: left;"> + <!-- ENDIF --> <a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a> <p class="forumdesc">{forumrow.FORUM_DESC}</p> <!-- IF forumrow.MODERATORS --> @@ -39,6 +46,7 @@ <!-- IF forumrow.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> @@ -47,7 +55,7 @@ <p class="topicdetails">{forumrow.LAST_POST_TIME}</p> <p class="topicdetails"> <!-- IF forumrow.U_LAST_POSTER --> - <a href="{forumrow.U_LAST_POSTER}">{forumrow.LAST_POSTER}</a> + <a href="{forumrow.U_LAST_POSTER}"<!-- IF forumrow.LAST_POSTER_COLOUR --> style="font-weight: bold; color: {forumrow.LAST_POSTER_COLOUR}"<!-- ENDIF -->>{forumrow.LAST_POSTER}</a> <!-- ELSE --> {forumrow.LAST_POSTER} <!-- ENDIF --> @@ -59,7 +67,9 @@ </td> </tr> <!-- ENDIF --> +<!-- BEGINELSE --> + <tr> + <td class="row1" colspan="5" align="center"><p class="gensmall">{L_NO_FORUMS}</p></td> + </tr> <!-- END forumrow --> -</table> - -<br clear="all" /> +</table>
\ No newline at end of file diff --git a/phpBB/styles/subSilver/template/index.htm b/phpBB/styles/subSilver/template/index.htm index 79908c5993..4763c05f0e 100644 --- a/phpBB/styles/subSilver/template/index.htm +++ b/phpBB/styles/subSilver/template/index.htm @@ -8,7 +8,7 @@ <table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0"> <tr> - <td align="center" valign="middle"><a href="http://www.subblue.com/" target="_new"><img src="images/created_by.jpg" width="400" height="300" border="0" alt="Created by subBlue Design" /></a></td> + <td align="center" valign="middle"><a href="http://www.subblue.com/" target="_new"><img src="images/created_by.jpg" width="400" height="300" alt="Created by subBlue Design" /></a></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/index_body.html b/phpBB/styles/subSilver/template/index_body.html index e8dfafbcdf..894549fe08 100644 --- a/phpBB/styles/subSilver/template/index_body.html +++ b/phpBB/styles/subSilver/template/index_body.html @@ -8,84 +8,13 @@ <br clear="all" /><br /> <!-- ENDIF --> -<table class="tablebg" cellspacing="1" width="100%"> -<tr> - <td class="cat" colspan="5" align="right"><a class="nav" href="{U_MARK_FORUMS}">{L_MARK_FORUMS_READ}</a> </td> -</tr> -<tr> - <th colspan="2"> {L_FORUM} </th> - <th width="50"> {L_TOPICS} </th> - <th width="50"> {L_POSTS} </th> - <th> {L_LAST_POST} </th> -</tr> -<!-- BEGIN forumrow --> - <!-- IF forumrow.S_IS_CAT --> - <tr> - <td class="cat" colspan="2"><h4><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></h4></td> - <td class="catdiv" colspan="3"> </td> - </tr> - <!-- ELSEIF forumrow.S_IS_LINK --> - <tr> - <td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td> - <!-- IF forumrow.CLICKS --><td class="row1"><!-- ELSE --><td class="row1" colspan="4"><!-- ENDIF --> - <a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a> - <p class="forumdesc">{forumrow.FORUM_DESC}</p> - </td> - <!-- IF forumrow.CLICKS --> - <td class="row2" colspan="3" align="center"><span class="genmed">{L_REDIRECTS}: {forumrow.CLICKS}</span></td> - <!-- ENDIF --> - </tr> - <!-- ELSE --> - <tr> - <td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td> - <td class="row1" width="100%"> - <a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a> - <p class="forumdesc">{forumrow.FORUM_DESC}</p> - <!-- IF forumrow.MODERATORS --> - <p class="forumdesc"><strong>{forumrow.L_MODERATOR_STR}:</strong> {forumrow.MODERATORS}</p> - <!-- ENDIF --> - <!-- IF forumrow.SUBFORUMS --> - <p class="forumdesc"><strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}</p> - <!-- 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_LAST_POSTER --> - <a href="{forumrow.U_LAST_POSTER}">{forumrow.LAST_POSTER}</a> - <!-- ELSE --> - {forumrow.LAST_POSTER} - <!-- ENDIF --> - <a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a> - </p> - <!-- ELSE --> - <p class="topicdetails">{L_NO_POSTS}</p> - <!-- ENDIF --> - </td> - </tr> - <!-- ENDIF --> -<!-- BEGINELSE --> - <tr> - <td class="row1" colspan="5" align="center"><p class="gensmall">{L_NO_FORUMS}</p></td> - </tr> -<!-- END forumrow --> -</table> +<!-- INCLUDE forumlist_body.html --> <span class="gensmall"><a href="{U_DELETE_COOKIES}">{L_DELETE_COOKIES}</a> | <a href="{U_TEAM}">{L_THE_TEAM}</a></span><br /> <br clear="all" /> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <!-- IF S_DISPLAY_ONLINE_LIST --> <br clear="all" /> diff --git a/phpBB/styles/subSilver/template/jumpbox.html b/phpBB/styles/subSilver/template/jumpbox.html index 1f1b06d9be..2f54ebc488 100644 --- a/phpBB/styles/subSilver/template/jumpbox.html +++ b/phpBB/styles/subSilver/template/jumpbox.html @@ -4,7 +4,7 @@ <table cellspacing="0" cellpadding="0" border="0"> <tr> - <td nowrap="nowrap"><span class="gensmall"><!-- IF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->:</span> <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ forms['jumpbox'].submit() }"> + <td nowrap="nowrap"><span class="gensmall"><!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->:</span> <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ forms['jumpbox'].submit() }"> <!-- BEGIN jumpbox_forums --> <!-- IF jumpbox_forums.S_FORUM_COUNT eq 2 --><option value="-1">------------------</option><!-- ENDIF --> diff --git a/phpBB/styles/subSilver/template/login_body.html b/phpBB/styles/subSilver/template/login_body.html index b95e25b171..0d72ee8f3b 100644 --- a/phpBB/styles/subSilver/template/login_body.html +++ b/phpBB/styles/subSilver/template/login_body.html @@ -4,14 +4,18 @@ <table class="tablebg" width="100%" cellspacing="1"> <tr> - <th colspan="2">{L_LOGIN}</th> + <!-- IF not S_ADMIN_AUTH --> + <th colspan="2">{L_LOGIN}</th> + <!-- ELSE --> + <th>{LOGIN_EXPLAIN}</th> + <!-- ENDIF --> </tr> -<!-- IF LOGIN_EXPLAIN --> +<!-- IF LOGIN_EXPLAIN && not S_ADMIN_AUTH --> <tr> - <td class="row3" colspan="2" align="center"><span class="gensmall">{LOGIN_EXPLAIN}</td> + <td class="row3" colspan="2" align="center"><span class="gensmall">{LOGIN_EXPLAIN}</span></td> </tr> <!-- ENDIF --> -<tr> +<tr><!-- IF not S_ADMIN_AUTH --> <td class="row1" width="50%"> <p class="genmed">{L_LOGIN_INFO}</p> @@ -19,9 +23,10 @@ <a href="{U_TERMS_USE}">{L_TERMS_USE}</a> | <a href="{U_PRIVACY}">{L_PRIVACY}</a> </p> </td> - <td class="row2"> + <!-- ENDIF --> + <td <!-- IF not S_ADMIN_AUTH -->class="row2"<!-- ELSE -->class="row1"<!-- ENDIF -->> - <table cellspacing="1" cellpadding="4"> + <table align="center" cellspacing="1" cellpadding="4" style="width: 100%;"> <!-- IF LOGIN_ERROR --> <tr> <td class="gensmall" colspan="2" align="center"><span class="error">{LOGIN_ERROR}</span></td> @@ -29,7 +34,7 @@ <!-- ENDIF --> <tr> - <td valign="top"><b class="gensmall">{L_USERNAME}:</b></td> + <td valign="top" <!-- IF S_ADMIN_AUTH -->style="width: 50%; text-align: right;"<!-- ENDIF -->><b class="gensmall">{L_USERNAME}:</b></td> <td><input class="post" type="text" name="username" size="25" maxlength="40" value="{USERNAME}" tabindex="1" /> <!-- IF not S_ADMIN_AUTH --> <br /><a class="gensmall" href="{U_REGISTER}">{L_REGISTER}</a> @@ -37,7 +42,7 @@ </td> </tr> <tr> - <td valign="top"><b class="gensmall">{L_PASSWORD}:</b></td> + <td valign="top" <!-- IF S_ADMIN_AUTH -->style="width: 50%; text-align: right;"<!-- ENDIF -->><b class="gensmall">{L_PASSWORD}:</b></td> <td> <input class="post" type="password" name="password" size="25" maxlength="100" tabindex="2" /> <!-- IF U_SEND_PASSWORD --><br /><a class="gensmall" href="{U_SEND_PASSWORD}">{L_FORGOT_PASS}</a><!-- ENDIF --> @@ -45,10 +50,12 @@ </td> </tr> <!-- IF S_DISPLAY_FULL_LOGIN --> + <!-- IF S_AUTOLOGIN_ENABLED --> <tr> <td> </td> <td><input type="checkbox" class="radio" name="autologin" tabindex="3" /> <span class="gensmall">{L_LOG_ME_IN}</span></td> </tr> + <!-- ENDIF --> <tr> <td> </td> <td><input type="checkbox" class="radio" name="viewonline" tabindex="4" /> <span class="gensmall">{L_HIDE_ME}</span></td> @@ -57,7 +64,10 @@ </table> </td> </tr> + <!-- IF S_CONFIRM_CODE --> +</table> +<table class="tablebg" width="100%" cellspacing="1"> <tr> <th colspan="2" valign="middle">{L_LOGIN_CONFIRMATION}</th> </tr> @@ -84,14 +94,7 @@ <br clear="all" /> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <br clear="all" /> diff --git a/phpBB/styles/subSilver/template/login_forum.html b/phpBB/styles/subSilver/template/login_forum.html index 897631c92a..29c85a78ed 100644 --- a/phpBB/styles/subSilver/template/login_forum.html +++ b/phpBB/styles/subSilver/template/login_forum.html @@ -9,7 +9,7 @@ <th>{L_LOGIN}</th> </tr> <tr> - <td class="row3" align="center"><span class="gensmall">{L_LOGIN_FORUM}</td> + <td class="row3" align="center"><span class="gensmall">{L_LOGIN_FORUM}</span></td> </tr> <tr> <td class="row1" align="center"> @@ -38,14 +38,7 @@ <br clear="all" /> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <br clear="all" /> diff --git a/phpBB/styles/subSilver/template/mcp_approve.html b/phpBB/styles/subSilver/template/mcp_approve.html index e62476879e..b8e89b330a 100644 --- a/phpBB/styles/subSilver/template/mcp_approve.html +++ b/phpBB/styles/subSilver/template/mcp_approve.html @@ -41,14 +41,7 @@ <br clear="all" /> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <br clear="all" /> diff --git a/phpBB/styles/subSilver/template/mcp_ban.html b/phpBB/styles/subSilver/template/mcp_ban.html index 4b4655570b..fff3d350d1 100644 --- a/phpBB/styles/subSilver/template/mcp_ban.html +++ b/phpBB/styles/subSilver/template/mcp_ban.html @@ -4,19 +4,19 @@ <!-- var ban_length = new Array(); - ban_length[-1] = ""; + ban_length[-1] = ''; <!-- BEGIN ban_length --> ban_length['{ban_length.BAN_ID}'] = "{ban_length.A_LENGTH}"; <!-- END ban_length --> var ban_reason = new Array(); - ban_reason[-1] = ""; + ban_reason[-1] = ''; <!-- BEGIN ban_reason --> ban_reason['{ban_reason.BAN_ID}'] = "{ban_reason.A_REASON}"; <!-- END ban_reason --> var ban_give_reason = new Array(); - ban_give_reason[-1] = ""; + ban_give_reason[-1] = ''; <!-- BEGIN ban_give_reason --> ban_give_reason['{ban_give_reason.BAN_ID}'] = "{ban_give_reason.A_REASON}"; <!-- END ban_give_reason --> diff --git a/phpBB/styles/subSilver/template/mcp_footer.html b/phpBB/styles/subSilver/template/mcp_footer.html index 77bc2c6ee4..0b3680bf9e 100644 --- a/phpBB/styles/subSilver/template/mcp_footer.html +++ b/phpBB/styles/subSilver/template/mcp_footer.html @@ -8,7 +8,7 @@ <tr> <td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td> <td class="gensmall" nowrap="nowrap"> [ {TOTAL} ] </td> - <td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- IF PAGINATION --><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --></td> + <td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- INCLUDE pagination.html --></td> </tr> </table> <br /> @@ -18,14 +18,7 @@ <br clear="all" /> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <br clear="all" /> diff --git a/phpBB/styles/subSilver/template/mcp_forum.html b/phpBB/styles/subSilver/template/mcp_forum.html index 02ce06096e..4aa6050a8d 100644 --- a/phpBB/styles/subSilver/template/mcp_forum.html +++ b/phpBB/styles/subSilver/template/mcp_forum.html @@ -1,7 +1,11 @@ <!-- INCLUDE mcp_header.html --> +<!-- IF S_MERGE_SELECT --><div style="float: right;"><!-- INCLUDE jumpbox.html --></div><!-- ENDIF --> + <!-- IF U_VIEW_FORUM_LOGS --><a href="{U_VIEW_FORUM_LOGS}">{L_VIEW_FORUM_LOGS}</a><!-- ENDIF --> +<!-- IF S_MERGE_SELECT --><br clear="right" /><!-- ENDIF --> + <form method="post" id="mcp" action="{S_MCP_ACTION}"> <table class="tablebg" width="100%" cellspacing="1"> @@ -46,6 +50,7 @@ <tr> <td class="cat" colspan="6" align="right"> <select name="action"> + <option value="" checked="checked">{L_SELECT_ACTION}</option> <!-- IF S_CAN_DELETE --><option value="delete_topic">{L_DELETE}</option><!-- ENDIF --> <!-- IF S_CAN_MOVE --><option value="move">{L_MOVE}</option><!-- ENDIF --> <!-- IF S_CAN_FORK --><option value="fork">{L_FORK}</option><!-- ENDIF --> @@ -61,7 +66,7 @@ <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> - <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="javascript:marklist('mcp', 'topic_id_list', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('mcp', 'topic_id_list', false);">{L_UNMARK_ALL}</a></b></td> + <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="#" onclick="marklist('mcp', 'topic_id_list', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'topic_id_list', false); return false;">{L_UNMARK_ALL}</a></b></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/mcp_move.html b/phpBB/styles/subSilver/template/mcp_move.html index 04254307fa..78a0579de6 100644 --- a/phpBB/styles/subSilver/template/mcp_move.html +++ b/phpBB/styles/subSilver/template/mcp_move.html @@ -36,14 +36,7 @@ <br clear="all" /> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <br clear="all" /> diff --git a/phpBB/styles/subSilver/template/mcp_notes_user.html b/phpBB/styles/subSilver/template/mcp_notes_user.html index 8fed004306..094ee093d8 100755 --- a/phpBB/styles/subSilver/template/mcp_notes_user.html +++ b/phpBB/styles/subSilver/template/mcp_notes_user.html @@ -110,7 +110,7 @@ <table width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pagination">{PAGE_NUMBER} [ {TOTAL_REPORTS} ]</td> - <td align="right"><span class="pagination"><!-- IF PAGINATION --><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --><!-- ENDIF --></span></td> + <td align="right"><span class="pagination"><!-- INCLUDE pagination.html --></span></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/mcp_post.html b/phpBB/styles/subSilver/template/mcp_post.html index e36106bf4a..e4e8d38cab 100644 --- a/phpBB/styles/subSilver/template/mcp_post.html +++ b/phpBB/styles/subSilver/template/mcp_post.html @@ -127,12 +127,8 @@ <td colspan="2" class="cat"><b class="gen">{L_OTHER_USERS}</b></td> </tr> <!-- BEGIN userrow --> - <!-- IF userrow.S_ROW_COUNT is even --> - <tr class="row1"> - <!-- ELSE --> - <tr class="row2"> - <!-- ENDIF --> - <td><span class="gen"><a href="{userrow.U_PROFILE}">{userrow.USERNAME}</a> [ {userrow.NUM_POSTS} {userrow.L_POST_S} ]</span></td> + <!-- IF userrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> + <td><span class="gen"><!-- IF userrow.U_PROFILE --><a href="{userrow.U_PROFILE}">{userrow.USERNAME}</a><!-- ELSE -->{userrow.USERNAME}<!-- ENDIF --> [ {userrow.NUM_POSTS} {userrow.L_POST_S} ]</span></td> <td align="center"><a href="{userrow.U_SEARCHPOSTS}">{SEARCH_IMG}</a></td> </tr> <!-- BEGINELSE --> diff --git a/phpBB/styles/subSilver/template/mcp_queue.html b/phpBB/styles/subSilver/template/mcp_queue.html index 36de61f6dc..c75c0403cd 100644 --- a/phpBB/styles/subSilver/template/mcp_queue.html +++ b/phpBB/styles/subSilver/template/mcp_queue.html @@ -39,7 +39,7 @@ <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> - <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="javascript:marklist('mcp', '', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('mcp', '', false);">{L_UNMARK_ALL}</a></b></td> + <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="#" onclick="marklist('mcp', '', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', '', false); return false;">{L_UNMARK_ALL}</a></b></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/mcp_reports.html b/phpBB/styles/subSilver/template/mcp_reports.html index f0c1281b0b..40c57ab076 100644 --- a/phpBB/styles/subSilver/template/mcp_reports.html +++ b/phpBB/styles/subSilver/template/mcp_reports.html @@ -23,7 +23,7 @@ <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="left" valign="top" nowrap="nowrap"><span class="gen"><!-- IF postrow.U_VIEW_POSTER_PROFILE --><a href="{postrow.U_VIEW_POSTER_PROFILE}">{postrow.POSTER}</a><!-- ELSE -->{postrow.POSTER}<!-- ENDIF --></span><br /> <span class="gensmall">{postrow.POST_TIME}</span></td> - <td style="padding: 4px;" align="left" valign="top" nowrap="nowrap"><span class="gen"><!-- IF postrow.U_VIEW_REPORTER_PROFILE --><a href="{postrow.U_VIEW_REPOTER_PROFILE}">{postrow.REPORTER}</a><!-- ELSE -->{postrow.REPORTER}<!-- ENDIF --></span></td> + <td style="padding: 4px;" align="left" valign="top" nowrap="nowrap"><span class="gen"><!-- IF postrow.U_VIEW_REPORTER_PROFILE --><a href="{postrow.U_VIEW_REPORTER_PROFILE}">{postrow.REPORTER}</a><!-- ELSE -->{postrow.REPORTER}<!-- ENDIF --></span></td> <td style="padding: 4px;" align="left" 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> <td align="center"><input type="checkbox" class="radio" name="post_id_list[]" value="{postrow.POST_ID}" /></td> @@ -48,7 +48,7 @@ <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> - <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="javascript:marklist('mcp', '', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('mcp', '', false);">{L_UNMARK_ALL}</a></b></td> + <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="#" onclick="marklist('mcp', '', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', '', false); return false;">{L_UNMARK_ALL}</a></b></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/mcp_topic.html b/phpBB/styles/subSilver/template/mcp_topic.html index 119648289f..d0edb48470 100644 --- a/phpBB/styles/subSilver/template/mcp_topic.html +++ b/phpBB/styles/subSilver/template/mcp_topic.html @@ -133,7 +133,7 @@ <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> - <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="javascript:marklist('mcp', '', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('mcp', '', false);">{L_UNMARK_ALL}</a></b></td> + <td align="right" valign="top" nowrap="nowrap"><b class="gensmall"><a href="#" onclick="marklist('mcp', '', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', '', false); return false;">{L_UNMARK_ALL}</a></b></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/mcp_viewlogs.html b/phpBB/styles/subSilver/template/mcp_viewlogs.html index 262dd0dcb1..3c18865dd7 100644 --- a/phpBB/styles/subSilver/template/mcp_viewlogs.html +++ b/phpBB/styles/subSilver/template/mcp_viewlogs.html @@ -20,7 +20,7 @@ </tr> <!-- IF S_TOPIC_ID --> <tr> - <td class="row3" colspan="5"><span class="gensmall">{L_LOGS_CURRENT_TOPIC} <a href="{U_VIEWTOPIC}"><b>{TOPIC_NAME}</b></a></td> + <td class="row3" colspan="5"><span class="gensmall">{L_LOGS_CURRENT_TOPIC} <a href="{U_VIEWTOPIC}"><b>{TOPIC_NAME}</b></a></span></td> </tr> <!-- ENDIF --> <!-- BEGIN log --> @@ -45,7 +45,7 @@ <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> <tr> <td class="nav" align="left" valign="middle">{PAGE_NUMBER}</td> - <td align="right" valign="top" nowrap="nowrap"><!-- IF PAGINATION --><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --></td> + <td align="right" valign="top" nowrap="nowrap"><!-- INCLUDE pagination.html --></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/mcp_warn_list.html b/phpBB/styles/subSilver/template/mcp_warn_list.html index 9e0e78c103..f3ff9d4490 100755 --- a/phpBB/styles/subSilver/template/mcp_warn_list.html +++ b/phpBB/styles/subSilver/template/mcp_warn_list.html @@ -32,7 +32,7 @@ <table width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pagination">{PAGE_NUMBER} [ {TOTAL_USERS} ]</td> - <td align="right"><span class="pagination"><!-- IF PAGINATION --><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --><!-- ENDIF --></span></td> + <td align="right"><span class="pagination"><!-- INCLUDE pagination.html --></span></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/memberlist_body.html b/phpBB/styles/subSilver/template/memberlist_body.html index b707dede69..69701027b4 100644 --- a/phpBB/styles/subSilver/template/memberlist_body.html +++ b/phpBB/styles/subSilver/template/memberlist_body.html @@ -89,20 +89,13 @@ <table width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pagination">{PAGE_NUMBER} [ {TOTAL_USERS} ]</td> - <td align="right"><!-- IF S_SEARCH_USER and S_FORM_NAME --><b class="nav"><a href="javascript:marklist('results', 'user', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('results', 'user', false);">{L_UNMARK_ALL}</a></b><br /><!-- ENDIF --><span class="pagination"><!-- IF PAGINATION --><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --><!-- ENDIF --></span></td> + <td align="right"><!-- IF S_SEARCH_USER and S_FORM_NAME --><b class="nav"><a href="#" onclick="marklist('results', 'user', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('results', 'user', false); return false;">{L_UNMARK_ALL}</a></b><br /><!-- ENDIF --><span class="pagination"><!-- INCLUDE pagination.html --></span></td> </tr> </table> <br clear="all" /> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <br clear="all" /> diff --git a/phpBB/styles/subSilver/template/memberlist_email.html b/phpBB/styles/subSilver/template/memberlist_email.html index 408c45e280..1e4d7e9930 100644 --- a/phpBB/styles/subSilver/template/memberlist_email.html +++ b/phpBB/styles/subSilver/template/memberlist_email.html @@ -89,14 +89,7 @@ function checkForm(formObj) <br clear="all" /> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <br clear="all" /> diff --git a/phpBB/styles/subSilver/template/memberlist_im.html b/phpBB/styles/subSilver/template/memberlist_im.html index beddf8804b..bfb80ec17a 100644 --- a/phpBB/styles/subSilver/template/memberlist_im.html +++ b/phpBB/styles/subSilver/template/memberlist_im.html @@ -28,7 +28,77 @@ <!-- IF S_SEND_MSNM --> <tr> - <td class="row1" colspan="2" align="center"><object classid="clsid:FB7199AB-79BF-11d2-8D94-0000F875C541" codetype="application/x-oleobject" id="objMessengerApp" width="0" height="0"></object><br /><a class="gen" href="javascript:objMessengerApp.LaunchAddContactUI('{IM_CONTACT}')">{L_IM_ADD_CONTACT}</a><br /><a class="gen" href="javascript:objMessengerApp.LaunchIMUI('{IM_CONTACT}')">{L_IM_SEND_MESSAGE}</a></td> + <td class="row1" colspan="2" align="center"> + <object classid="clsid:B69003B3-C55E-4B48-836C-BC5946FC3B28" codetype="application/x-oleobject" id="objMessengerApp" width="0" height="0"></object> + <script language="javascript" type="text/javascript"> + <!-- + var app = document.getElementById('objMessengerApp'); + + /** + * Check whether the browser supports this and whether MSNM is connected + */ + function msn_supported() { + //Does the browser support the MSNM object? + if (app.MyStatus) + { + //Is MSNM connected? + if (app.MyStatus == 1) + { + alert('{L_IM_MSNM_CONNECT}'); + return false; + } + } + else + { + alert('{L_IM_MSNM_BROWSER}'); + return false; + } + return true; + } + + /** + * Add to your contact list + */ + function add_contact(address) + { + if (msn_supported()) + { + //Could return an error while MSNM is connecting, don't want that + try + { + app.AddContact(0, address); + } + catch (e) + { + return; + } + } + + } + + /** + * Write IM to contact + */ + function im_contact(address) + { + if (msn_supported()) + { + //Could return an error while MSNM is connecting, don't want that + try + { + app.InstantMessage(address); + } + catch (e) + { + return; + } + } + } + //--> + </script> + + <a class="gen" href="#" onclick="add_contact('{IM_CONTACT}'); return false;">{L_IM_ADD_CONTACT}</a><br /><a class="gen" href="#" onclick="im_contact('{IM_CONTACT}'); return false;">{L_IM_SEND_MESSAGE}</a> + </td> </tr> <tr> <td class="cat" colspan="2" align="center"> </td> diff --git a/phpBB/styles/subSilver/template/memberlist_leaders.html b/phpBB/styles/subSilver/template/memberlist_leaders.html index 009efd5555..82009e1365 100644 --- a/phpBB/styles/subSilver/template/memberlist_leaders.html +++ b/phpBB/styles/subSilver/template/memberlist_leaders.html @@ -62,14 +62,7 @@ <br clear="all" /> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <br clear="all" /> diff --git a/phpBB/styles/subSilver/template/memberlist_view.html b/phpBB/styles/subSilver/template/memberlist_view.html index 1443997d00..5ed1c8818e 100644 --- a/phpBB/styles/subSilver/template/memberlist_view.html +++ b/phpBB/styles/subSilver/template/memberlist_view.html @@ -46,7 +46,7 @@ <!-- ENDIF --> <!-- IF S_USER_LOGGED_IN and S_ZEBRA --> <tr> - <td class="genmed" align="center">[ <a href="{U_ADD_FRIEND}">{L_ADD_FRIEND}</a> | <a href="{U_ADD_FOE}">{L_ADD_FOE}</a> ]</td> + <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> </tr> <!-- ENDIF --> </table> @@ -124,30 +124,30 @@ </table> </td> <td class="row1"> - <table cellspacing="1" cellpadding="2" border="0"> + <table cellspacing="1" cellpadding="2" border="0"> <tr> <td class="gen" align="right" nowrap="nowrap">{L_USERGROUPS}: </td> <td><select name="g">{S_GROUP_OPTIONS}</select> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /></td> </tr> <tr> <td class="gen" align="right" nowrap="nowrap">{L_LOCATION}: </td> - <td><b class="genmed">{LOCATION}</b></td> + <td><!-- IF LOCATION --><b class="genmed">{LOCATION}</b><!-- ENDIF --></td> </tr> <tr> <td class="gen" align="right" nowrap="nowrap">{L_AGE}: </td> - <td><b class="genmed">{AGE}</b></td> + <td><!-- IF AGE --><b class="genmed">{AGE}</b><!-- ENDIF --></td> </tr> <tr> <td class="gen" align="right" nowrap="nowrap">{L_OCCUPATION}: </td> - <td><b class="genmed">{OCCUPATION}</b></td> + <td><!-- IF OCCUPATION --><b class="genmed">{OCCUPATION}</b><!-- ENDIF --></td> </tr> <tr> <td class="gen" align="right" nowrap="nowrap">{L_INTERESTS}: </td> - <td><b class="genmed">{INTERESTS}</b></td> + <td><!-- IF INTERESTS --><b class="genmed">{INTERESTS}</b><!-- ENDIF --></td> </tr> <tr> <td class="gen" align="right" nowrap="nowrap">{L_WEBSITE}: </td> - <td><b><!-- IF U_WWW --><a class="genmed" href="{U_WWW}" target="_userwww">{U_WWW}</a><!-- ENDIF --></b></td> + <td><!-- IF U_WWW --><b><a class="genmed" href="{U_WWW}" target="_userwww">{U_WWW}</a></b><!-- ENDIF --></td> </tr> <!-- IF S_PROFILE_FIELD1 --> <!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. --> @@ -181,14 +181,7 @@ <br clear="all" /> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <br clear="all" /> diff --git a/phpBB/styles/subSilver/template/overall_footer.html b/phpBB/styles/subSilver/template/overall_footer.html index 9288a50415..2669864e11 100644 --- a/phpBB/styles/subSilver/template/overall_footer.html +++ b/phpBB/styles/subSilver/template/overall_footer.html @@ -10,12 +10,13 @@ forums may be affected. The phpBB Group : 2006 -// --> +//--> <div id="wrapfooter"> <!-- IF U_ACP --><span class="gensmall">[ <a href="{U_ACP}">{L_ACP}</a> ]</span><br /><br /><!-- ENDIF --> <span class="copyright">Powered by <a href="http://www.phpbb.com/" target="_blank">phpBB</a> © 2002, 2006 phpBB Group - {L_TRANSLATION_INFO}<!-- IF DEBUG_OUTPUT --><br />[ {DEBUG_OUTPUT} ]<!-- ENDIF --></span> + <!-- IF L_TRANSLATION_INFO --><br />{L_TRANSLATION_INFO}<!-- ENDIF --> + <!-- IF DEBUG_OUTPUT --><br />[ {DEBUG_OUTPUT} ]<!-- ENDIF --></span> </div> </body> diff --git a/phpBB/styles/subSilver/template/overall_header.html b/phpBB/styles/subSilver/template/overall_header.html index 4a728f5230..3035cb61b2 100644 --- a/phpBB/styles/subSilver/template/overall_header.html +++ b/phpBB/styles/subSilver/template/overall_header.html @@ -1,16 +1,16 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}"> +<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}"> <head> <meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" /> +<meta http-equiv="content-language" content="{S_USER_LANG}" /> +<meta http-equiv="content-style-type" content="text/css" /> +<meta http-equiv="imagetoolbar" content="no" /> <meta name="resource-type" content="document" /> -<meta name="language" content="{S_USER_LANG}" /> <meta name="distribution" content="global" /> <meta name="copyright" content="2002-2006 phpBB Group" /> <meta name="keywords" content="" /> <meta name="description" content="" /> -<meta http-equiv="content-style-type" content="text/css" /> -<meta http-equiv="imagetoolbar" content="no" /> {META} <title>{SITENAME} • {PAGE_TITLE}</title> @@ -75,10 +75,48 @@ function marklist(id, name, state) } } +<!-- IF ._file --> + + /** + * Play quicktime file by determining it's width/height + * from the displayed rectangle area + * + * Only defined if there is a file block present. + */ + function play_qt_file(obj) + { + var rectangle = obj.GetRectangle(); + + if (rectangle) + { + rectangle = rectangle.split(',') + var x1 = parseInt(rectangle[0]); + var x2 = parseInt(rectangle[2]); + var y1 = parseInt(rectangle[1]); + var y2 = parseInt(rectangle[3]); + + var width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1; + var height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1; + } + else + { + var width = 200; + var height = 0; + } + + obj.width = width; + obj.height = height + 16; + + obj.SetControllerVisible(true); + + obj.Play(); + } +<!-- ENDIF --> + //--> </script> </head> -<body> +<body class="{S_CONTENT_DIRECTION}"> <a name="top"></a> @@ -97,15 +135,15 @@ function marklist(id, name, state) <table width="100%" cellspacing="0"> <tr> <td class="genmed"> - <!-- IF not S_IS_BOT --><a href="{U_LOGIN_LOGOUT}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_LOGIN_LOGOUT}" /> {L_LOGIN_LOGOUT}</a> <!-- ENDIF --> - <!-- IF U_RESTORE_PERMISSIONS --> <a href="{U_RESTORE_PERMISSIONS}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" border="0" alt="{L_RESTORE_PERMISSIONS}" /> {L_RESTORE_PERMISSIONS}</a><!-- ENDIF --> + <!-- IF not S_IS_BOT --><a href="{U_LOGIN_LOGOUT}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="{L_LOGIN_LOGOUT}" /> {L_LOGIN_LOGOUT}</a> <!-- ENDIF --> + <!-- IF U_RESTORE_PERMISSIONS --> <a href="{U_RESTORE_PERMISSIONS}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="{L_RESTORE_PERMISSIONS}" /> {L_RESTORE_PERMISSIONS}</a><!-- ENDIF --> <!-- IF S_BOARD_DISABLED --> <span style="color: red;">{L_BOARD_DISABLED}</span><!-- ENDIF --> <!-- IF S_USER_LOGGED_IN --> - <!-- IF S_DISPLAY_PM --> <a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{L_PRIVATE_MESSAGES}" /> {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a><!-- ENDIF --> - <!-- ELSE --> <a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" border="0" alt="{L_REGISTER}" /> {L_REGISTER}</a> + <!-- IF S_DISPLAY_PM --> <a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="{L_PRIVATE_MESSAGES}" /> {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a><!-- ENDIF --> + <!-- ELSE --> <a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" alt="{L_REGISTER}" /> {L_REGISTER}</a> <!-- ENDIF --> </td> - <td class="genmed" align="right"><a href="{U_FAQ}"><img src="{T_THEME_PATH}/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" /> {L_FAQ}</a><!-- IF S_DISPLAY_SEARCH --> <a href="{U_SEARCH}"><img src="{T_THEME_PATH}/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" /> {L_SEARCH}</a><!-- ENDIF --><!-- IF S_DISPLAY_MEMBERLIST --> <a href="{U_MEMBERLIST}"><img src="{T_THEME_PATH}/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" /> {L_MEMBERLIST}</a><!-- ENDIF --><!-- IF S_USER_LOGGED_IN --> <a href="{U_PROFILE}"><img src="{T_THEME_PATH}/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_PROFILE}" /> {L_PROFILE}</a><!-- ENDIF --></td> + <td class="genmed" align="right"><a href="{U_FAQ}"><img src="{T_THEME_PATH}/images/icon_mini_faq.gif" width="12" height="13" alt="{L_FAQ}" /> {L_FAQ}</a><!-- IF S_DISPLAY_SEARCH --> <a href="{U_SEARCH}"><img src="{T_THEME_PATH}/images/icon_mini_search.gif" width="12" height="13" alt="{L_SEARCH}" /> {L_SEARCH}</a><!-- ENDIF --><!-- IF S_DISPLAY_MEMBERLIST --> <a href="{U_MEMBERLIST}"><img src="{T_THEME_PATH}/images/icon_mini_members.gif" width="12" height="13" alt="{L_MEMBERLIST}" /> {L_MEMBERLIST}</a><!-- ENDIF --><!-- IF S_USER_LOGGED_IN --> <a href="{U_PROFILE}"><img src="{T_THEME_PATH}/images/icon_mini_profile.gif" width="12" height="13" alt="{L_PROFILE}" /> {L_PROFILE}</a><!-- ENDIF --></td> </tr> </table> </div> @@ -134,13 +172,6 @@ function marklist(id, name, state) <br style="clear: both;" /> - <table class="tablebg" width="100%" cellspacing="1" cellpadding="0" style="margin-top: 5px;"> - <tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> - </tr> - </table> + <!-- INCLUDE breadcrumbs.html --> <br /> diff --git a/phpBB/styles/subSilver/template/pagination.html b/phpBB/styles/subSilver/template/pagination.html new file mode 100644 index 0000000000..fa636e5bad --- /dev/null +++ b/phpBB/styles/subSilver/template/pagination.html @@ -0,0 +1 @@ +<!-- IF PAGINATION --><b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF -->
\ No newline at end of file diff --git a/phpBB/styles/subSilver/template/posting_attach_body.html b/phpBB/styles/subSilver/template/posting_attach_body.html index 2a9c7b21c2..a16758bf33 100644 --- a/phpBB/styles/subSilver/template/posting_attach_body.html +++ b/phpBB/styles/subSilver/template/posting_attach_body.html @@ -39,7 +39,7 @@ <td valign="top"> <table border="0" cellspacing="4" cellpadding="0"> <tr> - <td><input class="btnlite" type="submit" style="width:150px" name="add_file" value="{L_ADD_FILE}" onclick="javascript:popup_progress_bar();" /></td> + <td><input class="btnlite" type="submit" style="width:150px" name="add_file" value="{L_ADD_FILE}" onclick="popup_progress_bar();" /></td> </tr> </table> </td> @@ -60,7 +60,7 @@ </tr> <tr> <td class="row1"><b class="genmed">{L_FILE_COMMENT}</b></td> - <td class="row2"> + <td class="row2">{attach_row.S_HIDDEN} <table border="0" cellspacing="0" cellpadding="2"> <tr> <td><textarea class="post" name="comment_list[{attach_row.ASSOC_INDEX}]" rows="3" cols="35" wrap="virtual" size="40">{attach_row.FILE_COMMENT}</textarea> </td> @@ -78,7 +78,6 @@ </table> </td> </tr> - {attach_row.S_HIDDEN} <!-- END attach_row --> <!-- ENDIF --> diff --git a/phpBB/styles/subSilver/template/posting_body.html b/phpBB/styles/subSilver/template/posting_body.html index d9924ddcc6..7cc66d92fe 100644 --- a/phpBB/styles/subSilver/template/posting_body.html +++ b/phpBB/styles/subSilver/template/posting_body.html @@ -16,22 +16,25 @@ bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]',' imageTag = false; // Helpline messages -b_help = "{LA_BBCODE_B_HELP}"; -i_help = "{LA_BBCODE_I_HELP}"; -u_help = "{LA_BBCODE_U_HELP}"; -q_help = "{LA_BBCODE_Q_HELP}"; -c_help = "{LA_BBCODE_C_HELP}"; -l_help = "{LA_BBCODE_L_HELP}"; -o_help = "{LA_BBCODE_O_HELP}"; -p_help = "{LA_BBCODE_P_HELP}"; -w_help = "{LA_BBCODE_W_HELP}"; -a_help = "{LA_BBCODE_A_HELP}"; -s_help = "{LA_BBCODE_S_HELP}"; -f_help = "{LA_BBCODE_F_HELP}"; -e_help = "{LA_BBCODE_E_HELP}"; -d_help = "{LA_BBCODE_D_HELP}"; -<!-- BEGIN custom_tags -->cb_{custom_tags.BBCODE_ID}_help = "{custom_tags.BBCODE_HELPLINE}";<!-- END custom_tags --> - +var help_line = { + b: '{LA_BBCODE_B_HELP}', + i: '{LA_BBCODE_I_HELP}', + u: '{LA_BBCODE_U_HELP}', + q: '{LA_BBCODE_Q_HELP}', + c: '{LA_BBCODE_C_HELP}', + l: '{LA_BBCODE_L_HELP}', + o: '{LA_BBCODE_O_HELP}', + p: '{LA_BBCODE_P_HELP}', + w: '{LA_BBCODE_W_HELP}', + a: '{LA_BBCODE_A_HELP}', + s: '{LA_BBCODE_S_HELP}', + f: '{LA_BBCODE_F_HELP}', + e: '{LA_BBCODE_E_HELP}', + d: '{LA_BBCODE_D_HELP}' + <!-- BEGIN custom_tags --> + ,cb_{custom_tags.BBCODE_ID}: '{custom_tags.BBCODE_HELPLINE}' + <!-- END custom_tags --> +} function checkForm() { @@ -194,7 +197,7 @@ function checkForm() <td class="row2"> <!-- BEGIN to_recipient --> <span class="genmed"> - <a href="{to_recipient.U_VIEW}"><!-- IF to_recipient.COLOUR --><b style="color:#{to_recipient.COLOUR}"><!-- ELSE --><b<!-- IF to_recipient.IS_GROUP --> class="blue"<!-- ENDIF -->><!-- ENDIF -->{to_recipient.NAME}</b></a> </span><!-- IF not S_EDIT_POST --><input class="post" type="submit" name="remove_{to_recipient.TYPE}[{to_recipient.UG_ID}]" value="{L_REMOVE}" /> <!-- ENDIF --> + <a href="{to_recipient.U_VIEW}"<!-- IF to_recipient.COLOUR --> style="color:#{to_recipient.COLOUR}"<!-- ELSEIF to_recipient.IS_GROUP --> class="blue"<!-- ENDIF -->><b>{to_recipient.NAME}</b></a> </span><!-- IF not S_EDIT_POST --><input class="post" type="submit" name="remove_{to_recipient.TYPE}[{to_recipient.UG_ID}]" value="{L_REMOVE}" /> <!-- ENDIF --> <!-- BEGINELSE --> <span class="genmed">{L_NO_TO_RECIPIENT}</span> <!-- END to_recipient --> @@ -205,7 +208,7 @@ function checkForm() <td class="row2"> <!-- BEGIN bcc_recipient --> <span class="genmed"> - <a href="{bcc_recipient.U_VIEW}"><!-- IF bcc_recipient.COLOUR --><b style="color:#{bcc_recipient.COLOUR}"><!-- ELSE --><b<!-- IF bcc_recipient.IS_GROUP --> class="blue"<!-- ENDIF -->><!-- ENDIF -->{bcc_recipient.NAME}</b></a> </span><!-- IF not S_EDIT_POST --><input class="post" type="submit" name="remove_{bcc_recipient.TYPE}[{bcc_recipient.UG_ID}]" value="Remove" /> <!-- ENDIF --> + <a href="{bcc_recipient.U_VIEW}"<!-- IF bcc_recipient.COLOUR --> style="color:#{bcc_recipient.COLOUR}"<!-- ELSEIF bcc_recipient.IS_GROUP --> class="blue"<!-- ENDIF -->><b>{bcc_recipient.NAME}</b></a> </span><!-- IF not S_EDIT_POST --><input class="post" type="submit" name="remove_{bcc_recipient.TYPE}[{bcc_recipient.UG_ID}]" value="Remove" /> <!-- ENDIF --> <!-- BEGINELSE --> <span class="genmed">{L_NO_BCC_RECIPIENT}</span> <!-- END bcc_recipient --> @@ -216,17 +219,21 @@ function checkForm() <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="60" tabindex="2" value="{SUBJECT}" /></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" valign="top"><b class="genmed">{L_MESSAGE_BODY}:</b><br /><span class="gensmall">{L_MESSAGE_BODY_EXPLAIN}</span><br /><br /> + <td class="row1" valign="top"><b class="genmed">{L_MESSAGE_BODY}:</b><br /><span class="gensmall">{L_MESSAGE_BODY_EXPLAIN} </span><br /><br /> <!-- IF S_SMILIES_ALLOWED --> <table width="100%" cellspacing="5" cellpadding="0" border="0" align="center"> <tr> <td class="gensmall" align="center"><b>{L_SMILIES}</b></td> </tr> <tr> - <td align="center"><!-- BEGIN smiley --><a href="javascript:smiley('{smiley.A_SMILEY_CODE}')" style="line-height: 20px;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" border="0" alt="{smiley.SMILEY_DESC}" title="{smiley.SMILEY_DESC}" onclick="smiley('{smiley.A_SMILEY_CODE}');return false" hspace="2" vspace="2" /></a> <!-- END smiley --></td> + <td align="center"> + <!-- BEGIN smiley --> + <a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true); return false;" style="line-height: 20px;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_DESC}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a> + <!-- END smiley --> + </td> </tr> <!-- IF S_SHOW_SMILEY_LINK --> @@ -246,20 +253,28 @@ function checkForm() <input type="button" class="btnbbcode" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" /> <input type="button" class="btnbbcode" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" /> <input type="button" class="btnbbcode" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" /> - <!-- IF S_BBCODE_QUOTE --><input type="button" class="btnbbcode" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" /><!-- ENDIF --> + <!-- IF S_BBCODE_QUOTE --> + <input type="button" class="btnbbcode" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" /> + <!-- ENDIF --> <input type="button" class="btnbbcode" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" /> <input type="button" class="btnbbcode" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" /> <input type="button" class="btnbbcode" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" /> - <!-- IF S_BBCODE_IMG --><input type="button" class="btnbbcode" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /><!-- ENDIF --> - <input type="button" class="btnbbcode" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" /> - <!-- IF S_BBCODE_FLASH --><input type="button" class="btnbbcode" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" /><!-- ENDIF --> + <!-- IF S_BBCODE_IMG --> + <input type="button" class="btnbbcode" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /> + <!-- ENDIF --> + <!-- IF S_LINKS_ALLOWED --> + <input type="button" class="btnbbcode" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" /> + <!-- ENDIF --> + <!-- IF S_BBCODE_FLASH --> + <input type="button" class="btnbbcode" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" /> + <!-- ENDIF --> <span class="genmed" style="white-space: nowrap;">{L_FONT_SIZE}: <select class="gensmall" name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')"> <option value="7">{L_FONT_TINY}</option> <option value="9">{L_FONT_SMALL}</option> <option value="12" selected="selected">{L_FONT_NORMAL}</option> <option value="18">{L_FONT_LARGE}</option> <option value="24">{L_FONT_HUGE}</option> - </select> | <a href="javascript:bbstyle(-1)" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a></span> + </select> | <a href="#" onclick="bbstyle(-1); return false;" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a></span> </td> </tr> <!-- IF .custom_tags --> @@ -310,6 +325,9 @@ function checkForm() <td class="gensmall">{FLASH_STATUS}</td> </tr> <tr> + <td class="gensmall">{URL_STATUS}</td> + </tr> + <tr> <td class="gensmall">{SMILIES_STATUS}</td> </tr> </table> @@ -330,10 +348,12 @@ function checkForm() </tr> <!-- ENDIF --> + <!-- IF S_LINKS_ALLOWED --> <tr> <td><input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} /></td> <td class="gen">{L_DISABLE_MAGIC_URL}</td> </tr> + <!-- ENDIF --> <!-- IF S_SIG_ALLOWED --> <tr> @@ -455,11 +475,8 @@ function checkForm() <!-- INCLUDE ucp_footer.html --> <!-- ELSE --> - <table class="tablebg" width="100%" cellspacing="1"> - <tr> - <td class="row1"><div class="nav" style="float:left"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></div><div class="gensmall" style="float:right">{S_TIMEZONE}</div></td> - </tr> - </table> + + <!-- INCLUDE breadcrumbs.html --> </form> diff --git a/phpBB/styles/subSilver/template/posting_poll_body.html b/phpBB/styles/subSilver/template/posting_poll_body.html index 12155fff2e..3a523182f7 100644 --- a/phpBB/styles/subSilver/template/posting_poll_body.html +++ b/phpBB/styles/subSilver/template/posting_poll_body.html @@ -18,7 +18,7 @@ <td class="row2"><input class="post" type="text" name="poll_max_options" size="3" maxlength="3" value="{POLL_MAX_OPTIONS}" /></td> </tr> <tr> - <td class="row1"><b class="genmed">{L_POLL_FOR}</b></td> + <td class="row1"><b class="genmed">{L_POLL_FOR}:</b></td> <td class="row2"><input class="post" type="text" name="poll_length" size="3" maxlength="3" value="{POLL_LENGTH}" /> <b class="gen">{L_DAYS}</b> <span class="gensmall">{L_POLL_FOR_EXPLAIN}</span></td> </tr> <!-- IF S_POLL_VOTE_CHANGE --> @@ -30,7 +30,7 @@ <!-- IF S_POLL_DELETE --> <tr> - <td class="row1"><b class="genmed">{L_POLL_DELETE}</b></td> - <td class="row2"><input type="checkbox" class="radio" name="poll_delete" /></td> + <td class="row1"><b class="genmed">{L_POLL_DELETE}:</b></td> + <td class="row2"><input type="checkbox" class="radio" name="poll_delete"<!-- IF S_POLL_DELETE_CHECKED --> checked="checked"<!-- ENDIF --> /></td> </tr> <!-- ENDIF --> diff --git a/phpBB/styles/subSilver/template/posting_progress_bar.html b/phpBB/styles/subSilver/template/posting_progress_bar.html index e510659908..7a1489b6ec 100644 --- a/phpBB/styles/subSilver/template/posting_progress_bar.html +++ b/phpBB/styles/subSilver/template/posting_progress_bar.html @@ -30,7 +30,7 @@ <td> <table width="100%" border="0" cellspacing="1" cellpadding="4"> <tr> - <td valign="top" class="row1" align="center"><br /><span class="genmed">{L_UPLOAD_IN_PROGRESS}</span><br /><br /><div style="align:center">{PROGRESS_BAR}</div><br /><br /><span class="genmed"><a href="javascript:window.close();">{L_CLOSE_WINDOW}</a></span><br /><br /></td> + <td valign="top" class="row1" align="center"><br /><span class="genmed">{L_UPLOAD_IN_PROGRESS}</span><br /><br /><div style="align:center">{PROGRESS_BAR}</div><br /><br /><span class="genmed"><a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></span><br /><br /></td> </tr> </table> </td> diff --git a/phpBB/styles/subSilver/template/posting_smilies.html b/phpBB/styles/subSilver/template/posting_smilies.html index f1d1432972..42a58d1153 100644 --- a/phpBB/styles/subSilver/template/posting_smilies.html +++ b/phpBB/styles/subSilver/template/posting_smilies.html @@ -2,26 +2,12 @@ <script language="javascript" type="text/javascript"> <!-- -/** -* Apply clicked smiley to message body -*/ -function smiley(text) { - text = ' ' + text + ' '; - if (opener.document.forms['post'].message.createTextRange && opener.document.forms['post'].message.caretPos) - { - var caretPos = opener.document.forms['post'].message.caretPos; - caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text; - opener.document.forms['post'].message.focus(); - } - else - { - opener.document.forms['post'].message.value += text; - opener.document.forms['post'].message.focus(); - } -} +var form_name = 'post'; +var text_name = 'message'; //--> </script> +<script language="javascript" type="text/javascript" src="{T_TEMPLATE_PATH}/editor.js"></script> <table width="100%" cellspacing="1" cellpadding="4" border="0"> <tr> @@ -31,7 +17,7 @@ function smiley(text) { <th>{L_SMILIES}</th> </tr> <tr> - <td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="javascript:smiley('{smiley.A_SMILEY_CODE}')"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" border="0" alt="{smiley.SMILEY_DESC}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" onclick="smiley('{smiley.A_SMILEY_CODE}');return false" /></a> <!-- END smiley --><br /><a class="nav" href="javascript:window.close();">{L_CLOSE_WINDOW}</a></td> + <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_DESC}" 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> </tr> </table> </td> diff --git a/phpBB/styles/subSilver/template/posting_topic_review.html b/phpBB/styles/subSilver/template/posting_topic_review.html index 6520ddb803..44aa8a5b1b 100644 --- a/phpBB/styles/subSilver/template/posting_topic_review.html +++ b/phpBB/styles/subSilver/template/posting_topic_review.html @@ -28,7 +28,7 @@ <td> </td> <td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}:</b> </td> <td class="gensmall" width="100%" valign="middle">{topic_review_row.POST_SUBJECT}</td> - <td valign="top" nowrap="nowrap"> <!-- IF topic_review_row.U_QUOTE and topic_review_row.DECODED_MESSAGE --><a href="{topic_review_row.U_QUOTE}">{QUOTE_IMG}</a><!-- ENDIF --></td> + <td valign="top" nowrap="nowrap"> <!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE --><a href="#" onclick="addquote({topic_review_row.U_POST_ID},'{topic_review_row.POSTER_QUOTE}'); return false;">{QUOTE_IMG}</a><!-- ENDIF --></td> </tr> </table> </td> @@ -44,7 +44,7 @@ <tr> <td> <div class="postbody">{topic_review_row.MESSAGE}</div> - <!-- IF topic_review_row.U_QUOTE and topic_review_row.DECODED_MESSAGE --> + <!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE --> <div id="message_{topic_review_row.U_POST_ID}" style="display: none;">{topic_review_row.DECODED_MESSAGE}</div> <!-- ENDIF --> </td> diff --git a/phpBB/styles/subSilver/template/report_body.html b/phpBB/styles/subSilver/template/report_body.html index ca66a9d5f2..7065f0f35d 100644 --- a/phpBB/styles/subSilver/template/report_body.html +++ b/phpBB/styles/subSilver/template/report_body.html @@ -33,14 +33,7 @@ <br clear="all" /> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <div style="float: right;"><!-- INCLUDE jumpbox.html --></div> diff --git a/phpBB/styles/subSilver/template/search_results.html b/phpBB/styles/subSilver/template/search_results.html index bbbde2c921..0579b3131d 100644 --- a/phpBB/styles/subSilver/template/search_results.html +++ b/phpBB/styles/subSilver/template/search_results.html @@ -51,12 +51,12 @@ <p class="gensmall">{L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a></p> <!-- ENDIF --> </td> - <td class="row2" width="100" align="center"><p class="topicauthor">{searchresults.TOPIC_AUTHOR}</p></td> + <td class="row2" width="100" align="center"><p class="topicauthor"><!-- IF searchresults.U_TOPIC_AUTHOR --><a href="{searchresults.U_TOPIC_AUTHOR}"<!-- IF searchresults.TOPIC_AUTHOR_COLOUR --> style="font-weight: bold; color: {searchresults.TOPIC_AUTHOR_COLOUR}"<!-- ENDIF -->>{searchresults.TOPIC_AUTHOR}</a><!-- ELSE -->{searchresults.TOPIC_AUTHOR}</a><!-- ENDIF --></p></td> <td class="row1" width="50" align="center"><p class="topicdetails">{searchresults.TOPIC_REPLIES}</p></td> <td class="row2" width="50" align="center"><p class="topicdetails">{searchresults.TOPIC_VIEWS}</p></td> <td class="row1" width="120" align="center"> <p class="topicdetails">{searchresults.LAST_POST_TIME}</p> - <p class="topicdetails"><!-- IF searchresults.U_LAST_POST_AUTHOR --><a href="{searchresults.U_LAST_POST_AUTHOR}">{searchresults.LAST_POST_AUTHOR}</a><!-- ELSE -->{searchresults.LAST_POST_AUTHOR}<!-- ENDIF --> + <p class="topicdetails"><!-- IF searchresults.U_LAST_POST_AUTHOR --><a href="{searchresults.U_LAST_POST_AUTHOR}"<!-- IF searchresults.LAST_POST_AUTHOR_COLOUR --> style="font-weight: bold; color: {searchresults.LAST_POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{searchresults.LAST_POST_AUTHOR}</a><!-- ELSE -->{searchresults.LAST_POST_AUTHOR}<!-- ENDIF --> <a href="{searchresults.U_LAST_POST}">{searchresults.LAST_POST_IMG}</a> </p> </td> @@ -87,7 +87,7 @@ <td colspan="2" height="25"><p class="topictitle"><a name="{searchresults.POST_ID}"></a> <!-- IF searchresults.FORUM_TITLE -->{L_FORUM}: <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a><!-- ELSE -->{L_GLOBAL}<!-- ENDIF --> {L_TOPIC}: <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a></p></td> </tr> <tr class="row1"> - <td width="150" align="center" valign="middle"><b class="postauthor">{searchresults.POSTER_NAME}</b></td> + <td width="150" align="center" valign="middle"><b class="postauthor"<!-- IF searchresults.POSTER_COLOUR --> style="color: {searchresults.POSTER_COLOUR}"<!-- ENDIF -->>{searchresults.POSTER_NAME}</b></td> <td height="25"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> @@ -123,7 +123,7 @@ </form> -<div class="nav" style="float:left"><!-- IF PAGINATION -->{PAGE_NUMBER} [ {TOTAL_MATCHES} ]<!-- ENDIF --> </div><div class="nav" style="float:right"><!-- IF PAGINATION --><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --></div> +<div class="nav" style="float:left"><!-- INCLUDE pagination.html --></div> <br clear="all" /><br /> diff --git a/phpBB/styles/subSilver/template/simple_header.html b/phpBB/styles/subSilver/template/simple_header.html index 18eba23de0..eab8b10dca 100644 --- a/phpBB/styles/subSilver/template/simple_header.html +++ b/phpBB/styles/subSilver/template/simple_header.html @@ -1,25 +1,20 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}"> +<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}"> <head> <meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" /> +<meta http-equiv="content-language" content="{S_USER_LANG}" /> +<meta http-equiv="content-style-type" content="text/css" /> +<meta http-equiv="imagetoolbar" content="no" /> <meta name="resource-type" content="document" /> -<meta name="language" content="{S_USER_LANG}" /> <meta name="distribution" content="global" /> <meta name="copyright" content="2002-2006 phpBB Group" /> <meta name="keywords" content="" /> <meta name="description" content="" /> -<meta http-equiv="content-style-type" content="text/css" /> -<meta http-equiv="imagetoolbar" content="no" /> {META} <title>{SITENAME} • {PAGE_TITLE}</title> -<link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css"> -<style type="text/css"> -<!-- -{T_STYLESHEET_DATA} -//--> -</style> +<link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" /> </head> <body> diff --git a/phpBB/styles/subSilver/template/ucp_agreement.html b/phpBB/styles/subSilver/template/ucp_agreement.html index 3d25015101..d01a040a7a 100644 --- a/phpBB/styles/subSilver/template/ucp_agreement.html +++ b/phpBB/styles/subSilver/template/ucp_agreement.html @@ -18,8 +18,8 @@ <td> <span class="genmed"><br />{L_TERMS_OF_USE}<br /><br /></span> <div align="center"> - <input class="btnlite" type="submit" name="agreed" value="{L_AGREE}"><br /><br /> - <input class="btnlite" type="submit" name="not_agreed" value="{L_NOT_AGREE}"> + <input class="btnlite" type="submit" name="agreed" value="{L_AGREE}" /><br /><br /> + <input class="btnlite" type="submit" name="not_agreed" value="{L_NOT_AGREE}" /> </div> </td> <!-- ENDIF --> @@ -28,7 +28,7 @@ </td> </tr> </table> - + {S_HIDDEN_FIELDS} </form> <!-- ELSEIF S_AGREEMENT --> diff --git a/phpBB/styles/subSilver/template/ucp_attachments.html b/phpBB/styles/subSilver/template/ucp_attachments.html index a035376c83..4e3a12cb3b 100644 --- a/phpBB/styles/subSilver/template/ucp_attachments.html +++ b/phpBB/styles/subSilver/template/ucp_attachments.html @@ -18,7 +18,7 @@ <tr> <td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td> <td class="gensmall" nowrap="nowrap"> [ {TOTAL_ATTACHMENTS} ] </td> - <td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- IF PAGINATION --><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --></td> + <td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- INCLUDE pagination.html --></td> </tr> </table> </td> @@ -40,7 +40,7 @@ </tr> </table> - <div style="float:right"><b class="gensmall"><a href="javascript:marklist('ucp', 'attachment', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', 'attachment', false);">{L_UNMARK_ALL}</a></b></div> + <div style="float:right"><b class="gensmall"><a href="#" onclick="marklist('ucp', 'attachment', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('ucp', 'attachment', false); return false;">{L_UNMARK_ALL}</a></b></div> <!-- ELSE --> diff --git a/phpBB/styles/subSilver/template/ucp_groups_manage.html b/phpBB/styles/subSilver/template/ucp_groups_manage.html index 3e5f4178e9..51bd5a1567 100644 --- a/phpBB/styles/subSilver/template/ucp_groups_manage.html +++ b/phpBB/styles/subSilver/template/ucp_groups_manage.html @@ -187,13 +187,13 @@ </tr> <!-- END member --> <tr> - <td class="cat" colspan="5" align="center"><div style="float: right;"><span class="small"><a href="javascript:marklist('ucp', 'mark', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', 'mark', false);">{L_UNMARK_ALL}</a></span></div><div style="float: left"><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}" /></div></td> + <td class="cat" colspan="5" align="center"><div style="float: right;"><span class="small"><a href="#" onclick="marklist('ucp', 'mark', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('ucp', 'mark', false); return false;">{L_UNMARK_ALL}</a></span></div><div style="float: left"><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}" /></div></td> </tr> </table> <div class="pagination" style="float: left;"> <!-- IF PAGINATION --> - <a href="javascript:jumpto();" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> + <!-- INCLUDE pagination.html --> <!-- ELSE --> {S_ON_PAGE} <!-- ENDIF --> @@ -216,7 +216,7 @@ </tr> <tr> <td class="row1"><label for="usernames">{L_USERNAME}:</label><br /><span>{L_USERNAMES_EXPLAIN}</span></td> - <td class="row2"><textarea id="usernames" name="usernames" cols="40" rows="5"></textarea><br />[ <a href="{U_FIND_USERNAME}" target="usersearch">{L_FIND_USERNAME}</a> ]</td> + <td class="row2"><textarea id="usernames" name="usernames" cols="40" rows="5"></textarea><br />[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</td> </tr> <tr> <td class="cat" colspan="2" align="center"><input class="button2" type="submit" name="addusers" value="{L_SUBMIT}" /></td> diff --git a/phpBB/styles/subSilver/template/ucp_groups_membership.html b/phpBB/styles/subSilver/template/ucp_groups_membership.html index 1cd6211249..a0020f69d8 100644 --- a/phpBB/styles/subSilver/template/ucp_groups_membership.html +++ b/phpBB/styles/subSilver/template/ucp_groups_membership.html @@ -9,8 +9,8 @@ </tr> <tr> - <th colspan="2">{L_GROUP_DETAILS}</td> - <th>{L_SELECT}</td> + <th colspan="2">{L_GROUP_DETAILS}</th> + <th>{L_SELECT}</th> </tr> <!-- BEGIN leader --> @@ -86,7 +86,7 @@ <!-- END nonmember --> <tr> - <td class="cat" colspan="3"><!-- IF S_CHANGE_DEFAULT --><div style="float: left;"><input class="btnlite" type="submit" name="change_default" value="Change default group" /></div><!-- ENDIF --><div style="float:right"><span class="genmed">{L_SELECT}: </span><select name="action"><option value="join">{L_JOIN_SELECTED}</option><option value="resign">{L_RESIGN_SELECTED}</option><option value="demote">{L_DEMOTE_SELECTED}</option></select> <input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" /> </div></td> + <td class="cat" colspan="3"><!-- IF S_CHANGE_DEFAULT --><div style="float: left;"><input class="btnlite" type="submit" name="change_default" value="{L_CHANGE_DEFAULT_GROUP}" /></div><!-- ENDIF --><div style="float:right"><span class="genmed">{L_SELECT}: </span><select name="action"><option value="join">{L_JOIN_SELECTED}</option><option value="resign">{L_RESIGN_SELECTED}</option><option value="demote">{L_DEMOTE_SELECTED}</option></select> <input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" /> </div></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/ucp_header.html b/phpBB/styles/subSilver/template/ucp_header.html index 3b73856650..dc89b8a3be 100644 --- a/phpBB/styles/subSilver/template/ucp_header.html +++ b/phpBB/styles/subSilver/template/ucp_header.html @@ -101,7 +101,7 @@ <!-- BEGIN pm_colour_info --> <tr> <!-- IF not pm_colour_info.IMG --> - <td class="row1 {pm_colour_info.CLASS}" width="5"><img src="images/spacer.gif" width="5" alt="{pm_colour_info.LANG}" border="0" /></td> + <td class="row1 {pm_colour_info.CLASS}" width="5"><img src="images/spacer.gif" width="5" alt="{pm_colour_info.LANG}" /></td> <!-- ELSE --> <td class="row1" width="25" align="center">{pm_colour_info.IMG}</td> <!-- ENDIF --> @@ -125,7 +125,7 @@ <ul class="nav" style="margin: 0px; padding: 0px; list-style-type: none; line-height: 175%;"> <!-- BEGIN friends_online --> - <li><a href="{friends_online.U_PROFILE}">{friends_online.USERNAME}</a> + <li><a href="{friends_online.U_PROFILE}"<!-- IF friends_online.USER_COLOUR --> style="color: {friends_online.USER_COLOUR}"<!-- ENDIF -->>{friends_online.USERNAME}</a> <!-- IF S_SHOW_PM_BOX --> [ <input class="post" style="font-size: 90%;" type="submit" name="add_to[{friends_online.USER_ID}]" value="{L_ADD}" /> ] <!-- ENDIF --> @@ -141,7 +141,7 @@ <ul class="nav" style="margin: 0px; padding: 0px; list-style-type: none; line-height: 175%;"> <!-- BEGIN friends_offline --> - <li><a href="{friends_offline.U_PROFILE}">{friends_offline.USERNAME}</a> + <li><a href="{friends_offline.U_PROFILE}"<!-- IF friends_offline.USER_COLOUR --> style="color: {friends_offline.USER_COLOUR}"<!-- ENDIF -->>{friends_offline.USERNAME}</a> <!-- IF S_SHOW_PM_BOX --> [ <input class="post" style="font-size: 90%;" type="submit" name="add_to[{friends_offline.USER_ID}]" value="{L_ADD}" /> ] <!-- ENDIF --> diff --git a/phpBB/styles/subSilver/template/ucp_main_bookmarks.html b/phpBB/styles/subSilver/template/ucp_main_bookmarks.html index 5be1a5af2e..8f4d100b2d 100644 --- a/phpBB/styles/subSilver/template/ucp_main_bookmarks.html +++ b/phpBB/styles/subSilver/template/ucp_main_bookmarks.html @@ -34,7 +34,7 @@ </td> <td style="padding: 4px;" align="left" valign="top" nowrap="nowrap"> <p class="topicdetails">{topicrow.LAST_POST_TIME}</p> - <p class="topicdetails"><!-- IF topicrow.U_LAST_POST_AUTHOR --><a href="{topicrow.U_LAST_POST_AUTHOR}">{topicrow.LAST_POST_AUTHOR}</a><!-- ELSE -->{topicrow.LAST_POST_AUTHOR}<!-- ENDIF --> + <p class="topicdetails"><!-- IF topicrow.U_LAST_POST_AUTHOR --><a href="{topicrow.U_LAST_POST_AUTHOR}" <!-- IF topicrow.LAST_POST_AUTHOR_COLOUR --> style="font-weight: bold; color: {topicrow.LAST_POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{topicrow.LAST_POST_AUTHOR}</a><!-- ELSE -->{topicrow.LAST_POST_AUTHOR}<!-- ENDIF --> <a href="{topicrow.U_LAST_POST}">{topicrow.LAST_POST_IMG}</a> </p> </td> @@ -55,7 +55,7 @@ </table> <!-- IF not S_NO_DISPLAY_BOOKMARKS --> - <div class="gensmall" style="float: right; padding-top: 2px;"><b><a href="javascript:marklist('ucp', 't', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', 't', false);">{L_UNMARK_ALL}</a></b></div> + <div class="gensmall" style="float: right; padding-top: 2px;"><b><a href="#" onclick="marklist('ucp', 't', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('ucp', 't', false); return false;">{L_UNMARK_ALL}</a></b></div> <!-- ENDIF --> <!-- INCLUDE ucp_footer.html -->
\ No newline at end of file diff --git a/phpBB/styles/subSilver/template/ucp_main_drafts.html b/phpBB/styles/subSilver/template/ucp_main_drafts.html index 50d56613a3..6d7f380b7f 100644 --- a/phpBB/styles/subSilver/template/ucp_main_drafts.html +++ b/phpBB/styles/subSilver/template/ucp_main_drafts.html @@ -55,7 +55,7 @@ <!-- ELSEIF S_EDIT_DRAFT --> <tr> <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}:</b></td> - <td class="row2"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="60" tabindex="2" value="{DRAFT_SUBJECT}" /></td> + <td class="row2"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="64" tabindex="2" value="{DRAFT_SUBJECT}" /></td> </tr> <tr> <td class="row1" width="22%"><b class="genmed">{L_MESSAGE}: </b><br /><span class="gensmall">{L_EDIT_DRAFT_EXPLAIN}</span></td> @@ -83,7 +83,7 @@ <option value="18">{L_FONT_LARGE}</option> <option value="24">{L_FONT_HUGE}</option> </select></td> - <td class="gensmall" nowrap="nowrap" align="right"><a href="javascript:bbstyle(-1)" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a></td> + <td class="gensmall" nowrap="nowrap" align="right"><a href="#" onclick="bbstyle(-1); return false;" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a></td> </tr> </table> </td> diff --git a/phpBB/styles/subSilver/template/ucp_main_front.html b/phpBB/styles/subSilver/template/ucp_main_front.html index a89616e643..75eb8f242a 100644 --- a/phpBB/styles/subSilver/template/ucp_main_front.html +++ b/phpBB/styles/subSilver/template/ucp_main_front.html @@ -22,7 +22,7 @@ <p class="topicdetails">{topicrow.LAST_POST_TIME}</p> <p class="topicdetails"> <!-- IF topicrow.U_LAST_POST_AUTHOR --> - <a href="{topicrow.U_LAST_POST_AUTHOR}">{topicrow.LAST_POST_AUTHOR}</a> + <a href="{topicrow.U_LAST_POST_AUTHOR}" <!-- IF topicrow.LAST_POST_AUTHOR_COLOUR --> style="font-weight: bold; color: {topicrow.LAST_POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{topicrow.LAST_POST_AUTHOR}</a> <!-- ELSE --> {topicrow.LAST_POST_AUTHOR} <!-- ENDIF --> diff --git a/phpBB/styles/subSilver/template/ucp_main_subscribed.html b/phpBB/styles/subSilver/template/ucp_main_subscribed.html index b0f3d455c0..9bcab695ed 100644 --- a/phpBB/styles/subSilver/template/ucp_main_subscribed.html +++ b/phpBB/styles/subSilver/template/ucp_main_subscribed.html @@ -16,7 +16,7 @@ <!-- IF forumrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> <td style="padding: 4px;" width="20" align="center" valign="middle">{forumrow.FORUM_FOLDER_IMG}</td> <td style="padding: 4px;" width="100%"><p class="topictitle"><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></p></td> - <td class="gensmall" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap"><!-- IF forumrow.LAST_POST_TIME -->{forumrow.LAST_POST_TIME}<br /><!-- IF forumrow.U_LAST_POST_AUTHOR --><a href="{forumrow.U_LAST_POST_AUTHOR}">{forumrow.LAST_POST_AUTHOR}</a><!-- ELSE -->{forumrow.LAST_POST_AUTHOR}<!-- ENDIF --> <a href="{forumrow.U_LAST_POST}">{forumrow.LAST_POST_IMG}</a><!-- ELSE -->{L_NO_POSTS}<!-- ENDIF --></td> + <td class="gensmall" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap"><!-- IF forumrow.LAST_POST_TIME -->{forumrow.LAST_POST_TIME}<br /><!-- IF forumrow.U_LAST_POST_AUTHOR --><a href="{forumrow.U_LAST_POST_AUTHOR}" <!-- IF forumrow.LAST_POST_AUTHOR_COLOUR --> style="font-weight: bold; color: {forumrow.LAST_POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{forumrow.LAST_POST_AUTHOR}</a><!-- ELSE -->{forumrow.LAST_POST_AUTHOR}<!-- ENDIF --> <a href="{forumrow.U_LAST_POST}">{forumrow.LAST_POST_IMG}</a><!-- ELSE -->{L_NO_POSTS}<!-- ENDIF --></td> <td style="padding: 4px;"> <input type="checkbox" class="radio" name="f[{forumrow.FORUM_ID}]" /> </td> </tr> <!-- BEGINELSE --> @@ -36,7 +36,7 @@ <tr> <td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td> <td class="gensmall" nowrap="nowrap"> [ {TOTAL_TOPICS} ] </td> - <td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- IF PAGINATION --><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --></td> + <td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- INCLUDE pagination.html --></td> </tr> </table> </td> @@ -55,7 +55,7 @@ </td> <td style="padding: 4px;" align="left" valign="top" nowrap="nowrap"> <p class="topicdetails">{topicrow.LAST_POST_TIME}</p> - <p class="topicdetails"><!-- IF topicrow.U_LAST_POST_AUTHOR --><a href="{topicrow.U_LAST_POST_AUTHOR}">{topicrow.LAST_POST_AUTHOR}</a><!-- ELSE -->{topicrow.LAST_POST_AUTHOR}<!-- ENDIF --> + <p class="topicdetails"><!-- IF topicrow.U_LAST_POST_AUTHOR --><a href="{topicrow.U_LAST_POST_AUTHOR}" <!-- IF topicrow.LAST_POST_AUTHOR_COLOUR --> style="font-weight: bold; color: {topicrow.LAST_POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{topicrow.LAST_POST_AUTHOR}</a><!-- ELSE -->{topicrow.LAST_POST_AUTHOR}<!-- ENDIF --> <a href="{topicrow.U_LAST_POST}">{topicrow.LAST_POST_IMG}</a> </p> </td> @@ -72,6 +72,6 @@ </tr> </table> -<div class="gensmall" style="float: right; padding-top: 2px;"><b><a href="javascript:marklist('ucp', 't', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('ucp', 't', false);">{L_UNMARK_ALL}</a></b></div> +<div class="gensmall" style="float: right; padding-top: 2px;"><b><a href="#" onclick="marklist('ucp', 't', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('ucp', 't', false); return false;">{L_UNMARK_ALL}</a></b></div> <!-- INCLUDE ucp_footer.html -->
\ No newline at end of file diff --git a/phpBB/styles/subSilver/template/ucp_pm_message_footer.html b/phpBB/styles/subSilver/template/ucp_pm_message_footer.html index f0b6307789..a87662e09e 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_message_footer.html +++ b/phpBB/styles/subSilver/template/ucp_pm_message_footer.html @@ -6,8 +6,7 @@ <td class="row1"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> - <td align="left"> - <!-- IF PAGINATION --><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --> + <td align="left"><!-- INCLUDE pagination.html --> <!-- IF S_VIEW_MESSAGE --> <span class="gensmall"> <!-- IF U_PRINT_PM --><a href="{U_PRINT_PM}" title="{L_PRINT_PM}">{L_PRINT_PM}</a><!-- IF U_FORWARD_PM --> | <!-- ENDIF --><!-- ENDIF --> @@ -36,5 +35,5 @@ </table> <!-- IF not S_VIEW_MESSAGE --> - <div style="float:right"><b class="gensmall"><a href="javascript:marklist('viewfolder', 'marked_msg_id', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('viewfolder', 'marked_msg_id', false);">{L_UNMARK_ALL}</a></b></div> + <div style="float:right"><b class="gensmall"><a href="#" onclick="marklist('viewfolder', 'marked_msg_id', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('viewfolder', 'marked_msg_id', false); return false;">{L_UNMARK_ALL}</a></b></div> <!-- ENDIF --> diff --git a/phpBB/styles/subSilver/template/ucp_pm_message_header.html b/phpBB/styles/subSilver/template/ucp_pm_message_header.html index f499b82fd5..f3c5cc828b 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_message_header.html +++ b/phpBB/styles/subSilver/template/ucp_pm_message_header.html @@ -22,7 +22,7 @@ </span> <!-- ENDIF --> </td> - <td align="right"><!-- IF PAGINATION --><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --></td> + <td align="right"><!-- INCLUDE pagination.html --></td> </tr> </table> </td> diff --git a/phpBB/styles/subSilver/template/ucp_pm_options.html b/phpBB/styles/subSilver/template/ucp_pm_options.html index 321c98be2a..4fbc908b5a 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_options.html +++ b/phpBB/styles/subSilver/template/ucp_pm_options.html @@ -42,7 +42,7 @@ <!-- IF S_TEXT_CONDITION --> <input type="text" name="rule_string" value="{CURRENT_STRING}" size="30" maxlength="250" class="post" /> <!-- ELSEIF S_USER_CONDITION --> - <input type="text" class="post" name="rule_string" value="{CURRENT_STRING}" maxlength="50" size="20" /> <span class="gensmall">[ <a href="{U_FIND_USERNAME}" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=740');return false;">{L_FIND_USERNAME}</a> ]</span> + <input type="text" class="post" name="rule_string" value="{CURRENT_STRING}" maxlength="50" size="20" /> <span class="gensmall">[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</span> <!-- ELSEIF S_GROUP_CONDITION --> <input type="hidden" name="rule_string" value="{CURRENT_STRING}" /><!-- IF S_GROUP_OPTIONS --><select name="rule_group_id">{S_GROUP_OPTIONS}</select><!-- ELSE -->{L_NO_GROUPS}<!-- ENDIF --> <!-- ENDIF --> diff --git a/phpBB/styles/subSilver/template/ucp_pm_popup.html b/phpBB/styles/subSilver/template/ucp_pm_popup.html index f3d02b5ed9..6b13b186f7 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_popup.html +++ b/phpBB/styles/subSilver/template/ucp_pm_popup.html @@ -26,7 +26,7 @@ function jump_to_inbox() {MESSAGE}<br /><br />{CLICK_TO_VIEW} <!-- ENDIF --> </span> - <br /><br /><span class="genmed"><a href="javascript:window.close();">{L_CLOSE_WINDOW}</a></span><br /><br /> + <br /><br /><span class="genmed"><a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></span><br /><br /> </td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/ucp_pm_viewfolder.html b/phpBB/styles/subSilver/template/ucp_pm_viewfolder.html index 5173341047..62e2a84260 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_viewfolder.html +++ b/phpBB/styles/subSilver/template/ucp_pm_viewfolder.html @@ -72,6 +72,9 @@ <!-- ELSE --> <a href="{messagerow.U_VIEW_PM}">{messagerow.SUBJECT}</a> <!-- ENDIF --> + <!-- IF messagerow.S_AUTHOR_DELETED --> + <br /><em class="gensmall">{L_PM_FROM_REMOVED_AUTHOR}</em> + <!-- ENDIF --> </span></td> <td class="row1" width="100" align="center"><p class="topicauthor"><!-- IF S_SHOW_RECIPIENTS -->{messagerow.RECIPIENTS}<!-- ELSE -->{messagerow.MESSAGE_AUTHOR}<!-- ENDIF --></p></td> diff --git a/phpBB/styles/subSilver/template/ucp_pm_viewmessage.html b/phpBB/styles/subSilver/template/ucp_pm_viewmessage.html index 8fcc265860..0d29d32283 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_viewmessage.html +++ b/phpBB/styles/subSilver/template/ucp_pm_viewmessage.html @@ -14,7 +14,7 @@ <tr class="row1"> <td class="genmed" nowrap="nowrap" width="150"><b>{L_PM_FROM}:</b></td> - <td class="gen"><a href="{U_AUTHOR_PROFILE}">{AUTHOR_NAME}</a></td> + <td class="gen"><!-- IF U_AUTHOR_PROFILE --><a href="{U_AUTHOR_PROFILE}">{AUTHOR_NAME}</a><!-- ELSE -->{AUTHOR_NAME}<!-- ENDIF --></td> </tr> <tr class="row1"> @@ -27,7 +27,11 @@ <td class="genmed" nowrap="nowrap" width="150"><b>{L_TO}:</b></td> <td class="gen"> <!-- BEGIN to_recipient --> - <a href="{to_recipient.U_VIEW}"><!-- IF to_recipient.COLOUR --><span style="color:#{to_recipient.COLOUR}"><!-- ELSE --><span<!-- IF to_recipient.IS_GROUP --> class="blue"<!-- ENDIF -->><!-- ENDIF -->{to_recipient.NAME}</span></a> + <!-- IF not to_recipient.U_VIEW --> + <span<!-- IF to_recipient.COLOUR --> style="color:#{to_recipient.COLOUR}"<!-- ELSEIF to_recipient.IS_GROUP --> class="blue"<!-- ENDIF -->{to_recipient.NAME}</span> + <!-- ELSE --> + <a href="{to_recipient.U_VIEW}"<!-- IF to_recipient.COLOUR --> style="color:#{to_recipient.COLOUR}"<!-- ELSEIF to_recipient.IS_GROUP --> class="blue"<!-- ENDIF -->>{to_recipient.NAME}</a> + <!-- ENDIF --> <!-- END to_recipient --> </td> </tr> @@ -38,7 +42,11 @@ <td class="genmed" nowrap="nowrap" width="150"><b>{L_BCC}:</b></td> <td class="gen"> <!-- BEGIN bcc_recipient --> - <a href="{bcc_recipient.U_VIEW}"><!-- IF bcc_recipient.COLOUR --><span style="color:#{bcc_recipient.COLOUR}"><!-- ELSE --><span<!-- IF bcc_recipient.IS_GROUP --> class="blue"<!-- ENDIF -->><!-- ENDIF -->{bcc_recipient.NAME}</span></a> + <!-- IF not bcc_recipient.U_VIEW --> + <span<!-- IF bcc_recipient.COLOUR --> style="color:#{bcc_recipient.COLOUR}"<!-- ELSEIF bcc_recipient.IS_GROUP --> class="blue"<!-- ENDIF -->{bcc_recipient.NAME}</span> + <!-- ELSE --> + <a href="{bcc_recipient.U_VIEW}"<!-- IF bcc_recipient.COLOUR --> style="color:#{bcc_recipient.COLOUR}"<!-- ELSEIF bcc_recipient.IS_GROUP --> class="blue"<!-- ENDIF -->>{bcc_recipient.NAME}</a> + <!-- ENDIF --> <!-- END bcc_recipient --> </td> </tr> diff --git a/phpBB/styles/subSilver/template/ucp_pm_viewmessage_print.html b/phpBB/styles/subSilver/template/ucp_pm_viewmessage_print.html index da7f7a03f9..44edd2653b 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_viewmessage_print.html +++ b/phpBB/styles/subSilver/template/ucp_pm_viewmessage_print.html @@ -1,8 +1,9 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html dir="{S_CONTENT_DIRECTION}"> +<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}"> <head> <meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}"> <meta http-equiv="Content-Style-Type" content="text/css"> +<meta http-equiv="Content-Language" content="{S_USER_LANG}"> <title>{SITENAME} :: {PAGE_TITLE}</title> <style type="text/css"> diff --git a/phpBB/styles/subSilver/template/ucp_prefs_personal.html b/phpBB/styles/subSilver/template/ucp_prefs_personal.html index d1e1e7cbc4..24efae86cf 100644 --- a/phpBB/styles/subSilver/template/ucp_prefs_personal.html +++ b/phpBB/styles/subSilver/template/ucp_prefs_personal.html @@ -63,10 +63,12 @@ <td class="row1" width="50%"><b class="genmed">{L_BOARD_LANGUAGE}:</b></td> <td class="row2"><select name="lang">{S_LANG_OPTIONS}</select></td> </tr> +<!-- IF S_STYLE_OPTIONS --> <tr> <td class="row1" width="50%"><b class="genmed">{L_BOARD_STYLE}:</b></td> <td class="row2"><select name="style">{S_STYLE_OPTIONS}</select></td> </tr> +<!-- ENDIF --> <tr> <td class="row1" width="50%"><b class="genmed">{L_BOARD_TIMEZONE}:</b></td> <td class="row2"><select name="tz">{S_TZ_OPTIONS}</select></td> diff --git a/phpBB/styles/subSilver/template/ucp_profile_signature.html b/phpBB/styles/subSilver/template/ucp_profile_signature.html index 4cacc5ae81..735f80efd4 100644 --- a/phpBB/styles/subSilver/template/ucp_profile_signature.html +++ b/phpBB/styles/subSilver/template/ucp_profile_signature.html @@ -12,21 +12,25 @@ bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]',' imageTag = false; // Helpline messages -b_help = "{LA_BBCODE_B_HELP}"; -i_help = "{LA_BBCODE_I_HELP}"; -u_help = "{LA_BBCODE_U_HELP}"; -q_help = "{LA_BBCODE_Q_HELP}"; -c_help = "{LA_BBCODE_C_HELP}"; -l_help = "{LA_BBCODE_L_HELP}"; -o_help = "{LA_BBCODE_O_HELP}"; -p_help = "{LA_BBCODE_P_HELP}"; -w_help = "{LA_BBCODE_W_HELP}"; -a_help = "{LA_BBCODE_A_HELP}"; -s_help = "{LA_BBCODE_S_HELP}"; -f_help = "{LA_BBCODE_F_HELP}"; -e_help = "{LA_BBCODE_E_HELP}"; -d_help = "{LA_BBCODE_D_HELP}"; -<!-- BEGIN custom_tags -->cb_{custom_tags.BBCODE_ID}_help = "{custom_tags.BBCODE_HELPLINE}";<!-- END custom_tags --> +var help_line = { + b: '{LA_BBCODE_B_HELP}', + i: '{LA_BBCODE_I_HELP}', + u: '{LA_BBCODE_U_HELP}', + q: '{LA_BBCODE_Q_HELP}', + c: '{LA_BBCODE_C_HELP}', + l: '{LA_BBCODE_L_HELP}', + o: '{LA_BBCODE_O_HELP}', + p: '{LA_BBCODE_P_HELP}', + w: '{LA_BBCODE_W_HELP}', + a: '{LA_BBCODE_A_HELP}', + s: '{LA_BBCODE_S_HELP}', + f: '{LA_BBCODE_F_HELP}', + e: '{LA_BBCODE_E_HELP}', + d: '{LA_BBCODE_D_HELP}' + <!-- BEGIN custom_tags --> + ,cb_{custom_tags.BBCODE_ID}: '{custom_tags.BBCODE_HELPLINE}' + <!-- END custom_tags --> +} //--> </script> @@ -56,9 +60,15 @@ d_help = "{LA_BBCODE_D_HELP}"; <input type="button" class="btnbbcode" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" /> <input type="button" class="btnbbcode" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" /> <input type="button" class="btnbbcode" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" /> - <!-- IF S_BBCODE_IMG --><input type="button" class="btnbbcode" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /><!-- ENDIF --> - <input type="button" class="btnbbcode" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" /> - <!-- IF S_BBCODE_FLASH --><input type="button" class="btnbbcode" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" /><!-- ENDIF --> + <!-- IF S_BBCODE_IMG --> + <input type="button" class="btnbbcode" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /> + <!-- ENDIF --> + <!-- IF S_LINKS_ALLOWED --> + <input type="button" class="btnbbcode" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" /> + <!-- ENDIF --> + <!-- IF S_BBCODE_FLASH --> + <input type="button" class="btnbbcode" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" /> + <!-- ENDIF --> </td> </tr> <tr> @@ -69,7 +79,7 @@ d_help = "{LA_BBCODE_D_HELP}"; <option value="12" selected="selected">{L_FONT_NORMAL}</option> <option value="18">{L_FONT_LARGE}</option> <option value="24">{L_FONT_HUGE}</option> - </select> | <a href="javascript:bbstyle(-1)" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a></span> + </select> | <a href="#" onclick="bbstyle(-1); return false;" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a></span> </td> </tr> <!-- IF .custom_tags --> @@ -118,6 +128,9 @@ d_help = "{LA_BBCODE_D_HELP}"; <td class="gensmall">{FLASH_STATUS}</td> </tr> <tr> + <td class="gensmall">{URL_STATUS}</td> + </tr> + <tr> <td class="gensmall">{SMILIES_STATUS}</td> </tr> </table> @@ -136,10 +149,12 @@ d_help = "{LA_BBCODE_D_HELP}"; <td class="gen">{L_DISABLE_SMILIES}</td> </tr> <!-- ENDIF --> - <tr> - <td><input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} /></td> - <td class="gen">{L_DISABLE_MAGIC_URL}</td> - </tr> + <!-- IF S_LINKS_ALLOWED --> + <tr> + <td><input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} /></td> + <td class="gen">{L_DISABLE_MAGIC_URL}</td> + </tr> + <!-- ENDIF --> </table> </td> </tr> diff --git a/phpBB/styles/subSilver/template/ucp_register.html b/phpBB/styles/subSilver/template/ucp_register.html index e57b1ed92b..ccbcb4505f 100644 --- a/phpBB/styles/subSilver/template/ucp_register.html +++ b/phpBB/styles/subSilver/template/ucp_register.html @@ -59,7 +59,7 @@ </tr> <tr> <td class="row1"><b class="genmed">{L_LANGUAGE}: </b></td> - <td class="row2"><select name="lang" onchange="javascript:change_language(this.value);">{S_LANG_OPTIONS}</select></td> + <td class="row2"><select name="lang" onchange="change_language(this.value); return false;">{S_LANG_OPTIONS}</select></td> </tr> <tr> <td class="row1"><b class="genmed">{L_TIMEZONE}: </b></td> diff --git a/phpBB/styles/subSilver/template/viewforum_body.html b/phpBB/styles/subSilver/template/viewforum_body.html index a31b4ad162..6d483ecac9 100644 --- a/phpBB/styles/subSilver/template/viewforum_body.html +++ b/phpBB/styles/subSilver/template/viewforum_body.html @@ -52,12 +52,17 @@ <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p> <!-- ENDIF --> </td> - <td class="row2" width="100" align="center"><p class="topicauthor">{topicrow.TOPIC_AUTHOR}</p></td> + <td class="row2" width="100" align="center"><p class="topicauthor"><!-- IF topicrow.U_TOPIC_AUTHOR --><a href="{topicrow.U_TOPIC_AUTHOR}"<!-- IF topicrow.TOPIC_AUTHOR_COLOUR --> style="font-weight: bold; color: {topicrow.TOPIC_AUTHOR_COLOUR}"<!-- ENDIF -->>{topicrow.TOPIC_AUTHOR}</a><!-- ELSE -->{topicrow.TOPIC_AUTHOR}<!-- ENDIF --></p></td> <td class="row1" width="50" align="center"><p class="topicdetails">{topicrow.REPLIES}</p></td> <td class="row2" width="50" align="center"><p class="topicdetails">{topicrow.VIEWS}</p></td> <td class="row1" width="140" align="center"> <p class="topicdetails" style="white-space: nowrap;">{topicrow.LAST_POST_TIME}</p> - <p class="topicdetails"><!-- IF topicrow.U_LAST_POST_AUTHOR --><a href="{topicrow.U_LAST_POST_AUTHOR}">{topicrow.LAST_POST_AUTHOR}</a><!-- ELSE -->{topicrow.LAST_POST_AUTHOR}<!-- ENDIF --> + <p class="topicdetails"> + <!-- IF topicrow.U_LAST_POST_AUTHOR --> + <a href="{topicrow.U_LAST_POST_AUTHOR}" <!-- IF topicrow.LAST_POST_AUTHOR_COLOUR -->style="color: {topicrow.LAST_POST_AUTHOR_COLOUR}; font-weight: bold;"<!-- ENDIF -->>{topicrow.LAST_POST_AUTHOR}</a> + <!-- ELSE --> + {topicrow.LAST_POST_AUTHOR} + <!-- ENDIF --> <a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a> </p> </td> @@ -67,9 +72,9 @@ <tr> <!-- IF S_TOPIC_ICONS --> - <td class="row1" colspan="7" height="30" align="center" valign="middle"><span class="gen">{L_NO_TOPICS}</span></td> + <td class="row1" colspan="7" height="30" align="center" valign="middle"><span class="gen"><!-- IF not S_SORT_DAYS -->{L_NO_TOPICS}<!-- ELSE -->{L_NO_TOPICS_TIME_FRAME}<!-- ENDIF --></span></td> <!-- ELSE --> - <td class="row1" colspan="6" height="30" align="center" valign="middle"><span class="gen">{L_NO_TOPICS}</span></td> + <td class="row1" colspan="6" height="30" align="center" valign="middle"><span class="gen"><!-- IF not S_SORT_DAYS -->{L_NO_TOPICS}<!-- ELSE -->{L_NO_TOPICS_TIME_FRAME}<!-- ENDIF --></span></td> <!-- ENDIF --> </tr> <!-- END topicrow --> @@ -83,7 +88,8 @@ <!-- ENDIF --> <!-- IF S_HAS_SUBFORUM --> - <!-- INCLUDE viewforum_subforum.html --> + <!-- INCLUDE forumlist_body.html --> + <br clear="all" /> <!-- ENDIF --> <!-- IF S_IS_POSTABLE --> @@ -112,7 +118,7 @@ <!-- IF TOTAL_TOPICS --> <td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td> <td class="gensmall" nowrap="nowrap"> [ {TOTAL_TOPICS} ] </td> - <td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- IF PAGINATION --><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --></td> + <td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- INCLUDE pagination.html --></td> <!-- ENDIF --> </tr> </table> @@ -173,12 +179,12 @@ <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}: {topicrow.PAGINATION} ] </p> <!-- ENDIF --> </td> - <td class="row2" width="100" align="center"><p class="topicauthor">{topicrow.TOPIC_AUTHOR}</p></td> + <td class="row2" width="100" align="center"><p class="topicauthor"><!-- IF topicrow.U_TOPIC_AUTHOR --><a href="{topicrow.U_TOPIC_AUTHOR}"<!-- IF topicrow.TOPIC_AUTHOR_COLOUR --> style="font-weight: bold; color: {topicrow.TOPIC_AUTHOR_COLOUR}"<!-- ENDIF -->>{topicrow.TOPIC_AUTHOR}</a><!-- ELSE -->{topicrow.TOPIC_AUTHOR}<!-- ENDIF --></p></td> <td class="row1" width="50" align="center"><p class="topicdetails">{topicrow.REPLIES}</p></td> <td class="row2" width="50" align="center"><p class="topicdetails">{topicrow.VIEWS}</p></td> <td class="row1" width="140" align="center"> <p class="topicdetails" style="white-space: nowrap;">{topicrow.LAST_POST_TIME}</p> - <p class="topicdetails"><!-- IF topicrow.U_LAST_POST_AUTHOR --><a href="{topicrow.U_LAST_POST_AUTHOR}">{topicrow.LAST_POST_AUTHOR}</a><!-- ELSE -->{topicrow.LAST_POST_AUTHOR}<!-- ENDIF --> + <p class="topicdetails"><!-- IF topicrow.U_LAST_POST_AUTHOR --><a href="{topicrow.U_LAST_POST_AUTHOR}"<!-- IF topicrow.LAST_POST_AUTHOR_COLOUR --> style="font-weight: bold; color: {topicrow.LAST_POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{topicrow.LAST_POST_AUTHOR}</a><!-- ELSE -->{topicrow.LAST_POST_AUTHOR}<!-- ENDIF --> <a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a> </p> </td> @@ -188,9 +194,9 @@ <tr> <!-- IF S_TOPIC_ICONS --> - <td class="row1" colspan="7" height="30" align="center" valign="middle"><span class="gen">{L_NO_TOPICS}</span></td> + <td class="row1" colspan="7" height="30" align="center" valign="middle"><span class="gen"><!-- IF not S_SORT_DAYS -->{L_NO_TOPICS}<!-- ELSE -->{L_NO_TOPICS_TIME_FRAME}<!-- ENDIF --></span></td> <!-- ELSE --> - <td class="row1" colspan="6" height="30" align="center" valign="middle"><span class="gen">{L_NO_TOPICS}</span></td> + <td class="row1" colspan="6" height="30" align="center" valign="middle"><span class="gen"><!-- IF not S_SORT_DAYS -->{L_NO_TOPICS}<!-- ELSE -->{L_NO_TOPICS_TIME_FRAME}<!-- ENDIF --></span></td> <!-- ENDIF --> </tr> <!-- END topicrow --> @@ -201,7 +207,7 @@ <!-- ELSE --> <td class="cat" colspan="7"> <!-- ENDIF --> - <form method="post" action="{S_TOPIC_ACTION}"><span class="gensmall">{L_DISPLAY_TOPICS}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" /></form> + <form method="post" action="{S_FORUM_ACTION}"><span class="gensmall">{L_DISPLAY_TOPICS}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" /></form> </td> </tr> </table> @@ -211,7 +217,7 @@ <td align="left" valign="middle"><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a></td> <td class="nav" nowrap="nowrap"> {PAGE_NUMBER}</td> <td class="gensmall" nowrap="nowrap"> [ {TOTAL_TOPICS} ]</td> - <td class="nav" width="100%" align="right" nowrap="nowrap"><!-- IF PAGINATION --><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --></td> + <td class="nav" width="100%" align="right" nowrap="nowrap"><!-- INCLUDE pagination.html --></td> </tr> </table> @@ -220,14 +226,7 @@ </div> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <!-- IF S_DISPLAY_ONLINE_LIST --> <br clear="all" /> @@ -267,7 +266,7 @@ <td class="gensmall">{L_NO_NEW_POSTS_HOT}</td> <td> </td> <td width="20" align="center">{FOLDER_STICKY_IMG}</td> - <td class="gensmall">{L_ICON_STICKY}</td> + <td class="gensmall">{L_ICON_STICKY}</td> </tr> <tr> <td class="gensmall">{FOLDER_LOCKED_NEW_IMG}</td> diff --git a/phpBB/styles/subSilver/template/viewonline_body.html b/phpBB/styles/subSilver/template/viewonline_body.html index 510f12f57c..b0eff81cd9 100644 --- a/phpBB/styles/subSilver/template/viewonline_body.html +++ b/phpBB/styles/subSilver/template/viewonline_body.html @@ -8,7 +8,7 @@ <table width="100%" cellspacing="1"> <tr> <td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td> - <td class="gensmall" width="100%" align="right" nowrap="nowrap"><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b></td> + <td class="gensmall" width="100%" align="right" nowrap="nowrap"><b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b></td> </tr> </table> <!-- ENDIF --> @@ -38,7 +38,7 @@ <table width="100%" cellspacing="1"> <tr> <td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td> - <td class="gensmall" width="100%" align="right" nowrap="nowrap"><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b></td> + <td class="gensmall" width="100%" align="right" nowrap="nowrap"><b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b></td> </tr> </table> <!-- ENDIF --> @@ -47,14 +47,7 @@ <br clear="all" /> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <br clear="all" /> diff --git a/phpBB/styles/subSilver/template/viewtopic_body.html b/phpBB/styles/subSilver/template/viewtopic_body.html index 61d63c3d9c..b1bfe3ccca 100644 --- a/phpBB/styles/subSilver/template/viewtopic_body.html +++ b/phpBB/styles/subSilver/template/viewtopic_body.html @@ -35,7 +35,7 @@ <!-- IF TOTAL_POSTS --> <td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td> <td class="gensmall" nowrap="nowrap"> [ {TOTAL_POSTS} ] </td> - <td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- IF PAGINATION --><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --></td> + <td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- INCLUDE pagination.html --></td> <!-- ENDIF --> </tr> </table> @@ -52,7 +52,7 @@ <!-- IF U_EMAIL_TOPIC --><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}">{L_EMAIL_TOPIC}</a><!-- IF U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF --> <!-- IF U_BUMP_TOPIC --><a href="{U_BUMP_TOPIC}" title="{L_BUMP_TOPIC}">{L_BUMP_TOPIC}</a><!-- ENDIF --> </td> - <td class="nav" align="right" nowrap="nowrap"><a href="{U_VIEW_OLDER_TOPIC}">{L_VIEW_PREVIOUS_TOPIC}</a> | <a href="{U_VIEW_UNREAD_POST}">{L_VIEW_UNREAD_POST}</a> | <a href="{U_VIEW_NEWER_TOPIC}">{L_VIEW_NEXT_TOPIC}</a> </td> + <td class="nav" align="right" nowrap="nowrap"><a href="{U_VIEW_OLDER_TOPIC}">{L_VIEW_PREVIOUS_TOPIC}</a><!-- IF U_VIEW_UNREAD_POST --> | <a href="{U_VIEW_UNREAD_POST}">{L_VIEW_UNREAD_POST}</a><!-- ENDIF --> | <a href="{U_VIEW_NEWER_TOPIC}">{L_VIEW_NEXT_TOPIC}</a> </td> </tr> </table> </td> @@ -133,12 +133,6 @@ <td class="gensmall" colspan="2" height="25" align="center">{postrow.L_IGNORE_POST}</td> <!-- ELSE --> - <!-- IF postrow.FORCE_ENCODING --> - <td class="gensmall" colspan="2" height="25" align="center">{postrow.FORCE_ENCODING}</td> - </tr> - <!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> - <!-- ENDIF --> - <td align="center" valign="middle"><!-- IF postrow.S_FIRST_UNREAD --><a name="unread"></a><!-- ENDIF --><a name="p{postrow.POST_ID}"></a><b class="postauthor">{postrow.POSTER_NAME}</b></td> <td width="100%" height="25"> <table width="100%" cellspacing="0"> @@ -274,7 +268,7 @@ <!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> <td nowrap="nowrap"> </td> - <td><div class="gensmall" style="float: left;"> <!-- 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 --> </div> <div class="gensmall" style="float:right"><!-- IF postrow.U_QUOTE --><a href="{postrow.U_QUOTE}">{QUOTE_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_EDIT --><a href="{postrow.U_EDIT}">{EDIT_IMG}</a> <!-- ENDIF --> </div></td> + <td><div class="gensmall" style="float: left;"> <!-- 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 --> </div> <div class="gensmall" style="float:right"><!-- 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 --> </div></td> </tr> <!-- ENDIF --> @@ -297,7 +291,7 @@ <!-- IF TOTAL_POSTS --> <td class="nav" valign="middle" nowrap="nowrap"> {PAGE_NUMBER}<br /></td> <td class="gensmall" nowrap="nowrap"> [ {TOTAL_POSTS} ] </td> - <td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- IF PAGINATION --><b><a href="javascript:jumpto();">{L_GOTO_PAGE}</a> <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}">{L_PREVIOUS}</a> <!-- ENDIF -->{PAGINATION}<!-- IF NEXT_PAGE --> <a href="{NEXT_PAGE}">{L_NEXT}</a><!-- ENDIF --></b><!-- ENDIF --></td> + <td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- INCLUDE pagination.html --></td> <!-- ENDIF --> </tr> </table> @@ -308,14 +302,7 @@ <br clear="all" /> -<table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> -<tr> - <td class="row1"> - <p class="breadcrumbs"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> - <p class="datetime">{S_TIMEZONE}</p> - </td> -</tr> -</table> +<!-- INCLUDE breadcrumbs.html --> <!-- IF S_DISPLAY_ONLINE_LIST --> <br clear="all" /> diff --git a/phpBB/styles/subSilver/template/viewtopic_print.html b/phpBB/styles/subSilver/template/viewtopic_print.html index 69a51f42c8..3a5fe6433c 100644 --- a/phpBB/styles/subSilver/template/viewtopic_print.html +++ b/phpBB/styles/subSilver/template/viewtopic_print.html @@ -1,8 +1,9 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html dir="{S_CONTENT_DIRECTION}"> +<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}"> <head> <meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}"> <meta http-equiv="Content-Style-Type" content="text/css"> +<meta http-equiv="Content-Language" content="{S_USER_LANG}"> <title>{SITENAME} :: {PAGE_TITLE}</title> <style type="text/css"> @@ -13,6 +14,10 @@ body { font-size: 10pt; } +img { + border: 0; +} + td { font-family: Verdana,serif; font-size: 10pt; @@ -85,7 +90,24 @@ hr.sep { <td><b>{postrow.POST_SUBJECT}</b></td> </tr> <tr> - <td colspan="2"><hr class="sep" />{postrow.MESSAGE}</td> + <td colspan="2"><hr class="sep" />{postrow.MESSAGE} + + <!-- IF postrow.S_HAS_ATTACHMENTS --> + <br clear="all" /><br /> + + <table class="tablebg" width="100%" cellspacing="1"> + <tr> + <td><b class="genmed">{L_ATTACHMENTS}: </b></td> + </tr> + <!-- BEGIN attachment --> + <tr> + <td>{postrow.attachment.DISPLAY_ATTACHMENT}</td> + </tr> + <!-- END attachment --> + </table> + <!-- ENDIF --> + + </td> </tr> </table> <!-- END postrow --> diff --git a/phpBB/styles/subSilver/theme/images/background.gif b/phpBB/styles/subSilver/theme/images/background.gif Binary files differindex d296581508..158a625620 100644 --- a/phpBB/styles/subSilver/theme/images/background.gif +++ b/phpBB/styles/subSilver/theme/images/background.gif diff --git a/phpBB/styles/subSilver/theme/images/cellpic2_rtl.jpg b/phpBB/styles/subSilver/theme/images/cellpic2_rtl.jpg Binary files differnew file mode 100644 index 0000000000..201e063725 --- /dev/null +++ b/phpBB/styles/subSilver/theme/images/cellpic2_rtl.jpg diff --git a/phpBB/styles/subSilver/theme/images/index.htm b/phpBB/styles/subSilver/theme/images/index.htm index 491b26dd23..29531416fe 100644 --- a/phpBB/styles/subSilver/theme/images/index.htm +++ b/phpBB/styles/subSilver/theme/images/index.htm @@ -8,7 +8,7 @@ <table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0"> <tr> - <td align="center" valign="middle"><a href="http://www.subblue.com/" target="_new"><img src="created_by.jpg" width="400" height="300" border="0" alt="Created by subBlue Design" /></a></td> + <td align="center" valign="middle"><a href="http://www.subblue.com/" target="_new"><img src="created_by.jpg" width="400" height="300" alt="Created by subBlue Design" /></a></td> </tr> </table> diff --git a/phpBB/styles/subSilver/theme/stylesheet.css b/phpBB/styles/subSilver/theme/stylesheet.css index 239ed7570d..11455ce5bb 100644 --- a/phpBB/styles/subSilver/theme/stylesheet.css +++ b/phpBB/styles/subSilver/theme/stylesheet.css @@ -28,7 +28,7 @@ html { body { /* Text-Sizing with ems: http://www.clagnut.com/blog/348/ */ - font-family: Verdana, Helvetica, Arial, sans-serif; + font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; color: #323D4F; background-color: #FFFFFF; font-size: 62.5%; /* This sets the default font size to be equivalent to 10px */ @@ -87,7 +87,7 @@ body { padding: 4px; font-weight: normal; font-size: 1.1em; - font-family: Verdana, Arial, Helvetica, sans-serif; + font-family: "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; } #pageheader { } @@ -103,7 +103,7 @@ body { --------------------- */ h1 { color: black; - font-family: 'Trebuchet MS', Verdana, sans-serif; + font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; font-weight: bold; font-size: 1.8em; text-decoration: none; @@ -258,7 +258,7 @@ p.topicdetails { .copyright { color: #444; font-weight: normal; - font-family: Verdana, Arial, Helvetica, sans-serif; + font-family: "Lucida Grande", Verdana, Arial, Helvetica, sans-serif; } .titles { @@ -302,6 +302,9 @@ td { background-image: url('./images/cellpic2.jpg'); background-repeat: repeat-y; } +.rtl .catdiv { + background-image: url('./images/cellpic2_rtl.jpg'); +} .cat { height: 28px; @@ -417,7 +420,7 @@ form { input { color: #333333; - font-family: Verdana, Helvetica, sans-serif; + font-family: "Lucida Grande", Verdana, Helvetica, sans-serif; font-size: 1.1em; font-weight: normal; padding: 1px; @@ -428,7 +431,7 @@ input { textarea { background-color: #FAFAFA; color: #333333; - font-family: Verdana, Helvetica, Arial, sans-serif; + font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; font-size: 1.3em; line-height: 1.4em; font-weight: normal; @@ -439,7 +442,7 @@ textarea { select { color: #333333; background-color: #FAFAFA; - font-family: Verdana, Helvetica, sans-serif; + font-family: "Lucida Grande", Verdana, Helvetica, sans-serif; font-size: 1.1em; font-weight: normal; border: 1px solid #A9B8C2; @@ -465,7 +468,7 @@ input.radio { color: #000000; font-weight: normal; font-size: 1.1em; - font-family: Verdana, Helvetica, sans-serif; + font-family: "Lucida Grande", Verdana, Helvetica, sans-serif; background-color: #EFEFEF; border: 1px solid #666666; } @@ -538,7 +541,7 @@ input.radio { border-color: #A9B8C2; color: #333333; background-color: #A9B8C2; - font-family: Verdana, Helvetica, Arial, sans-serif; + font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; font-size: 0.8em; } diff --git a/phpBB/ucp.php b/phpBB/ucp.php index bf0d562dcb..f0758e752e 100755 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -244,7 +244,7 @@ if (!$user->data['is_registered']) $update_time = $config['load_online_time'] * 60; $sql = $db->sql_build_query('SELECT_DISTINCT', array( - 'SELECT' => 'u.user_id, u.username, u.user_allow_viewonline, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline', + 'SELECT' => 'u.user_id, u.username, u.user_colour, u.user_allow_viewonline, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline', 'FROM' => array( USERS_TABLE => 'u', @@ -262,7 +262,7 @@ $sql = $db->sql_build_query('SELECT_DISTINCT', array( AND z.friend = 1 AND u.user_id = z.zebra_id', - 'GROUP_BY' => 'z.zebra_id, u.user_id, u.username, u.user_allow_viewonline', + 'GROUP_BY' => 'z.zebra_id, u.user_id, u.username, u.user_allow_viewonline, u.user_colour', 'ORDER_BY' => 'u.username ASC', )); @@ -276,40 +276,13 @@ while ($row = $db->sql_fetchrow($result)) $template->assign_block_vars("friends_{$which}", array( 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), - 'USER_ID' => $row['user_id'], - 'USERNAME' => $row['username']) + 'USER_ID' => $row['user_id'], + 'USER_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '', + 'USERNAME' => $row['username']) ); } $db->sql_freeresult($result); -// Output PM_TO box if message composing -if ($mode == 'compose' && $auth->acl_get('u_sendpm') && request_var('action', '') != 'edit') -{ - if ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) - { - $sql = 'SELECT group_id, group_name, group_type - FROM ' . GROUPS_TABLE . ' - WHERE group_type NOT IN (' . GROUP_HIDDEN . ', ' . GROUP_CLOSED . ') - AND group_receive_pm = 1 - ORDER BY group_type DESC'; - $result = $db->sql_query($sql); - - $group_options = ''; - while ($row = $db->sql_fetchrow($result)) - { - $group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="blue"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>'; - } - $db->sql_freeresult($result); - } - - $template->assign_vars(array( - 'S_SHOW_PM_BOX' => true, - 'S_ALLOW_MASS_PM' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? true : false, - 'S_GROUP_OPTIONS' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? $group_options : '', - 'U_SEARCH_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=post&field=username_list')) - ); -} - // Instantiate module system and generate list of available modules $module->list_modules('ucp'); diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 36f740e210..21a2ebce73 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -77,7 +77,7 @@ if (isset($_GET['e']) && !$user->data['is_registered']) } // Permissions check -if (!$auth->acl_get('f_read', $forum_id)) +if (!$auth->acl_gets('f_list', 'f_read', $forum_id)) { if ($user->data['user_id'] != ANONYMOUS) { @@ -89,10 +89,10 @@ if (!$auth->acl_get('f_read', $forum_id)) // Is this forum a link? ... User got here either because the // number of clicks is being tracked or they guessed the id -if ($forum_data['forum_link']) +if ($forum_data['forum_type'] == FORUM_LINK && $forum_data['forum_link']) { // Does it have click tracking enabled? - if ($forum_data['forum_flags'] & 1) + if ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) { $sql = 'UPDATE ' . FORUMS_TABLE . ' SET forum_posts = forum_posts + 1 @@ -114,7 +114,10 @@ if ($forum_data['forum_password']) generate_forum_nav($forum_data); // Forum Rules -generate_forum_rules($forum_data); +if ($auth->acl_get('f_read', $forum_id)) +{ + generate_forum_rules($forum_data); +} // Do we have subforums? $active_forum_ary = $moderators = array(); @@ -139,7 +142,13 @@ $template->set_filenames(array( make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"), $forum_id); // Not postable forum or showing active topics? -if (!($forum_data['forum_type'] == FORUM_POST || (($forum_data['forum_flags'] & 16) && $forum_data['forum_type'] == FORUM_CAT))) +if (!($forum_data['forum_type'] == FORUM_POST || (($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS) && $forum_data['forum_type'] == FORUM_CAT))) +{ + page_footer(); +} + +// Ok, if someone has only list-access, we only display the forum list +if (!$auth->acl_get('f_read', $forum_id)) { page_footer(); } @@ -185,8 +194,6 @@ $limit_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']); $sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'r' => 't.topic_replies', 's' => 't.topic_title', 'v' => 't.topic_views'); -$sort_key = (!in_array($sort_key, array('a', 't', 'r', 's', 'v'))) ? 't' : $sort_key; - $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); @@ -210,18 +217,13 @@ if ($sort_days) $start = 0; } $sql_limit_time = "AND t.topic_last_post_time >= $min_post_time"; + + // Make sure we have information about day selection ready + $template->assign_var('S_SORT_DAYS', true); } else { - if ($auth->acl_get('m_approve', $forum_id)) - { - $topics_count = ($forum_data['forum_topics_real']) ? $forum_data['forum_topics_real'] : 1; - } - else - { - $topics_count = ($forum_data['forum_topics']) ? $forum_data['forum_topics'] : 1; - } - + $topics_count = ($auth->acl_get('m_approve', $forum_id)) ? $forum_data['forum_topics_real'] : $forum_data['forum_topics']; $sql_limit_time = ''; } @@ -229,7 +231,7 @@ else $post_alt = ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['FORUM_LOCKED'] : $user->lang['POST_NEW_TOPIC']; // Display active topics? -$s_display_active = ($forum_data['forum_type'] == FORUM_CAT && ($forum_data['forum_flags'] & 16)) ? true : false; +$s_display_active = ($forum_data['forum_type'] == FORUM_CAT && ($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false; $template->assign_vars(array( 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&$u_sort_param"), $topics_count, $config['topics_per_page'], $start), @@ -277,8 +279,7 @@ $template->assign_vars(array( ); // Grab icons -$icons = array(); -$cache->obtain_icons($icons); +$icons = $cache->obtain_icons(); // Grab all topic data $rowset = $announcement_list = $topic_list = $global_announce_list = array(); @@ -365,23 +366,29 @@ else $sql_start = $start; } -// Obtain other topics +// SQL array for obtaining topics/stickies $sql_array = array( 'SELECT' => $sql_array['SELECT'], 'FROM' => $sql_array['FROM'], 'LEFT_JOIN' => $sql_array['LEFT_JOIN'], - 'WHERE' => (($forum_data['forum_type'] == FORUM_POST || !sizeof($active_forum_ary)) ? 't.forum_id = ' . $forum_id : $db->sql_in_set('t.forum_id', $active_forum_ary['forum_id'])) . ' - AND t.topic_type NOT IN (' . POST_ANNOUNCE . ', ' . POST_GLOBAL . ") + 'WHERE' => (($forum_data['forum_type'] == FORUM_POST || !sizeof($active_forum_ary)) ? 't.forum_id = ' . $forum_id : $db->sql_in_set('t.forum_id', $active_forum_ary['forum_id'])) . " + AND t.topic_type = {SQL_TOPIC_TYPE} $sql_approved $sql_limit_time", - 'ORDER_BY' => 't.topic_type ' . ((!$store_reverse) ? 'DESC' : 'ASC') . ', ' . $sql_sort_order, + 'ORDER_BY' => $sql_sort_order, ); + +// If store_reverse, then first obtain topics, then stickies, else the other way around... +// Funnily enough you typically save one query if going from the last page to the middle (store_reverse) because +// the number of stickies are not known $sql = $db->sql_build_query('SELECT', $sql_array); +$sql = str_replace('{SQL_TOPIC_TYPE}', ($store_reverse) ? POST_NORMAL : POST_STICKY, $sql); $result = $db->sql_query_limit($sql, $sql_limit, $sql_start); $shadow_topic_list = array(); +$num_rows = 0; while ($row = $db->sql_fetchrow($result)) { if ($row['topic_status'] == ITEM_MOVED) @@ -391,9 +398,30 @@ while ($row = $db->sql_fetchrow($result)) $rowset[$row['topic_id']] = $row; $topic_list[] = $row['topic_id']; + $num_rows++; } $db->sql_freeresult($result); +// If the number of topics exceeds the sql limit then we do not need to retrieve the remaining topic type +if ($num_rows < $sql_limit) +{ + $sql = $db->sql_build_query('SELECT', $sql_array); + $sql = str_replace('{SQL_TOPIC_TYPE}', ($store_reverse) ? POST_STICKY : POST_NORMAL, $sql); + $result = $db->sql_query_limit($sql, $sql_limit - $num_rows, $sql_start); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['topic_status'] == ITEM_MOVED) + { + $shadow_topic_list[$row['topic_moved_id']] = $row['topic_id']; + } + + $rowset[$row['topic_id']] = $row; + $topic_list[] = $row['topic_id']; + } + $db->sql_freeresult($result); +} + // If we have some shadow topics, update the rowset to reflect their topic informations if (sizeof($shadow_topic_list)) { @@ -509,13 +537,17 @@ if (sizeof($topic_list)) // Send vars to template $template->assign_block_vars('topicrow', array( - 'FORUM_ID' => $forum_id, - 'TOPIC_ID' => $topic_id, - 'TOPIC_AUTHOR' => topic_topic_author($row), - 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), - 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), - 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), - 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name']) ? $row['topic_last_poster_name'] : $user->lang['GUEST'], + 'FORUM_ID' => $forum_id, + 'TOPIC_ID' => $topic_id, + 'TOPIC_AUTHOR' => ($row['topic_first_poster_name']) ? $row['topic_first_poster_name'] : $user->lang['GUEST'], + 'TOPIC_AUTHOR_COLOUR' => ($row['topic_first_poster_colour']) ? '#' . $row['topic_first_poster_colour'] : '', + 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), + 'LAST_POST_SUBJECT' => censor_text($row['topic_last_post_subject']), + 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), + 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), + 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name']) ? $row['topic_last_poster_name'] : $user->lang['GUEST'], + 'LAST_POST_AUTHOR_COLOUR' => ($row['topic_last_poster_colour']) ? '#' . $row['topic_last_poster_colour'] : '', + 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url), 'REPLIES' => $replies, 'VIEWS' => $row['topic_views'], @@ -527,7 +559,7 @@ if (sizeof($topic_list)) 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '', - 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '', 'S_TOPIC_TYPE' => $row['topic_type'], @@ -546,6 +578,7 @@ if (sizeof($topic_list)) 'U_NEWEST_POST' => $view_topic_url . '&view=unread#unread', 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR' => ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_last_poster_id']) : '', + 'U_TOPIC_AUTHOR' => ($row['topic_poster'] != ANONYMOUS && $row['topic_poster']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_poster']) : '', 'U_VIEW_TOPIC' => $view_topic_url, 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&f=' . $forum_id . '&t=' . $topic_id, true, $user->session_id), 'U_MCP_QUEUE' => $u_mcp_queue, diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index d202ef949e..f38073a80b 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -33,6 +33,11 @@ $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang[' $sort_key_sql = array('a' => 'u.username', 'b' => 's.session_time', 'c' => 's.session_page'); // Sorting and order +if (!isset($sort_key_text[$sort_key])) +{ + $sort_key = 'b'; +} + $order_by = $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); // Whois requested @@ -51,7 +56,7 @@ if ($mode == 'whois') $whois = user_ipwhois($row['session_ip']); $whois = preg_replace('#(\s)([\w\-\._\+]+@[\w\-\.]+)(\s)#', '\1<a href="mailto:\2">\2</a>\3', $whois); - $whois = preg_replace('#(\s)(http:/{2}[^\s]*)(\s)#', '\1<a href="\2" target="_blank">\2</a>\3', $whois); + $whois = preg_replace('#(\s)(http:/{2}[^\s]*)(\s)#', '\1<a href="\2">\2</a>\3', $whois); $template->assign_vars(array( 'WHOIS' => trim($whois)) @@ -87,7 +92,7 @@ $guest_counter = 0; // Get number of online guests (if we do not display them) if (!$show_guests) { - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'sqlite': $sql = 'SELECT COUNT(session_ip) as num_guests @@ -104,6 +109,7 @@ if (!$show_guests) FROM ' . SESSIONS_TABLE . ' WHERE session_user_id = ' . ANONYMOUS . ' AND session_time >= ' . (time() - ($config['load_online_time'] * 60)); + break; } $result = $db->sql_query($sql); $guest_counter = (int) $db->sql_fetchfield('num_guests'); @@ -339,13 +345,21 @@ $pagination = generate_pagination(append_sid("{$phpbb_root_path}viewonline.$phpE $sql = 'SELECT group_id, group_name, group_colour, group_type FROM ' . GROUPS_TABLE . ' WHERE group_legend = 1 + AND group_type <> ' . GROUP_HIDDEN . ' ORDER BY group_name ASC'; $result = $db->sql_query($sql); $legend = ''; while ($row = $db->sql_fetchrow($result)) { - $legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>'; + if ($row['group_name'] == 'BOTS') + { + $legend .= (($legend != '') ? ', ' : '') . '<span style="color:#' . $row['group_colour'] . '">' . $user->lang['G_BOTS'] . '</span>'; + } + else + { + $legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>'; + } } $db->sql_freeresult($result); diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index e296f80438..2898a1c20a 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -16,6 +16,7 @@ $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); +include($phpbb_root_path . 'includes/bbcode.' . $phpEx); // Start session management $user->session_begin(); @@ -69,27 +70,32 @@ if ($view && !$post_id) $topic_last_read = (isset($topic_tracking_info[$topic_id])) ? $topic_tracking_info[$topic_id] : 0; - $sql = 'SELECT p.post_id, p.topic_id, p.forum_id - FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t - WHERE t.topic_id = $topic_id - AND p.topic_id = t.topic_id - " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1') . " - AND (p.post_time > $topic_last_read - OR p.post_id = t.topic_last_post_id) - ORDER BY p.post_time ASC"; + $sql = 'SELECT post_id, topic_id, forum_id + FROM ' . POSTS_TABLE . " + WHERE topic_id = $topic_id + " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1') . " + AND post_time > $topic_last_read + ORDER BY post_time ASC"; $result = $db->sql_query_limit($sql, 1); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); if (!$row) { + $sql = 'SELECT topic_last_post_id as post_id, topic_id, forum_id + FROM ' . TOPICS_TABLE . ' + WHERE topic_id = ' . $topic_id; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + + if (!$row) + { // Setup user environment so we can process lang string $user->setup('viewtopic'); - $redirect = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"); - - meta_refresh(3, $redirect); - trigger_error($user->lang['NO_UNREAD_POSTS'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect . '">', '</a>')); + trigger_error('NO_TOPIC'); } $post_id = $row['post_id']; @@ -238,19 +244,34 @@ if (!$topic_data) // This is for determining where we are (page) if ($post_id) { - /** - * @todo adjust for using post_time? Generally adjust query... it is not called very often though - */ - $sql = 'SELECT COUNT(post_id) AS prev_posts - FROM ' . POSTS_TABLE . " - WHERE topic_id = {$topic_data['topic_id']} - " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved = 1' : '') . " - AND " . (($sort_dir == 'd') ? "post_id >= $post_id" : "post_id <= $post_id"); - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); + 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'; - $topic_data['prev_posts'] = $row['prev_posts']; + if ($sort_dir == $check_sort) + { + $topic_data['prev_posts'] = ($auth->acl_get('m_approve', $forum_id)) ? $topic_data['topic_replies_real'] + 1 : $topic_data['topic_replies'] + 1; + } + else + { + $topic_data['prev_posts'] = 1; + } + } + else + { + $sql = 'SELECT COUNT(p1.post_id) AS prev_posts + FROM ' . POSTS_TABLE . ' p1, ' . POSTS_TABLE . " p2 + WHERE p1.topic_id = {$topic_data['topic_id']} + AND p2.post_id = {$post_id} + " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p1.post_approved = 1' : '') . ' + AND ' . (($sort_dir == 'd') ? 'p1.post_time >= p2.post_time' : 'p1.post_time <= p2.post_time'); + + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $topic_data['prev_posts'] = $row['prev_posts']; + } } $forum_id = (int) $topic_data['forum_id']; @@ -450,18 +471,16 @@ if ($config['allow_bookmarks'] && $user->data['is_registered'] && request_var('b } // Grab ranks -$ranks = array(); -$cache->obtain_ranks($ranks); +$ranks = $cache->obtain_ranks(); // Grab icons -$icons = array(); -$cache->obtain_icons($icons); +$icons = $cache->obtain_icons(); // Grab extensions $extensions = array(); if ($topic_data['topic_attachment']) { - $cache->obtain_attach_extensions($extensions); + $extensions = $cache->obtain_attach_extensions(); } // Forum rules listing @@ -472,13 +491,13 @@ gen_forum_auth_level('topic', $forum_id, $topic_data['forum_status']); $allow_change_type = ($auth->acl_get('m_', $forum_id) || ($user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'])) ? true : false; $topic_mod = ''; -$topic_mod .= ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'])) ? (($topic_data['topic_status'] == ITEM_UNLOCKED) ? '<option value="lock">' . $user->lang['LOCK_TOPIC'] . '</option>' : '<option value="unlock">' . $user->lang['UNLOCK_TOPIC'] . '</option>') : ''; +$topic_mod .= ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'] && $topic_data['topic_status'] == ITEM_UNLOCKED)) ? (($topic_data['topic_status'] == ITEM_UNLOCKED) ? '<option value="lock">' . $user->lang['LOCK_TOPIC'] . '</option>' : '<option value="unlock">' . $user->lang['UNLOCK_TOPIC'] . '</option>') : ''; $topic_mod .= ($auth->acl_get('m_delete', $forum_id)) ? '<option value="delete_topic">' . $user->lang['DELETE_TOPIC'] . '</option>' : ''; $topic_mod .= ($auth->acl_get('m_move', $forum_id)) ? '<option value="move">' . $user->lang['MOVE_TOPIC'] . '</option>' : ''; $topic_mod .= ($auth->acl_get('m_split', $forum_id)) ? '<option value="split">' . $user->lang['SPLIT_TOPIC'] . '</option>' : ''; $topic_mod .= ($auth->acl_get('m_merge', $forum_id)) ? '<option value="merge">' . $user->lang['MERGE_TOPIC'] . '</option>' : ''; $topic_mod .= ($auth->acl_get('m_move', $forum_id)) ? '<option value="fork">' . $user->lang['FORK_TOPIC'] . '</option>' : ''; -$topic_mod .= ($allow_change_type && $auth->acl_gets(array('f_sticky', 'f_announce'), $forum_id) && $topic_data['topic_type'] != POST_NORMAL) ? '<option value="make_normal">' . $user->lang['MAKE_NORMAL'] . '</option>' : ''; +$topic_mod .= ($allow_change_type && $auth->acl_gets('f_sticky', 'f_announce', $forum_id) && $topic_data['topic_type'] != POST_NORMAL) ? '<option value="make_normal">' . $user->lang['MAKE_NORMAL'] . '</option>' : ''; $topic_mod .= ($allow_change_type && $auth->acl_get('f_sticky', $forum_id) && $topic_data['topic_type'] != POST_STICKY) ? '<option value="make_sticky">' . $user->lang['MAKE_STICKY'] . '</option>' : ''; $topic_mod .= ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_ANNOUNCE) ? '<option value="make_announce">' . $user->lang['MAKE_ANNOUNCE'] . '</option>' : ''; $topic_mod .= ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_GLOBAL) ? '<option value="make_global">' . $user->lang['MAKE_GLOBAL'] . '</option>' : ''; @@ -550,7 +569,6 @@ $template->assign_vars(array( 'U_TOPIC' => "{$server_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id", 'U_FORUM' => $server_path, - 'U_VIEW_UNREAD_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=unread") . '#unread', 'U_VIEW_TOPIC' => $viewtopic_url, 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), 'U_VIEW_OLDER_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=previous"), @@ -707,7 +725,6 @@ if (!empty($topic_data['poll_start'])) if ($poll_info[0]['bbcode_bitfield']) { - include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); $poll_bbcode = new bbcode(); } else @@ -718,6 +735,7 @@ if (!empty($topic_data['poll_start'])) for ($i = 0, $size = sizeof($poll_info); $i < $size; $i++) { $poll_info[$i]['poll_option_text'] = censor_text($poll_info[$i]['poll_option_text']); + $poll_info[$i]['poll_option_text'] = str_replace("\n", '<br />', $poll_info[$i]['poll_option_text']); if ($poll_bbcode !== false) { @@ -725,17 +743,16 @@ if (!empty($topic_data['poll_start'])) } $poll_info[$i]['poll_option_text'] = smiley_text($poll_info[$i]['poll_option_text']); - $poll_info[$i]['poll_option_text'] = str_replace("\n", '<br />', $poll_info[$i]['poll_option_text']); } $topic_data['poll_title'] = censor_text($topic_data['poll_title']); + $topic_data['poll_title'] = str_replace("\n", '<br />', $topic_data['poll_title']); if ($poll_bbcode !== false) { $poll_bbcode->bbcode_second_pass($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield']); } $topic_data['poll_title'] = smiley_text($topic_data['poll_title']); - $topic_data['poll_title'] = str_replace("\n", '<br />', $topic_data['poll_title']); unset($poll_bbcode); @@ -755,6 +772,8 @@ if (!empty($topic_data['poll_start'])) ); } + $poll_end = $topic_data['poll_length'] + $topic_data['poll_start']; + $template->assign_vars(array( 'POLL_QUESTION' => $topic_data['poll_title'], 'TOTAL_VOTES' => $poll_total, @@ -762,7 +781,7 @@ if (!empty($topic_data['poll_start'])) 'POLL_RIGHT_CAP_IMG'=> $user->img('poll_right'), 'L_MAX_VOTES' => ($topic_data['poll_max_options'] == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $topic_data['poll_max_options']), - 'L_POLL_LENGTH' => ($topic_data['poll_length']) ? sprintf($user->lang['POLL_RUN_TILL'], $user->format_date($topic_data['poll_length'] + $topic_data['poll_start'])) : '', + 'L_POLL_LENGTH' => ($topic_data['poll_length']) ? sprintf($user->lang[($poll_end > time()) ? 'POLL_RUN_TILL' : 'POLL_ENDED_AT'], $user->format_date($poll_end)) : '', 'S_HAS_POLL' => true, 'S_CAN_VOTE' => $s_can_vote, @@ -773,7 +792,7 @@ if (!empty($topic_data['poll_start'])) 'U_VIEW_RESULTS' => $viewtopic_url . '&view=viewpoll') ); - unset($poll_info, $voted_id); + unset($poll_end, $poll_info, $voted_id); } // If the user is trying to reach the second half of the topic, fetch it starting from the end @@ -803,15 +822,15 @@ else // 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; -$bbcode_bitfield = $force_encoding = ''; +$bbcode_bitfield = ''; $i = $i_total = 0; // 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' . (($sort_by_sql[$sort_key][0] == 'u') ? ', ' . 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': '') . " + " . (($sort_by_sql[$sort_key][0] == 'u') ? '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); @@ -826,7 +845,14 @@ $db->sql_freeresult($result); if (!sizeof($post_list)) { - trigger_error('NO_TOPIC'); + if ($sort_days) + { + trigger_error('NO_POSTS_TIME_FRAME'); + } + else + { + trigger_error('NO_TOPIC'); + } } // Holding maximum post time for marking topic read @@ -854,8 +880,7 @@ $sql = $db->sql_build_query('SELECT', array( $result = $db->sql_query($sql); -$today = explode('-', date('j-n-Y', time() + $user->timezone + $user->dst)); -$today = array('day' => (int) $today[0], 'month' => (int) $today[1], 'year' => (int) $today[2]); +$now = getdate(time() + $user->timezone + $user->dst - (date('H', time()) - gmdate('H', time())) * 3600); // Posts are stored in the $rowset array while $attach_list, $user_cache // and the global bbcode_bitfield are built @@ -915,7 +940,6 @@ while ($row = $db->sql_fetchrow($result)) 'post_approved' => $row['post_approved'], 'post_reported' => $row['post_reported'], 'post_text' => $row['post_text'], - 'post_encoding' => $row['post_encoding'], 'bbcode_uid' => $row['bbcode_uid'], 'bbcode_bitfield' => $row['bbcode_bitfield'], 'enable_smilies' => $row['enable_smilies'], @@ -1079,17 +1103,17 @@ while ($row = $db->sql_fetchrow($result)) if ($bday_year) { - $diff = $today['month'] - $bday_month; + $diff = $now['mon'] - $bday_month; if ($diff == 0) { - $diff = ($today['day'] - $bday_day < 0) ? 1 : 0; + $diff = ($now['mday'] - $bday_day < 0) ? 1 : 0; } else { $diff = ($diff < 0) ? 1 : 0; } - $user_cache[$poster_id]['age'] = (int) ($today['year'] - $bday_year - $diff); + $user_cache[$poster_id]['age'] = (int) ($now['year'] - $bday_year - $diff); } } } @@ -1129,7 +1153,7 @@ unset($id_cache); // Pull attachment data if (sizeof($attach_list)) { - if ($auth->acl_gets('f_download', 'u_download', $forum_id)) + if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id)) { $sql = 'SELECT * FROM ' . ATTACHMENTS_TABLE . ' @@ -1201,7 +1225,6 @@ if (sizeof($attach_list)) // Instantiate BBCode if need be if ($bbcode_bitfield !== '') { - include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); $bbcode = new bbcode(base64_encode($bbcode_bitfield)); } @@ -1213,7 +1236,7 @@ $template->assign_vars(array( ); // Output the posts -$first_unread = false; +$first_unread = $post_unread = false; for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) { $row =& $rowset[$post_list[$i]]; @@ -1231,15 +1254,12 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) continue; } - else if ($row['post_encoding'] != $user->lang['ENCODING'] && $view == 'encoding' && $post_id == $row['post_id']) - { - $force_encoding = $row['post_encoding']; - } // End signature parsing, only if needed if ($user_cache[$poster_id]['sig'] && empty($user_cache[$poster_id]['sig_parsed'])) { $user_cache[$poster_id]['sig'] = censor_text($user_cache[$poster_id]['sig']); + $user_cache[$poster_id]['sig'] = str_replace("\n", '<br />', $user_cache[$poster_id]['sig']); if ($user_cache[$poster_id]['sig_bbcode_bitfield']) { @@ -1247,12 +1267,12 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) } $user_cache[$poster_id]['sig'] = smiley_text($user_cache[$poster_id]['sig']); - $user_cache[$poster_id]['sig'] = str_replace("\n", '<br />', $user_cache[$poster_id]['sig']); $user_cache[$poster_id]['sig_parsed'] = true; } // Parse the message and subject $message = censor_text($row['post_text']); + $message = str_replace("\n", '<br />', $message); // Second parse bbcode here if ($row['bbcode_bitfield']) @@ -1277,12 +1297,11 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) // Highlight active words (primarily for search) if ($highlight_match) { - $message = preg_replace('#(?!<.*)(?<!\w)(' . $highlight_match . ')(?!\w|[^<>]*>)#i', '<span class="posthilit">\1</span>', $message); + $message = preg_replace('#(?!<.*)(?<!\w)(' . $highlight_match . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">\1</span>', $message); } // Replace naughty words such as farty pants $row['post_subject'] = censor_text($row['post_subject']); - $message = str_replace("\n", '<br />', $message); // Editing information if (($row['post_edit_count'] && $config['display_last_edited']) || $row['post_edit_reason']) @@ -1391,8 +1410,6 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) '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), - 'FORCE_ENCODING' => ($row['post_encoding'] != $user->lang['ENCODING']) ? sprintf($user->lang['POST_ENCODING'], $row['poster'], '<a href="' . $viewtopic_url . "&p={$row['post_id']}&view=encoding#p{$row['post_id']}" . '">', '</a>') : '', - 'U_EDIT' => (($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&f=$forum_id&p={$row['post_id']}") : '', 'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$row['post_id']}") : '', 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&f=$forum_id&p=" . $row['post_id'], true, $user->session_id) : '', @@ -1488,13 +1505,45 @@ if (isset($topic_tracking_info[$topic_id]) && $topic_data['topic_last_post_time' markread('topic', $forum_id, $topic_id, $max_post_time); // Update forum info - 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($forum_id, $topic_data['forum_last_post_time'], (isset($topic_data['forum_mark_time'])) ? $topic_data['forum_mark_time'] : false, false); +} +else +{ + $all_marked_read = true; +} + +// If there are absolutely no more unread posts in this forum and unread posts shown, we can savely show the #unread link +if ($all_marked_read && $post_unread) +{ + $template->assign_vars(array( + 'U_VIEW_UNREAD_POST' => '#unread', + )); +} +else if (!$all_marked_read) +{ + $last_page = ((floor($start / $config['posts_per_page']) + 1) == max(ceil($total_posts / $config['posts_per_page']), 1)) ? true : false; + + // What can happen is that we are at the last displayed page. If so, we also display the #unread link based in $post_unread + if ($last_page && $post_unread) + { + $template->assign_vars(array( + 'U_VIEW_UNREAD_POST' => '#unread', + )); + } + else if (!$last_page) + { + $template->assign_vars(array( + 'U_VIEW_UNREAD_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=unread") . '#unread', + )); + } } -// Change encoding if appropriate -if ($force_encoding != '') +// 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. +if (empty($_REQUEST['f'])) { - $user->lang['ENCODING'] = $force_encoding; + $_REQUEST['f'] = $forum_id; } // Output the page |
