diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-06 20:53:46 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-06 20:53:46 +0000 |
commit | dd9ad539fdab80badedf801a816b8a0beafbbf5c (patch) | |
tree | db8ae8a184b060d5576604cc0dfa723773daedb8 | |
parent | 2c8afb820e3842bed2ab6cec4053e71b5c566985 (diff) | |
download | forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar.gz forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar.bz2 forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar.xz forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.zip |
ok, this one is rather large... the most important change:
re-introduce append_sid: old style continues to work, not a performance hog as it was in 2.0.x -> structure is different
apart from this, code cleanage, bug fixing, etc.
git-svn-id: file:///svn/phpbb/trunk@6015 89ea8834-ac86-4346-8a33-228a782c2dd0
148 files changed, 5078 insertions, 3911 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 29d6539f80..4c71fe0aa9 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -16,9 +16,9 @@ define('NEED_SID', true); // Include files $phpbb_root_path = './../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -require($phpbb_root_path . 'common.'.$phpEx); -require($phpbb_root_path . 'includes/functions_admin.'.$phpEx); -require($phpbb_root_path . 'includes/functions_module.'.$phpEx); +require($phpbb_root_path . 'common.' . $phpEx); +require($phpbb_root_path . 'includes/functions_admin.' . $phpEx); +require($phpbb_root_path . 'includes/functions_module.' . $phpEx); // Start session management $user->session_begin(); @@ -58,6 +58,7 @@ $mode = request_var('mode', ''); // Set custom template for admin area $template->set_custom_template($phpbb_admin_path . 'style', 'admin'); $template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style'); + // the acp template is never stored in the database $user->theme['template_storedb'] = false; @@ -75,7 +76,7 @@ $module->set_active($module_id, $mode); // Assign data to the template engine for the list of modules // We do this before loading the active module for correct menu display in trigger_error -$module->assign_tpl_vars("{$phpbb_admin_path}index.$phpEx$SID"); +$module->assign_tpl_vars(append_sid("{$phpbb_admin_path}index.$phpEx")); // Load and execute the relevant module $module->load_active(); @@ -89,19 +90,19 @@ $template->set_filenames(array( adm_page_footer(); -// --------- -// FUNCTIONS -// +/** +* Header for acp pages +*/ function adm_page_header($page_title) { global $config, $db, $user, $template; - global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID; if (defined('HEADER_INC')) { return; } - + define('HEADER_INC', true); // gzip_compression @@ -116,17 +117,20 @@ function adm_page_header($page_title) $template->assign_vars(array( 'PAGE_TITLE' => $page_title, 'USERNAME' => $user->data['username'], + + 'SID' => $SID, + '_SID' => $_SID, + 'SESSION_ID' => $user->session_id, 'ROOT_PATH' => $phpbb_admin_path, - 'U_LOGOUT' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=logout", - 'U_ADM_INDEX' => "{$phpbb_admin_path}index.$phpEx$SID", - 'U_INDEX' => "{$phpbb_root_path}index.$phpEx$SID", + 'U_LOGOUT' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout'), + 'U_ADM_INDEX' => append_sid("{$phpbb_admin_path}index.$phpEx"), + 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"), - 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], - 'S_CONTENT_ENCODING' => $user->lang['ENCODING'], - 'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'], - 'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT'], - ) + 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], + 'S_CONTENT_ENCODING' => $user->lang['ENCODING'], + 'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'], + 'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT']) ); if (!empty($config['send_encoding'])) @@ -140,10 +144,13 @@ function adm_page_header($page_title) return; } +/** +* Page footer for acp pages +*/ function adm_page_footer($copyright_html = true) { global $db, $config, $template, $user, $auth, $cache; - global $SID, $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx; // Output page creation time if (defined('DEBUG')) @@ -179,8 +186,7 @@ function adm_page_footer($copyright_html = true) $template->assign_vars(array( 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '', 'S_COPYRIGHT_HTML' => $copyright_html, - 'VERSION' => $config['version'] - ) + 'VERSION' => $config['version']) ); $template->display('body'); @@ -197,12 +203,18 @@ function adm_page_footer($copyright_html = true) exit; } +/** +* Generate back link for acp pages +*/ function adm_back_link($u_action) { global $user; return '<br /><br /><a href="' . $u_action . '">« ' . $user->lang['BACK_TO_PREV'] . '</a>'; } +/** +* Build select field options in acp pages +*/ function build_select($option_ary, $option_default = false) { global $user; @@ -217,6 +229,9 @@ function build_select($option_ary, $option_default = false) return $html; } +/** +* Build radio fields in acp pages +*/ function h_radio($name, &$input_ary, $input_default = false, $id = false, $key = false) { global $user; @@ -234,6 +249,9 @@ function h_radio($name, &$input_ary, $input_default = false, $id = false, $key = return $html; } +/** +* Build configuration template for acp configuration pages +*/ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) { global $user, $module; @@ -249,21 +267,21 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) $maxlength = (int) $tpl_type[2]; $tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="' . $name . '" value="' . $new[$config_key] . '" />'; - break; + break; case 'dimension': $size = (int) $tpl_type[1]; $maxlength = (int) $tpl_type[2]; $tpl = '<input id="' . $key . '" type="text"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="config[' . $config_key . '_height]" value="' . $new[$config_key . '_height'] . '" /> x <input type="text"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="config[' . $config_key . '_width]" value="' . $new[$config_key . '_width'] . '" />'; - break; + break; case 'textarea': $rows = (int) $tpl_type[1]; $cols = (int) $tpl_type[2]; $tpl = '<textarea id="' . $key . '" name="' . $name . '" rows="' . $rows . '" cols="' . $cols . '">' . $new[$config_key] . '</textarea>'; - break; + break; case 'radio': $key_yes = ($new[$config_key]) ? ' checked="checked"' : ''; @@ -276,7 +294,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) $tpl_yes = '<input type="radio" id="' . $key . '" name="' . $name . '" value="1"' . $key_yes . ' class="radio" /> ' . (($type_no) ? $user->lang['YES'] : $user->lang['ENABLED']); $tpl = ($tpl_type_cond[0] == 'yes' || $tpl_type_cond[0] == 'enabled') ? $tpl_yes . ' ' . $tpl_no : $tpl_no . ' ' . $tpl_yes; - break; + break; case 'select': case 'custom': @@ -295,7 +313,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) { break; } - + if (isset($vars['params'])) { $args = array(); @@ -331,17 +349,17 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) $tpl = $return; } - break; + break; default: - break; + break; } if (isset($vars['append'])) { $tpl .= $vars['append']; } - + return $tpl; } diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html index 31d773993c..70a2415b6c 100644 --- a/phpBB/adm/style/acp_attachments.html +++ b/phpBB/adm/style/acp_attachments.html @@ -64,22 +64,22 @@ </fieldset> <!-- IF not S_SECURE_DOWNLOADS --> - <div class="errorbox"> - <p>{L_SECURE_DOWNLOAD_NOTICE}</p> - </div> + <div class="errorbox"> + <p>{L_SECURE_DOWNLOAD_NOTICE}</p> + </div> <!-- ENDIF --> <fieldset> <legend>{L_SECURE_TITLE}</legend> <p>{L_DOWNLOAD_ADD_IPS_EXPLAIN}</p> - <dl> - <dt><label for="ip_hostname">{L_IP_HOSTNAME}:</label></dt> - <dd><textarea id="ip_hostname" cols="40" rows="3" name="ips"></textarea></dd> - </dl> - <dl> - <dt><label for="exclude">{L_IP_EXCLUDE}:</label><br /><span>{L_EXCLUDE_ENTERED_IP}</span></dt> - <dd><input type="radio" id="exclude" name="ipexclude" value="1" class="radio" /> {L_YES} <input type="radio" name="ipexclude" value="0" checked="checked" class="radio" /> {L_NO}</dd> - </dl> + <dl> + <dt><label for="ip_hostname">{L_IP_HOSTNAME}:</label></dt> + <dd><textarea id="ip_hostname" cols="40" rows="3" name="ips"></textarea></dd> + </dl> + <dl> + <dt><label for="exclude">{L_IP_EXCLUDE}:</label><br /><span>{L_EXCLUDE_ENTERED_IP}</span></dt> + <dd><input type="radio" id="exclude" name="ipexclude" value="1" class="radio" /> {L_YES} <input type="radio" name="ipexclude" value="0" checked="checked" class="radio" /> {L_NO}</dd> + </dl> </fieldset> <fieldset class="quick"> @@ -89,16 +89,16 @@ <fieldset> <legend>{L_REMOVE_IPS}</legend> <!-- IF S_DEFINED_IPS --> - <p>{L_DOWNLOAD_REMOVE_IPS_EXPLAIN}</p> + <p>{L_DOWNLOAD_REMOVE_IPS_EXPLAIN}</p> <dl> <dt><label for="remove_ip_hostname">{L_IP_HOSTNAME}:</label></dt> <dd><select name="unip[]" id="remove_ip_hostname" multiple="multiple" size="10">{DEFINED_IPS}</select></dd> </dl> - </fieldset> + </fieldset> - <fieldset class="quick"> - <input class="button1" type="submit" id="unsecuresubmit" name="unsecuresubmit" value="{L_SUBMIT}" /> - </fieldset> + <fieldset class="quick"> + <input class="button1" type="submit" id="unsecuresubmit" name="unsecuresubmit" value="{L_SUBMIT}" /> + </fieldset> <!-- ELSE --> <p>{L_NO_IPS_DEFINED}</p> @@ -166,47 +166,47 @@ <input type="hidden" name="g" value="{GROUP_ID}" /> <legend>{L_LEGEND}</legend> - <dl> - <dt><label for="group_name">{L_GROUP_NAME}:</label></dt> - <dd><input type="text" id="group_name" size="20" maxlength="100" name="group_name" value="{GROUP_NAME}" /></dd> - </dl> - <dl> - <dt><label for="category">{L_SPECIAL_CATEGORY}:</label><br /><span>{L_SPECIAL_CATEGORY_EXPLAIN}</span></dt> - <dd>{S_CATEGORY_SELECT}</dd> - </dl> - <dl> - <dt><label for="allowed">{L_ALLOWED}:</label></dt> - <dd><input type="checkbox" id="allowed" name="allow_group" value="1"<!-- IF ALLOW_GROUP --> checked="checked"<!-- ENDIF --> /></dd> - </dl> - <dl> - <dt><label for="allow_in_pm">{L_ALLOW_IN_PM}:</label></dt> - <dd><input type="checkbox" id="allow_in_pm" name="allow_in_pm" value="1"<!-- IF ALLOW_IN_PM --> checked="checked"<!-- ENDIF --> /></dd> - </dl> - <dl> - <dt><label for="download_mode">{L_DOWNLOAD_MODE}:</label><br /><span>{L_DOWNLOAD_MODE_EXPLAIN}</span></dt> - <dd>{S_DOWNLOAD_SELECT}</dd> - </dl> - <dl> - <dt><label for="upload_icon">{L_UPLOAD_ICON}:</label></dt> - <dd><select name="upload_icon" id="upload_icon" onchange="update_image(this.options[selectedIndex].value);"> - <option value="no_image"<!-- IF S_NO_IMAGE --> selected="selected"<!-- ENDIF -->>{L_NO_IMAGE}</option>{S_FILENAME_LIST} - </select></dd> - <dd> <img <!-- IF S_NO_IMAGE -->src="{PHPBB_ROOT_PATH}images/spacer.gif"<!-- ELSE -->src="{UPLOAD_ICON_SRC}"<!-- ENDIF --> name="image_upload_icon" alt="" title="" /> </dd> - </dl> - <dl> - <dt><label for="extgroup_filesize">{L_MAX_EXTGROUP_FILESIZE}:</label></dt> - <dd><input type="text" id="extgroup_filesize" size="3" maxlength="15" name="max_filesize" value="{EXTGROUP_FILESIZE}" /> <select name="size_select">{S_EXT_GROUP_SIZE_OPTIONS}</select></dd> - </dl> - <dl> - <dt><label for="assigned_extensions">{L_ASSIGNED_EXTENSIONS}:</label></dt> - <dd><div id="ext">{ASSIGNED_EXTENSIONS}</div> <span>[<a href="{U_EXTENSIONS}">{L_GO_TO_EXTENSIONS}</a> ]</span></dd> - <dd><select name="extensions[]" id="assigned_extensions" class="narrow" onchange="show_extensions(this);" multiple="multiple" size="8">{S_EXTENSION_OPTIONS}</select></dd> - </dl> - <dl> - <dt><label for="allowed_forums">{L_ALLOWED_FORUMS}:</label><br /><span>{L_ALLOWED_FORUMS_EXPLAIN}</span></dt> - <dd><input type="radio" id="allowed_forums" class="radio" name="forum_select" value="0"<!-- IF not S_FORUM_IDS --> checked="checked"<!-- ENDIF --> /> {L_ALLOW_ALL_FORUMS} <input type="radio" class="radio" name="forum_select" value="1"<!-- IF S_FORUM_IDS --> checked="checked"<!-- ENDIF --> /> {L_ALLOW_SELECTED_FORUMS}</dd> - <dd><select name="allowed_forums[]" multiple="multiple" size="8">{S_FORUM_ID_OPTIONS}</select></dd> - </dl> + <dl> + <dt><label for="group_name">{L_GROUP_NAME}:</label></dt> + <dd><input type="text" id="group_name" size="20" maxlength="100" name="group_name" value="{GROUP_NAME}" /></dd> + </dl> + <dl> + <dt><label for="category">{L_SPECIAL_CATEGORY}:</label><br /><span>{L_SPECIAL_CATEGORY_EXPLAIN}</span></dt> + <dd>{S_CATEGORY_SELECT}</dd> + </dl> + <dl> + <dt><label for="allowed">{L_ALLOWED}:</label></dt> + <dd><input type="checkbox" id="allowed" name="allow_group" value="1"<!-- IF ALLOW_GROUP --> checked="checked"<!-- ENDIF --> /></dd> + </dl> + <dl> + <dt><label for="allow_in_pm">{L_ALLOW_IN_PM}:</label></dt> + <dd><input type="checkbox" id="allow_in_pm" name="allow_in_pm" value="1"<!-- IF ALLOW_IN_PM --> checked="checked"<!-- ENDIF --> /></dd> + </dl> + <dl> + <dt><label for="download_mode">{L_DOWNLOAD_MODE}:</label><br /><span>{L_DOWNLOAD_MODE_EXPLAIN}</span></dt> + <dd>{S_DOWNLOAD_SELECT}</dd> + </dl> + <dl> + <dt><label for="upload_icon">{L_UPLOAD_ICON}:</label></dt> + <dd><select name="upload_icon" id="upload_icon" onchange="update_image(this.options[selectedIndex].value);"> + <option value="no_image"<!-- IF S_NO_IMAGE --> selected="selected"<!-- ENDIF -->>{L_NO_IMAGE}</option>{S_FILENAME_LIST} + </select></dd> + <dd> <img <!-- IF S_NO_IMAGE -->src="{PHPBB_ROOT_PATH}images/spacer.gif"<!-- ELSE -->src="{UPLOAD_ICON_SRC}"<!-- ENDIF --> name="image_upload_icon" alt="" title="" /> </dd> + </dl> + <dl> + <dt><label for="extgroup_filesize">{L_MAX_EXTGROUP_FILESIZE}:</label></dt> + <dd><input type="text" id="extgroup_filesize" size="3" maxlength="15" name="max_filesize" value="{EXTGROUP_FILESIZE}" /> <select name="size_select">{S_EXT_GROUP_SIZE_OPTIONS}</select></dd> + </dl> + <dl> + <dt><label for="assigned_extensions">{L_ASSIGNED_EXTENSIONS}:</label></dt> + <dd><div id="ext">{ASSIGNED_EXTENSIONS}</div> <span>[<a href="{U_EXTENSIONS}">{L_GO_TO_EXTENSIONS}</a> ]</span></dd> + <dd><select name="extensions[]" id="assigned_extensions" class="narrow" onchange="show_extensions(this);" multiple="multiple" size="8">{S_EXTENSION_OPTIONS}</select></dd> + </dl> + <dl> + <dt><label for="allowed_forums">{L_ALLOWED_FORUMS}:</label><br /><span>{L_ALLOWED_FORUMS_EXPLAIN}</span></dt> + <dd><input type="radio" id="allowed_forums" class="radio" name="forum_select" value="0"<!-- IF not S_FORUM_IDS --> checked="checked"<!-- ENDIF --> /> {L_ALLOW_ALL_FORUMS} <input type="radio" class="radio" name="forum_select" value="1"<!-- IF S_FORUM_IDS --> checked="checked"<!-- ENDIF --> /> {L_ALLOW_SELECTED_FORUMS}</dd> + <dd><select name="allowed_forums[]" multiple="multiple" size="8">{S_FORUM_ID_OPTIONS}</select></dd> + </dl> </fieldset> <fieldset class="submit-buttons"> @@ -258,14 +258,14 @@ <form id="add_ext" method="post" action="{U_ACTION}"> <fieldset> <legend>{L_ADD_EXTENSION}</legend> - <dl> - <dt><label for="add_extension">{L_EXTENSION}</label></dt> - <dd><input type="text" id="add_extension" size="20" maxlength="100" name="add_extension" value="{ADD_EXTENSION}" /></dd> - </dl> - <dl> - <dt><label for="extension_group">{L_EXTENSION_GROUP}</label></dt> - <dd>{GROUP_SELECT_OPTIONS}</dd> - </dl> + <dl> + <dt><label for="add_extension">{L_EXTENSION}</label></dt> + <dd><input type="text" id="add_extension" size="20" maxlength="100" name="add_extension" value="{ADD_EXTENSION}" /></dd> + </dl> + <dl> + <dt><label for="extension_group">{L_EXTENSION_GROUP}</label></dt> + <dd>{GROUP_SELECT_OPTIONS}</dd> + </dl> </fieldset> <fieldset class="quick"> diff --git a/phpBB/adm/style/acp_ban.html b/phpBB/adm/style/acp_ban.html index 4c645be178..8bfdf735a5 100644 --- a/phpBB/adm/style/acp_ban.html +++ b/phpBB/adm/style/acp_ban.html @@ -43,28 +43,28 @@ <fieldset> <legend>{L_TITLE}</legend> - <dl> - <dt><label for="ban">{L_BAN_CELL}:</label></dt> - <dd><textarea name="ban" cols="40" rows="3" id="ban"></textarea></dd> - <!-- IF S_USERNAME_BAN --><dd>[ <a href="#" onclick="window.open('{U_FIND_USER}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd><!-- ENDIF --> - </dl> - <dl> - <dt><label for="banlength">{L_BAN_LENGTH}:</label></dt> - <dd><select name="banlength" id="banlength">{S_BAN_END_OPTIONS}</select></dd> - <dd><input type="text" name="banlengthother" /> (YYYY-MM-DD)</dd> - </dl> - <dl> - <dt><label for="banexclude">{L_BAN_EXCLUDE}:</label><br /><span>{L_BAN_EXCLUDE_EXPLAIN}</span></dt> - <dd><input type="radio" name="banexclude" value="1" class="radio" /> {L_YES} <input type="radio" name="banexclude" id="banexclude" value="0" checked="checked" class="radio" /> {L_NO}</dd> - </dl> - <dl> - <dt><label for="banreason">{L_BAN_REASON}:</label></dt> - <dd><input name="banreason" type="text" id="banreason" class="medium" /></dd> - </dl> - <dl> - <dt><label for="bangivereason">{L_BAN_GIVE_REASON}:</label></dt> - <dd><input name="bangivereason" type="text" id="bangivereason" class="medium" /></dd> - </dl> +<dl> + <dt><label for="ban">{L_BAN_CELL}:</label></dt> + <dd><textarea name="ban" cols="40" rows="3" id="ban"></textarea></dd> + <!-- IF S_USERNAME_BAN --><dd>[ <a href="#" onclick="window.open('{U_FIND_USER}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd><!-- ENDIF --> +</dl> +<dl> + <dt><label for="banlength">{L_BAN_LENGTH}:</label></dt> + <dd><select name="banlength" id="banlength">{S_BAN_END_OPTIONS}</select></dd> + <dd><input type="text" name="banlengthother" /> (YYYY-MM-DD)</dd> +</dl> +<dl> + <dt><label for="banexclude">{L_BAN_EXCLUDE}:</label><br /><span>{L_BAN_EXCLUDE_EXPLAIN}</span></dt> + <dd><input type="radio" name="banexclude" value="1" class="radio" /> {L_YES} <input type="radio" name="banexclude" id="banexclude" value="0" checked="checked" class="radio" /> {L_NO}</dd> +</dl> +<dl> + <dt><label for="banreason">{L_BAN_REASON}:</label></dt> + <dd><input name="banreason" type="text" id="banreason" class="medium" /></dd> +</dl> +<dl> + <dt><label for="bangivereason">{L_BAN_GIVE_REASON}:</label></dt> + <dd><input name="bangivereason" type="text" id="bangivereason" class="medium" /></dd> +</dl> </fieldset> <fieldset class="submit-buttons"> @@ -98,17 +98,18 @@ <dt><label for="unbangivereason">{L_BAN_GIVE_REASON}:</label></dt> <dd><input style="border: 0px;" type="text" name="unbangivereason" id="unbangivereason" class="full" disabled="disabled" /></dd> </dl> -</fieldset> + </fieldset> -<fieldset class="submit-buttons"> - <input class="button1" type="submit" id="unbansubmit" name="unbansubmit" value="{L_SUBMIT}" /> - <input class="button2" type="reset" id="unbanreset" name="unbanreset" value="{L_RESET}" /> -</fieldset> + <fieldset class="submit-buttons"> + <input class="button1" type="submit" id="unbansubmit" name="unbansubmit" value="{L_SUBMIT}" /> + <input class="button2" type="reset" id="unbanreset" name="unbanreset" value="{L_RESET}" /> + </fieldset> <!-- ELSE --> <p>{L_NO_BAN_CELL}</p> </fieldset> + <!-- ENDIF --> </form> diff --git a/phpBB/adm/style/acp_bbcodes.html b/phpBB/adm/style/acp_bbcodes.html index 00af899397..116aba0aff 100644 --- a/phpBB/adm/style/acp_bbcodes.html +++ b/phpBB/adm/style/acp_bbcodes.html @@ -15,27 +15,27 @@ <fieldset> <legend>{L_BBCODE_USAGE}</legend> <p>{L_BBCODE_USAGE_EXPLAIN}</p> - <dl> - <dt><label for="bbcode_match">{L_EXAMPLES}</label><br /><br /><span>{L_BBCODE_USAGE_EXAMPLE}</span></dt> - <dd><textarea id="bbcode_match" name="bbcode_match" cols="60" rows="5">{BBCODE_MATCH}</textarea></dd> - </dl> + <dl> + <dt><label for="bbcode_match">{L_EXAMPLES}</label><br /><br /><span>{L_BBCODE_USAGE_EXAMPLE}</span></dt> + <dd><textarea id="bbcode_match" name="bbcode_match" cols="60" rows="5">{BBCODE_MATCH}</textarea></dd> + </dl> </fieldset> <fieldset> <legend>{L_HTML_REPLACEMENT}</legend> <p>{L_HTML_REPLACEMENT_EXPLAIN}</p> - <dl> - <dt><label for="bbcode_tpl">{L_EXAMPLES}</label><br /><br /><span>{L_HTML_REPLACEMENT_EXAMPLE}</span></dt> - <dd><textarea id="bbcode_tpl" name="bbcode_tpl" cols="60" rows="8">{BBCODE_TPL}</textarea></dd> - </dl> + <dl> + <dt><label for="bbcode_tpl">{L_EXAMPLES}</label><br /><br /><span>{L_HTML_REPLACEMENT_EXAMPLE}</span></dt> + <dd><textarea id="bbcode_tpl" name="bbcode_tpl" cols="60" rows="8">{BBCODE_TPL}</textarea></dd> + </dl> </fieldset> <fieldset> <legend>{L_SETTINGS}</legend> - <dl> - <dt><label for="display_on_posting">{L_DISPLAY_ON_POSTING}</label></dt> - <dd><input type="checkbox" name="display_on_posting" id="display_on_posting" value="1"<!-- IF DISPLAY_ON_POSTING --> checked="checked"<!-- ENDIF --> /></dd> - </dl> + <dl> + <dt><label for="display_on_posting">{L_DISPLAY_ON_POSTING}</label></dt> + <dd><input type="checkbox" name="display_on_posting" id="display_on_posting" value="1"<!-- IF DISPLAY_ON_POSTING --> checked="checked"<!-- ENDIF --> /></dd> + </dl> </fieldset> <fieldset class="submit-buttons"> @@ -44,6 +44,7 @@ </fieldset> <br /> + <table cellspacing="1"> <thead> <tr> @@ -77,10 +78,10 @@ <table cellspacing="1"> <thead> - <tr> - <th>{L_BBCODE_TAG}</th> - <th>{L_ACTION}</th> - </tr> + <tr> + <th>{L_BBCODE_TAG}</th> + <th>{L_ACTION}</th> + </tr> </thead> <tbody> <!-- BEGIN bbcodes --> diff --git a/phpBB/adm/style/acp_board.html b/phpBB/adm/style/acp_board.html index a5cc3363df..02cb055a74 100644 --- a/phpBB/adm/style/acp_board.html +++ b/phpBB/adm/style/acp_board.html @@ -24,6 +24,7 @@ <!-- ENDIF --> <!-- END options --> + <!-- IF S_AUTH --> <!-- BEGIN auth_tpl --> {auth_tpl.TPL} diff --git a/phpBB/adm/style/acp_bots.html b/phpBB/adm/style/acp_bots.html index facf5bd127..5d2fd9f77e 100644 --- a/phpBB/adm/style/acp_bots.html +++ b/phpBB/adm/style/acp_bots.html @@ -21,30 +21,30 @@ <fieldset> <legend>{L_TITLE}</legend> - <dl> - <dt><label for="bot_name">{L_BOT_NAME}:</label><br /><span>{L_BOT_NAME_EXPLAIN}</span></dt> - <dd><input name="bot_name" type="text" id="bot_name" value="{BOT_NAME}" /></dd> - </dl> - <dl> - <dt><label for="bot_style">{L_BOT_STYLE}:</label><br /><span>{L_BOT_STYLE_EXPLAIN}</span></dt> - <dd><select id="bot_style" name="bot_style">{S_STYLE_OPTIONS}</select></dd> - </dl> - <dl> - <dt><label for="bot_lang">{L_BOT_LANG}:</label><br /><span>{L_BOT_LANG_EXPLAIN}</span></dt> - <dd><select id="bot_lang" name="bot_lang">{S_LANG_OPTIONS}</select></dd> - </dl> - <dl> - <dt><label for="bot_active">{L_BOT_ACTIVE}:</label></dt> - <dd><select id="bot_active" name="bot_active">{S_ACTIVE_OPTIONS}</select></dd> - </dl> - <dl> - <dt><label for="bot_agent">{L_BOT_AGENT}:</label><br /><span>{L_BOT_AGENT_EXPLAIN}</span></dt> - <dd><input name="bot_agent" type="text" id="bot_agent" value="{BOT_AGENT}" /></dd> - </dl> - <dl> - <dt><label for="bot_ip">{L_BOT_IP}:</label><br /><span>{L_BOT_IP_EXPLAIN}</span></dt> - <dd><input name="bot_ip" type="text" id="bot_ip" value="{BOT_IP}" /></dd> - </dl> + <dl> + <dt><label for="bot_name">{L_BOT_NAME}:</label><br /><span>{L_BOT_NAME_EXPLAIN}</span></dt> + <dd><input name="bot_name" type="text" id="bot_name" value="{BOT_NAME}" /></dd> + </dl> + <dl> + <dt><label for="bot_style">{L_BOT_STYLE}:</label><br /><span>{L_BOT_STYLE_EXPLAIN}</span></dt> + <dd><select id="bot_style" name="bot_style">{S_STYLE_OPTIONS}</select></dd> + </dl> + <dl> + <dt><label for="bot_lang">{L_BOT_LANG}:</label><br /><span>{L_BOT_LANG_EXPLAIN}</span></dt> + <dd><select id="bot_lang" name="bot_lang">{S_LANG_OPTIONS}</select></dd> + </dl> + <dl> + <dt><label for="bot_active">{L_BOT_ACTIVE}:</label></dt> + <dd><select id="bot_active" name="bot_active">{S_ACTIVE_OPTIONS}</select></dd> + </dl> + <dl> + <dt><label for="bot_agent">{L_BOT_AGENT}:</label><br /><span>{L_BOT_AGENT_EXPLAIN}</span></dt> + <dd><input name="bot_agent" type="text" id="bot_agent" value="{BOT_AGENT}" /></dd> + </dl> + <dl> + <dt><label for="bot_ip">{L_BOT_IP}:</label><br /><span>{L_BOT_IP_EXPLAIN}</span></dt> + <dd><input name="bot_ip" type="text" id="bot_ip" value="{BOT_IP}" /></dd> + </dl> </fieldset> <fieldset class="submit-buttons"> @@ -64,12 +64,12 @@ <table cellspacing="1"> <thead> - <tr> - <th>{L_BOT_NAME}</th> - <th>{L_BOT_LAST_VISIT}</th> - <th colspan="3">{L_OPTIONS}</th> - <th>{L_MARK}</th> - </tr> + <tr> + <th>{L_BOT_NAME}</th> + <th>{L_BOT_LAST_VISIT}</th> + <th colspan="3">{L_OPTIONS}</th> + <th>{L_MARK}</th> + </tr> </thead> <tbody> <!-- BEGIN bots --> diff --git a/phpBB/adm/style/acp_database.html b/phpBB/adm/style/acp_database.html index 980ed4d68e..37b9557d83 100644 --- a/phpBB/adm/style/acp_database.html +++ b/phpBB/adm/style/acp_database.html @@ -1,51 +1,57 @@ <!-- INCLUDE overall_header.html --> <a name="maincontent"></a> + <!-- IF MODE eq 'restore' --> -<h1>{L_ACP_RESTORE}</h1> + <h1>{L_ACP_RESTORE}</h1> -<p>{L_ACP_RESTORE_EXPLAIN}</p> + <p>{L_ACP_RESTORE_EXPLAIN}</p> -<form id="acp_backup" method="post" action="{U_ACTION}"> -<fieldset> - <legend>{L_RESTORE_OPTIONS}</legend> + <form id="acp_backup" method="post" action="{U_ACTION}"> + + <fieldset> + <legend>{L_RESTORE_OPTIONS}</legend> <dl> <dt><label for="user">{L_SELECT_FILE}:</label></dt> <dd><select id="file" name="file" size="10"><!-- BEGIN files --><option value="{files.FILE}"<!-- IF files.S_LAST_ROW --> selected="selected"<!-- ENDIF -->>{files.NAME}</option><!-- END files --></select></dd> </dl> -</fieldset> -<!-- IF EXISTS --> -<fieldset class="submit-buttons"> - <input class="button1" type="submit" id="submit" name="submit" value="{L_START_RESTORE}" /> - <input class="button2" type="submit" id="delete" name="delete" value="{L_DELETE_BACKUP}" /> - <input class="button2" type="submit" id="download" name="download" value="{L_DOWNLOAD_BACKUP}" /> -</fieldset> -<!-- ENDIF --> -</form> -<!-- ELSE --> -<h1>{L_ACP_BACKUP}</h1> + </fieldset> -<p>{L_ACP_BACKUP_EXPLAIN}</p> + <!-- IF EXISTS --> + <fieldset class="submit-buttons"> + <input class="button1" type="submit" id="submit" name="submit" value="{L_START_RESTORE}" /> + <input class="button2" type="submit" id="delete" name="delete" value="{L_DELETE_BACKUP}" /> + <input class="button2" type="submit" id="download" name="download" value="{L_DOWNLOAD_BACKUP}" /> + </fieldset> + <!-- ENDIF --> + + </form> + +<!-- ELSE --> + <h1>{L_ACP_BACKUP}</h1> -<script type="text/javascript"> -<!-- + <p>{L_ACP_BACKUP_EXPLAIN}</p> - function selector(bool) - { - var table = document.getElementById('table'); + <script type="text/javascript"> + <!-- - for (var i = 0; i < table.options.length; i++) + function selector(bool) { - table.options[i].selected = bool; + var table = document.getElementById('table'); + + for (var i = 0; i < table.options.length; i++) + { + table.options[i].selected = bool; + } } - } -//--> -</script> + //--> + </script> + + <form id="acp_backup" method="post" action="{U_ACTION}"> -<form id="acp_backup" method="post" action="{U_ACTION}"> -<fieldset> - <legend>{L_BACKUP_OPTIONS}</legend> + <fieldset> + <legend>{L_BACKUP_OPTIONS}</legend> <dl> <dt><label for="user">{L_BACKUP_TYPE}:</label></dt> <dd><input type="radio" name="type" value="full" id="type" checked="checked" /> {L_FULL_BACKUP} <input type="radio" name="type" value="structure" id="type" /> {L_STRUCTURE_ONLY} <input type="radio" name="type" value="data" id="type" /> {L_DATA_ONLY}</dd> @@ -68,11 +74,15 @@ <!-- END tables --> </select><br /><br /><div align="right"><a href="#" onclick="selector(true)">{L_SELECT_ALL}</a><br /><a href="#" onclick="selector(false)">{L_DESELECT_ALL}</a></div></dd> </dl> -</fieldset> -<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}" /> -</fieldset> -</form> + </fieldset> + + <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}" /> + </fieldset> + + </form> + <!-- ENDIF --> + <!-- INCLUDE overall_footer.html -->
\ No newline at end of file diff --git a/phpBB/adm/style/acp_disallow.html b/phpBB/adm/style/acp_disallow.html index e5e63c6aae..8bd0957786 100644 --- a/phpBB/adm/style/acp_disallow.html +++ b/phpBB/adm/style/acp_disallow.html @@ -10,10 +10,10 @@ <fieldset> <legend>{L_ADD_DISALLOW_TITLE}</legend> - <dl> - <dt><label for="user">{L_USERNAME}:</label><br /><span>{L_ADD_DISALLOW_EXPLAIN}</span></dt> - <dd><input id="user" type="text" name="disallowed_user" class="medium" /></dd> - </dl> +<dl> + <dt><label for="user">{L_USERNAME}:</label><br /><span>{L_ADD_DISALLOW_EXPLAIN}</span></dt> + <dd><input id="user" type="text" name="disallowed_user" class="medium" /></dd> +</dl> </fieldset> <fieldset class="quick"> @@ -31,16 +31,14 @@ <dt><label for="disallowed">{L_USERNAME}:</label></dt> <dd><select name="disallowed_id" id="disallowed">{S_DISALLOWED_NAMES}</select></dd> </dl> -</fieldset> - -<fieldset class="quick"> - <input class="button1" type="submit" name="allow" value="{L_SUBMIT}" /> -</fieldset> + </fieldset> + <fieldset class="quick"> + <input class="button1" type="submit" name="allow" value="{L_SUBMIT}" /> <!-- ELSE --> <p>{L_NO_DISALLOWED}</p> -</fieldset> <!-- ENDIF --> +</fieldset> </form> diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index f8eaabf2dc..c974f61eed 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -53,10 +53,10 @@ <p>{L_FORUM_EDIT_EXPLAIN}</p> <!-- IF S_ERROR --> - <div class="errorbox"> - <h3>{L_WARNING}</h3> - <p>{ERROR_MSG}</p> - </div> + <div class="errorbox"> + <h3>{L_WARNING}</h3> + <p>{ERROR_MSG}</p> + </div> <!-- ENDIF --> <form id="forumedit" method="post" action="{U_EDIT_ACTION}"> @@ -69,11 +69,11 @@ </dl> <!-- IF not S_ADD_ACTION and S_FORUM_ORIG_POST --> <div id="type_actions"<!-- IF S_FORUM_POST --> style="display: none;"<!-- ENDIF -->> - <dl> - <dt><label for="type_action">{L_DECIDE_MOVE_DELETE_CONTENT}:</label></dt> - <dd><input type="radio" class="radio" id="type_action" name="type_action" value="delete" checked="checked" /> {L_DELETE_ALL_POSTS}</dd> - <!-- IF S_MOVE_FORUM_OPTIONS --><dd><input type="radio" class="radio" name="type_action" value="move" /> {L_MOVE_POSTS_TO} <select name="to_forum_id">{S_MOVE_FORUM_OPTIONS}</select></dd><!-- ENDIF --> - </dl> + <dl> + <dt><label for="type_action">{L_DECIDE_MOVE_DELETE_CONTENT}:</label></dt> + <dd><input type="radio" class="radio" id="type_action" name="type_action" value="delete" checked="checked" /> {L_DELETE_ALL_POSTS}</dd> + <!-- IF S_MOVE_FORUM_OPTIONS --><dd><input type="radio" class="radio" name="type_action" value="move" /> {L_MOVE_POSTS_TO} <select name="to_forum_id">{S_MOVE_FORUM_OPTIONS}</select></dd><!-- ENDIF --> + </dl> </div> <!-- ENDIF --> <dl> @@ -101,10 +101,10 @@ <dd><select id="forum_style" name="forum_style"><option value="0">{L_DEFAULT_STYLE}</option>{S_STYLES_OPTIONS}</select></dd> </dl> <!-- IF S_ADD_ACTION --> - <dl> - <dt><label for="forum_perm_from">{L_COPY_PERMISSIONS}:</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt> - <dd><select id="forum_perm_from" name="forum_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_FORUM_OPTIONS}</select></dd> - </dl> + <dl> + <dt><label for="forum_perm_from">{L_COPY_PERMISSIONS}:</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt> + <dd><select id="forum_perm_from" name="forum_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_FORUM_OPTIONS}</select></dd> + </dl> <!-- ENDIF --> </fieldset> @@ -241,10 +241,10 @@ <p>{L_FORUM_DELETE_EXPLAIN}</p> <!-- IF S_ERROR --> - <div class="errorbox"> - <h3>{L_WARNING}</h3> - <p>{ERROR_MSG}</p> - </div> + <div class="errorbox"> + <h3>{L_WARNING}</h3> + <p>{ERROR_MSG}</p> + </div> <!-- ENDIF --> <form id="acp_forum" method="post" action="{U_ACTION}"> @@ -288,10 +288,10 @@ <p>{L_FORUM_ADMIN_EXPLAIN}</p> <!-- IF ERROR_MSG --> - <div class="errorbox"> - <h3>{L_WARNING}</h3> - <p>{ERROR_MSG}</p> - </div> + <div class="errorbox"> + <h3>{L_WARNING}</h3> + <p>{ERROR_MSG}</p> + </div> <!-- ENDIF --> <!-- IF S_RESYNCED --> @@ -303,30 +303,30 @@ <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 --> - <table cellspacing="1"> - <col class="row1" /><col class="row1" /><col class="row2" /> - <tbody> - <!-- BEGIN forums --> - <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_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}"><img src="images/icon_up.gif" alt="{L_MOVE_UP}" title="{L_MOVE_UP}" width="16" height="16" /></a> <!-- ENDIF --> - <!-- IF not forums.S_LAST_ROW --><a href="{forums.U_MOVE_DOWN}"><img src="images/icon_down.gif" alt="{L_MOVE_DOWN}" title="{L_MOVE_DOWN}" width="16" height="16" /></a> <!-- ENDIF --> - <a href="{forums.U_EDIT}"><img src="images/icon_edit.gif" alt="{L_EDIT}" title="{L_EDIT}" width="16" height="16" /></a> - <!-- IF not forums.S_LINK --><a href="{forums.U_SYNC}"><img src="images/icon_sync.gif" alt="{L_RESYNC}" title="{L_RESYNC}" width="16" height="16" /></a> <!-- ENDIF --> - <a href="{forums.U_DELETE}"><img src="images/icon_delete.gif" alt="{L_DELETE}" title="{L_DELETE}" width="16" height="16" /></a> - </td> - </tr> - <!-- END forums --> - </tbody> - </table> -<!-- ENDIF --> + <!-- IF .forums --> + <table cellspacing="1"> + <col class="row1" /><col class="row1" /><col class="row2" /> + <tbody> + <!-- BEGIN forums --> + <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_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}"><img src="images/icon_up.gif" alt="{L_MOVE_UP}" title="{L_MOVE_UP}" width="16" height="16" /></a> <!-- ENDIF --> + <!-- IF not forums.S_LAST_ROW --><a href="{forums.U_MOVE_DOWN}"><img src="images/icon_down.gif" alt="{L_MOVE_DOWN}" title="{L_MOVE_DOWN}" width="16" height="16" /></a> <!-- ENDIF --> + <a href="{forums.U_EDIT}"><img src="images/icon_edit.gif" alt="{L_EDIT}" title="{L_EDIT}" width="16" height="16" /></a> + <!-- IF not forums.S_LINK --><a href="{forums.U_SYNC}"><img src="images/icon_sync.gif" alt="{L_RESYNC}" title="{L_RESYNC}" width="16" height="16" /></a> <!-- ENDIF --> + <a href="{forums.U_DELETE}"><img src="images/icon_delete.gif" alt="{L_DELETE}" title="{L_DELETE}" width="16" height="16" /></a> + </td> + </tr> + <!-- END forums --> + </tbody> + </table> + <!-- ENDIF --> <form id="fselect" method="post" action="{U_SEL_ACTION}"> diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html index 17193dff2e..471a41cf4c 100644 --- a/phpBB/adm/style/acp_groups.html +++ b/phpBB/adm/style/acp_groups.html @@ -21,15 +21,15 @@ <fieldset> <legend>{L_GROUP_DETAILS}</legend> - <dl> - <dt><label<!-- IF not S_SPECIAL_GROUP --> for="group_name"<!-- ENDIF -->>{L_GROUP_NAME}:</label></dt> - <dd><!-- IF S_SPECIAL_GROUP --><b>{GROUP_NAME}</b><!-- ENDIF --><input name="group_name" type="<!-- IF S_SPECIAL_GROUP -->hidden<!-- ELSE -->text<!-- ENDIF -->" id="group_name" value="{GROUP_INTERNAL_NAME}" /></dd> - </dl> - <dl> - <dt><label for="group_desc">{L_GROUP_DESC}:</label></dt> - <dd><textarea id="group_desc" name="group_desc" rows="5" cols="45">{GROUP_DESC}</textarea></dd> - <dd><input type="checkbox" name="desc_parse_bbcode"<!-- IF S_DESC_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE} <input type="checkbox" name="desc_parse_smilies"<!-- IF S_DESC_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES} <input type="checkbox" name="desc_parse_urls"<!-- IF S_DESC_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}</dd> - </dl> + <dl> + <dt><label<!-- IF not S_SPECIAL_GROUP --> for="group_name"<!-- ENDIF -->>{L_GROUP_NAME}:</label></dt> + <dd><!-- IF S_SPECIAL_GROUP --><b>{GROUP_NAME}</b><!-- ENDIF --><input name="group_name" type="<!-- IF S_SPECIAL_GROUP -->hidden<!-- ELSE -->text<!-- ENDIF -->" id="group_name" value="{GROUP_INTERNAL_NAME}" /></dd> + </dl> + <dl> + <dt><label for="group_desc">{L_GROUP_DESC}:</label></dt> + <dd><textarea id="group_desc" name="group_desc" rows="5" cols="45">{GROUP_DESC}</textarea></dd> + <dd><input type="checkbox" name="desc_parse_bbcode"<!-- IF S_DESC_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE} <input type="checkbox" name="desc_parse_smilies"<!-- IF S_DESC_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES} <input type="checkbox" name="desc_parse_urls"<!-- IF S_DESC_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}</dd> + </dl> <!-- IF not S_SPECIAL_GROUP --> <dl> <dt><label for="group_type">{L_GROUP_TYPE}:</label><br /><span>{L_GROUP_TYPE_EXPLAIN}</span></dt> @@ -45,44 +45,44 @@ <!-- ENDIF --> <!-- IF S_ADD_GROUP --> - <dl> - <dt><label for="group_perm_from">{L_COPY_PERMISSIONS}:</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt> - <dd><select id="group_perm_from" name="group_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_GROUP_OPTIONS}</select></dd> - </dl> + <dl> + <dt><label for="group_perm_from">{L_COPY_PERMISSIONS}:</label><br /><span>{L_COPY_PERMISSIONS_EXPLAIN}</span></dt> + <dd><select id="group_perm_from" name="group_perm_from"><option value="0">{L_NO_PERMISSIONS}</option>{S_GROUP_OPTIONS}</select></dd> + </dl> <!-- ENDIF --> </fieldset> <fieldset> <legend>{L_GROUP_SETTINGS_SAVE}</legend> - <dl> - <dt><label for="group_legend">{L_GROUP_LEGEND}:</label></dt> - <dd><input name="group_legend" type="checkbox" id="group_legend"{GROUP_LEGEND} /></dd> - </dl> - <dl> - <dt><label for="group_receive_pm">{L_GROUP_RECEIVE_PM}:</label></dt> - <dd><input name="group_receive_pm" type="checkbox" id="group_receive_pm"{GROUP_RECEIVE_PM} /></dd> - </dl> - <dl> - <dt><label for="group_message_limit">{L_GROUP_MESSAGE_LIMIT}:</label><br /><span>{L_GROUP_MESSAGE_LIMIT_EXPLAIN}</span></dt> - <dd><input name="group_message_limit" type="text" id="group_message_limit" maxlength="4" size="4" value="{GROUP_MESSAGE_LIMIT}" /></dd> - </dl> - <dl> - <dt><label for="group_colour">{L_GROUP_COLOR}:</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt> - <dd><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" /> <span>[ <a href="#" onclick="swatch(); return false">{L_COLOUR_SWATCH}</a> ]</span></dd> - </dl> - <dl> - <dt><label for="group_rank">{L_GROUP_RANK}:</label></dt> - <dd><select name="group_rank" id="group_rank">{S_RANK_OPTIONS}</select></dd> - </dl> + <dl> + <dt><label for="group_legend">{L_GROUP_LEGEND}:</label></dt> + <dd><input name="group_legend" type="checkbox" id="group_legend"{GROUP_LEGEND} /></dd> + </dl> + <dl> + <dt><label for="group_receive_pm">{L_GROUP_RECEIVE_PM}:</label></dt> + <dd><input name="group_receive_pm" type="checkbox" id="group_receive_pm"{GROUP_RECEIVE_PM} /></dd> + </dl> + <dl> + <dt><label for="group_message_limit">{L_GROUP_MESSAGE_LIMIT}:</label><br /><span>{L_GROUP_MESSAGE_LIMIT_EXPLAIN}</span></dt> + <dd><input name="group_message_limit" type="text" id="group_message_limit" maxlength="4" size="4" value="{GROUP_MESSAGE_LIMIT}" /></dd> + </dl> + <dl> + <dt><label for="group_colour">{L_GROUP_COLOR}:</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt> + <dd><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" /> <span>[ <a href="#" onclick="swatch(); return false">{L_COLOUR_SWATCH}</a> ]</span></dd> + </dl> + <dl> + <dt><label for="group_rank">{L_GROUP_RANK}:</label></dt> + <dd><select name="group_rank" id="group_rank">{S_RANK_OPTIONS}</select></dd> + </dl> </fieldset> <fieldset> <legend>{L_GROUP_AVATAR}</legend> - <dl> - <dt><label>{L_CURRENT_IMAGE}:</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt> - <dd>{AVATAR_IMAGE}</dd> - <dd><input type="checkbox" name="delete" /> <span>{L_DELETE_AVATAR}</span></dd> - </dl> + <dl> + <dt><label>{L_CURRENT_IMAGE}:</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt> + <dd>{AVATAR_IMAGE}</dd> + <dd><input type="checkbox" name="delete" /> <span>{L_DELETE_AVATAR}</span></dd> + </dl> <!-- IF not S_IN_AVATAR_GALLERY --> <!-- IF S_CAN_UPLOAD --> <dl> @@ -94,14 +94,14 @@ <dd><input name="uploadurl" type="text" id="uploadurl" value="" /></dd> </dl> <!-- ENDIF --> - <dl> - <dt><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt> - <dd><input name="remotelink" type="text" id="remotelink" value="" /></dd> - </dl> - <dl> - <dt><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt> - <dd><input name="width" type="text" id="width" size="3" value="{GROUP_AVATAR_WIDTH}" /> <span>px X </span> <input type="text" name="height" size="3" value="{GROUP_AVATAR_HEIGHT}" /> <span>px</span></dd> - </dl> + <dl> + <dt><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt> + <dd><input name="remotelink" type="text" id="remotelink" value="" /></dd> + </dl> + <dl> + <dt><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt> + <dd><input name="width" type="text" id="width" size="3" value="{GROUP_AVATAR_WIDTH}" /> <span>px X </span> <input type="text" name="height" size="3" value="{GROUP_AVATAR_HEIGHT}" /> <span>px</span></dd> + </dl> <!-- IF S_DISPLAY_GALLERY --> <dl> <dt><label>{L_AVATAR_GALLERY}:</label></dt> @@ -113,26 +113,26 @@ <fieldset> <legend>{L_AVATAR_GALLERY}</legend> - <dl> - <dt><label for="category">{L_AVATAR_CATEGORY}:</label></dt> - <dd><select name="category" id="category">{S_CAT_OPTIONS}</select> <input class="button2" type="submit" value="{L_GO}" name="display_gallery" /></dd> - </dl> - <dl> - <table cellspacing="1"> - <!-- BEGIN avatar_row --> - <tr> - <!-- BEGIN avatar_column --> - <td class="row1" style="text-align: center;"><img src="{avatar_row.avatar_column.AVATAR_IMAGE}" alt="{avatar_row.avatar_column.AVATAR_NAME}" title="{avatar_row.avatar_column.AVATAR_NAME}" /></td> - <!-- END avatar_column --> - </tr> - <tr> - <!-- BEGIN avatar_option_column --> - <td class="row2" style="text-align: center;"><input type="radio" class="radio" name="avatar_select" value="{avatar_row.avatar_option_column.S_OPTIONS_AVATAR}" /></td> - <!-- END avatar_option_column --> - </tr> - <!-- END avatar_row --> - </table> - </dl> + <dl> + <dt><label for="category">{L_AVATAR_CATEGORY}:</label></dt> + <dd><select name="category" id="category">{S_CAT_OPTIONS}</select> <input class="button2" type="submit" value="{L_GO}" name="display_gallery" /></dd> + </dl> + <dl> + <table cellspacing="1"> + <!-- BEGIN avatar_row --> + <tr> + <!-- BEGIN avatar_column --> + <td class="row1" style="text-align: center;"><img src="{avatar_row.avatar_column.AVATAR_IMAGE}" alt="{avatar_row.avatar_column.AVATAR_NAME}" title="{avatar_row.avatar_column.AVATAR_NAME}" /></td> + <!-- END avatar_column --> + </tr> + <tr> + <!-- BEGIN avatar_option_column --> + <td class="row2" style="text-align: center;"><input type="radio" class="radio" name="avatar_select" value="{avatar_row.avatar_option_column.S_OPTIONS_AVATAR}" /></td> + <!-- END avatar_option_column --> + </tr> + <!-- END avatar_row --> + </table> + </dl> </fieldset> <fieldset class="quick" style="margin-top: -15px;"> diff --git a/phpBB/adm/style/acp_jabber.html b/phpBB/adm/style/acp_jabber.html index 1f4e305f95..82bc7fed2f 100644 --- a/phpBB/adm/style/acp_jabber.html +++ b/phpBB/adm/style/acp_jabber.html @@ -17,34 +17,34 @@ <fieldset> <legend>{L_ACP_JABBER_SETTINGS}</legend> - <dl> - <dt><label for="jab_enable">{L_JAB_ENABLE}:</label><br /><span>{L_JAB_ENABLE_EXPLAIN}</span></dt> - <dd><input type="radio" class="radio" id="jab_enable" name="jab_enable" value="1"<!-- IF JAB_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_ENABLED} <input type="radio" class="radio" name="jab_enable" value="0"<!-- IF not JAB_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</dd> - </dl> - <dl> - <dt><label for="jab_host">{L_JAB_SERVER}:</label><br /><span>{L_JAB_SERVER_EXPLAIN}</span></dt> - <dd><input type="text" id="jab_host" name="jab_host" value="{JAB_HOST}" /></dd> - </dl> - <dl> - <dt><label for="jab_port">{L_JAB_PORT}:</label><br /><span>{L_JAB_PORT_EXPLAIN}</span></dt> - <dd><input type="text" id="jab_port" name="jab_port" value="{JAB_PORT}" /></dd> - </dl> - <dl> - <dt><label for="jab_username">{L_JAB_USERNAME}:</label><br /><span>{L_JAB_USERNAME_EXPLAIN}</span></dt> - <dd><input type="text" id="jab_username" name="jab_username" value="{JAB_USERNAME}" /></dd> - </dl> - <dl> - <dt><label for="jab_password">{L_JAB_PASSWORD}:</label></dt> - <dd><input type="text" id="jab_password" name="jab_password" value="{JAB_PASSWORD}" /></dd> - </dl> - <dl> - <dt><label for="jab_resource">{L_JAB_RESOURCE}:</label><br /><span>{L_JAB_RESOURCE_EXPLAIN}</span></dt> - <dd><input type="text" id="jab_resource" name="jab_resource" value="{JAB_RESOURCE}" /></dd> - </dl> - <dl> - <dt><label for="jab_package_size">{L_JAB_PACKAGE_SIZE}:</label><br /><span>{L_JAB_PACKAGE_SIZE_EXPLAIN}</span></dt> - <dd><input type="text" id="jab_package_size" name="jab_package_size" value="{JAB_PACKAGE_SIZE}" /></dd> - </dl> +<dl> + <dt><label for="jab_enable">{L_JAB_ENABLE}:</label><br /><span>{L_JAB_ENABLE_EXPLAIN}</span></dt> + <dd><input type="radio" class="radio" id="jab_enable" name="jab_enable" value="1"<!-- IF JAB_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_ENABLED} <input type="radio" class="radio" name="jab_enable" value="0"<!-- IF not JAB_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</dd> +</dl> +<dl> + <dt><label for="jab_host">{L_JAB_SERVER}:</label><br /><span>{L_JAB_SERVER_EXPLAIN}</span></dt> + <dd><input type="text" id="jab_host" name="jab_host" value="{JAB_HOST}" /></dd> +</dl> +<dl> + <dt><label for="jab_port">{L_JAB_PORT}:</label><br /><span>{L_JAB_PORT_EXPLAIN}</span></dt> + <dd><input type="text" id="jab_port" name="jab_port" value="{JAB_PORT}" /></dd> +</dl> +<dl> + <dt><label for="jab_username">{L_JAB_USERNAME}:</label><br /><span>{L_JAB_USERNAME_EXPLAIN}</span></dt> + <dd><input type="text" id="jab_username" name="jab_username" value="{JAB_USERNAME}" /></dd> +</dl> +<dl> + <dt><label for="jab_password">{L_JAB_PASSWORD}:</label></dt> + <dd><input type="text" id="jab_password" name="jab_password" value="{JAB_PASSWORD}" /></dd> +</dl> +<dl> + <dt><label for="jab_resource">{L_JAB_RESOURCE}:</label><br /><span>{L_JAB_RESOURCE_EXPLAIN}</span></dt> + <dd><input type="text" id="jab_resource" name="jab_resource" value="{JAB_RESOURCE}" /></dd> +</dl> +<dl> + <dt><label for="jab_package_size">{L_JAB_PACKAGE_SIZE}:</label><br /><span>{L_JAB_PACKAGE_SIZE_EXPLAIN}</span></dt> + <dd><input type="text" id="jab_package_size" name="jab_package_size" value="{JAB_PACKAGE_SIZE}" /></dd> +</dl> </fieldset> <fieldset class="submit-buttons"> diff --git a/phpBB/adm/style/acp_language.html b/phpBB/adm/style/acp_language.html index c0a0e8e745..dce0c00de6 100644 --- a/phpBB/adm/style/acp_language.html +++ b/phpBB/adm/style/acp_language.html @@ -150,7 +150,9 @@ </table> </form> + <!-- ELSEIF S_UPLOAD --> + <a href="{U_BACK}" style="float: right">« {L_BACK}</a> <h1>{L_UPLOAD_SETTINGS}</h1> @@ -188,6 +190,7 @@ </fieldset> </form> + <!-- ELSE --> <h1>{L_ACP_LANGUAGE_PACKS}</h1> diff --git a/phpBB/adm/style/acp_logs.html b/phpBB/adm/style/acp_logs.html index 5aec4dba1b..8690103f1e 100644 --- a/phpBB/adm/style/acp_logs.html +++ b/phpBB/adm/style/acp_logs.html @@ -24,45 +24,48 @@ </div> <!-- IF .log --> -<table cellspacing="1"> -<thead> -<tr> - <th>{L_USERNAME}</th> - <th>{L_IP}</th> - <th>{L_TIME}</th> - <th>{L_ACTION}</th> - <th>{L_MARK}</th> -</tr> -</thead> -<tbody> -<!-- BEGIN log --> - <!-- IF log.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> - - <td> - {log.USERNAME} - <!-- IF log.REPORTEE_USERNAME --> - <br />» {log.REPORTEE_USERNAME} - <!-- ENDIF --> - </td> - <td style="text-align: center;">{log.IP}</td> - <td style="text-align: center;">{log.DATE}</td> - <td>{log.ACTION}<!-- IF log.DATA --><br />{log.DATA}</span><!-- ENDIF --></td> - <td style="text-align: center;"><input type="checkbox" name="mark[]" value="{log.ID}" /></td> + <table cellspacing="1"> + <thead> + <tr> + <th>{L_USERNAME}</th> + <th>{L_IP}</th> + <th>{L_TIME}</th> + <th>{L_ACTION}</th> + <th>{L_MARK}</th> </tr> -<!-- END log --> -</tbody> -</table> + </thead> + <tbody> + <!-- BEGIN log --> + <!-- IF log.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> + + <td> + {log.USERNAME} + <!-- IF log.REPORTEE_USERNAME --> + <br />» {log.REPORTEE_USERNAME} + <!-- ENDIF --> + </td> + <td style="text-align: center;">{log.IP}</td> + <td style="text-align: center;">{log.DATE}</td> + <td>{log.ACTION}<!-- IF log.DATA --><br />{log.DATA}</span><!-- ENDIF --></td> + <td style="text-align: center;"><input type="checkbox" name="mark[]" value="{log.ID}" /></td> + </tr> + <!-- END log --> + </tbody> + </table> + <!-- ELSE --> + <div class="errorbox"> <p>{L_NO_ENTRIES}</p> </div> + <!-- ENDIF --> <!-- IF S_SHOW_FORUMS --> -<fieldset class="quick" style="float: left;"> - {L_SELECT_FORUM}: <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{S_FORUM_BOX}</select> - <input class="button2" type="submit" value="{L_GO}" /> -</fieldset> + <fieldset class="quick" style="float: left;"> + {L_SELECT_FORUM}: <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit(); }">{S_FORUM_BOX}</select> + <input class="button2" type="submit" value="{L_GO}" /> + </fieldset> <!-- ENDIF --> <!-- IF S_CLEARLOGS --> diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html index e1c0fa9a05..5e2dfc7890 100644 --- a/phpBB/adm/style/acp_main.html +++ b/phpBB/adm/style/acp_main.html @@ -14,58 +14,58 @@ <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_GZIP_COMPRESSION}: </td> - <td><b>{GZIP_COMPRESSION}</b></td> - <td> </td> - <td> </td> - </tr> - </tbody> +<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_GZIP_COMPRESSION}: </td> + <td><b>{GZIP_COMPRESSION}</b></td> + <td> </td> + <td> </td> +</tr> +</tbody> </table> <!-- IF S_ACTION_OPTIONS --> @@ -115,11 +115,11 @@ <table cellspacing="1"> <thead> - <tr> - <th>{L_USERNAME}</th> - <th>{L_JOINED}</th> - <th>{L_MARK}</th> - </tr> + <tr> + <th>{L_USERNAME}</th> + <th>{L_JOINED}</th> + <th>{L_MARK}</th> + </tr> </thead> <tbody> <!-- BEGIN inactive --> diff --git a/phpBB/adm/style/acp_modules.html b/phpBB/adm/style/acp_modules.html index 20b2fd4399..bec0e76def 100644 --- a/phpBB/adm/style/acp_modules.html +++ b/phpBB/adm/style/acp_modules.html @@ -57,36 +57,36 @@ <p>{L_EDIT_MODULE_EXPLAIN}</p> <!-- IF S_ERROR --> - <div class="errorbox"> - <h3>{L_WARNING}</h3> - <p>{ERROR_MSG}</p> - </div> + <div class="errorbox"> + <h3>{L_WARNING}</h3> + <p>{ERROR_MSG}</p> + </div> <!-- ENDIF --> <form id="moduleedit" method="post" action="{U_EDIT_ACTION}"> <fieldset> <legend>{L_GENERAL_OPTIONS}</legend> - <dl> - <dt><label for="module_langname">{L_MODULE_LANGNAME}:</label><br /> - <span>{L_MODULE_LANGNAME_EXPLAIN}</span></dt> - <dd><input name="module_langname" type="text" id="module_langname" value="{MODULE_LANGNAME}" class="medium" /></dd> - </dl> - <dl> - <dt><label for="module_type">{L_MODULE_TYPE}:</label></dt> - <dd><select name="module_type" id="module_type" onchange="display_options(this.value);"><option value="category"<!-- IF S_IS_CAT --> selected="selected"<!-- ENDIF -->>{L_CATEGORY}</option><option value="module"<!-- IF not S_IS_CAT --> selected="selected"<!-- ENDIF -->>{L_MODULE}</option></select></dd> - </dl> - <dl> - <dt><label for="parent_id">{L_PARENT}:</label></dt> - <dd><select name="module_parent_id" id="parent_id">{S_CAT_OPTIONS}</select></dd> - </dl> - <hr /> - <dl> - <dt><label for="module_enabled">{L_MODULE_ENABLED}:</label></dt> - <dd><label><input class="radio" type="radio" name="module_enabled" id="module_enabled" value="1"<!-- IF MODULE_ENABLED --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> - <label><input class="radio" type="radio" name="module_enabled" value="0"<!-- IF not MODULE_ENABLED --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> - </dl> - <div id="modoptions"<!-- IF S_IS_CAT --> style="display: none;"<!-- ENDIF -->> + <dl> + <dt><label for="module_langname">{L_MODULE_LANGNAME}:</label><br /> + <span>{L_MODULE_LANGNAME_EXPLAIN}</span></dt> + <dd><input name="module_langname" type="text" id="module_langname" value="{MODULE_LANGNAME}" class="medium" /></dd> + </dl> + <dl> + <dt><label for="module_type">{L_MODULE_TYPE}:</label></dt> + <dd><select name="module_type" id="module_type" onchange="display_options(this.value);"><option value="category"<!-- IF S_IS_CAT --> selected="selected"<!-- ENDIF -->>{L_CATEGORY}</option><option value="module"<!-- IF not S_IS_CAT --> selected="selected"<!-- ENDIF -->>{L_MODULE}</option></select></dd> + </dl> + <dl> + <dt><label for="parent_id">{L_PARENT}:</label></dt> + <dd><select name="module_parent_id" id="parent_id">{S_CAT_OPTIONS}</select></dd> + </dl> + <hr /> + <dl> + <dt><label for="module_enabled">{L_MODULE_ENABLED}:</label></dt> + <dd><label><input class="radio" type="radio" name="module_enabled" id="module_enabled" value="1"<!-- IF MODULE_ENABLED --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> + <label><input class="radio" type="radio" name="module_enabled" value="0"<!-- IF not MODULE_ENABLED --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> + </dl> + <div id="modoptions"<!-- IF S_IS_CAT --> style="display: none;"<!-- ENDIF -->> <dl> <dt><label for="module_display">{L_MODULE_DISPLAYED}:</label><br /><span>{L_MODULE_DISPLAYED_EXPLAIN}</span></dt> <dd><label><input class="radio" type="radio" name="module_display" id="module_display" value="1"<!-- IF MODULE_DISPLAY --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> @@ -102,7 +102,7 @@ <span>{L_CHOOSE_MODE_EXPLAIN}</span></dt> <dd><select name="module_mode" id="module_mode">{S_MODULE_MODES}</select></dd> </dl> - </div> + </div> </fieldset> <fieldset class="submit-buttons"> @@ -122,10 +122,10 @@ <p>{L_ACP_MODULE_MANAGEMENT_EXPLAIN}</p> <!-- IF S_ERROR --> - <div class="errorbox"> - <h3>{L_WARNING}</h3> - <p>{ERROR_MSG}</p> - </div> + <div class="errorbox"> + <h3>{L_WARNING}</h3> + <p>{ERROR_MSG}</p> + </div> <!-- ENDIF --> <table cellspacing="1"> @@ -136,24 +136,24 @@ </tbody> </table> -<!-- IF .modules --> - <table cellspacing="1"> - <col class="row1" /><col class="row1" /><col class="row2" /><col class="row2" /> - <tbody> - <!-- 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 style="width: 15%; white-space: nowrap; text-align: center; vertical-align: middle;"><a href="{modules.U_MOVE_UP}">{L_MOVE_UP}</a><br /><a href="{modules.U_MOVE_DOWN}">{L_MOVE_DOWN}</a></td> - <td style="width: 20%; white-space: nowrap; text-align: center; vertical-align: middle;"> - <a href="{modules.U_EDIT}">{L_EDIT}</a> | <a href="{modules.U_DELETE}">{L_DELETE}</a> | - <!-- IF modules.MODULE_ENABLED --><a href="{modules.U_DISABLE}">{L_DISABLE}</a><!-- ELSE --><a href="{modules.U_ENABLE}">{L_ENABLE}</a><!-- ENDIF --> - </td> - </tr> - <!-- END modules --> - </tbody> - </table> -<!-- ENDIF --> + <!-- IF .modules --> + <table cellspacing="1"> + <col class="row1" /><col class="row1" /><col class="row2" /><col class="row2" /> + <tbody> + <!-- 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 style="width: 15%; white-space: nowrap; text-align: center; vertical-align: middle;"><a href="{modules.U_MOVE_UP}">{L_MOVE_UP}</a><br /><a href="{modules.U_MOVE_DOWN}">{L_MOVE_DOWN}</a></td> + <td style="width: 20%; white-space: nowrap; text-align: center; vertical-align: middle;"> + <a href="{modules.U_EDIT}">{L_EDIT}</a> | <a href="{modules.U_DELETE}">{L_DELETE}</a> | + <!-- IF modules.MODULE_ENABLED --><a href="{modules.U_DISABLE}">{L_DISABLE}</a><!-- ELSE --><a href="{modules.U_ENABLE}">{L_ENABLE}</a><!-- ENDIF --> + </td> + </tr> + <!-- END modules --> + </tbody> + </table> + <!-- ENDIF --> <form id="module" method="post" action="{U_ACTION}"> diff --git a/phpBB/adm/style/acp_permission_roles.html b/phpBB/adm/style/acp_permission_roles.html index 8e1076d701..9538af8451 100644 --- a/phpBB/adm/style/acp_permission_roles.html +++ b/phpBB/adm/style/acp_permission_roles.html @@ -8,8 +8,10 @@ <!-- var active_option = 'options0'; - // Show/hide option panels - // value = suffix for ID to show + /** + * Show/hide option panels + * value = suffix for ID to show + */ function swap_options(id) { if (id == active_option) @@ -24,8 +26,10 @@ active_option = id; } - // Mark all radio buttons in one panel - // id = table ID container, s = status ['y'/'u'/'n'] + /** + * Mark all radio buttons in one panel + * id = table ID container, s = status ['y'/'u'/'n'] + */ function mark_options(id, s) { var t = document.getElementById(id); @@ -62,14 +66,14 @@ <fieldset> <legend>{L_ROLE_DETAILS}</legend> - <dl> - <dt><label for="role_name">{L_ROLE_NAME}:</label></dt> - <dd><input name="role_name" type="text" id="role_name" value="{ROLE_NAME}" /></dd> - </dl> - <dl> - <dt><label for="role_description">{L_ROLE_DESCRIPTION}:</label><br /><span>{L_ROLE_DESCRIPTION_EXPLAIN}</span></dt> - <dd><textarea id="role_description" name="role_description" rows="3" cols="45">{ROLE_DESCRIPTION}</textarea></dd> - </dl> + <dl> + <dt><label for="role_name">{L_ROLE_NAME}:</label></dt> + <dd><input name="role_name" type="text" id="role_name" value="{ROLE_NAME}" /></dd> + </dl> + <dl> + <dt><label for="role_description">{L_ROLE_DESCRIPTION}:</label><br /><span>{L_ROLE_DESCRIPTION_EXPLAIN}</span></dt> + <dd><textarea id="role_description" name="role_description" rows="3" cols="45">{ROLE_DESCRIPTION}</textarea></dd> + </dl> </fieldset> <fieldset class="quick"> diff --git a/phpBB/adm/style/acp_php_info.html b/phpBB/adm/style/acp_php_info.html index d4ca8c7d4c..e1d4731c64 100644 --- a/phpBB/adm/style/acp_php_info.html +++ b/phpBB/adm/style/acp_php_info.html @@ -7,6 +7,7 @@ <p>{L_ACP_PHP_INFO_EXPLAIN}</p> <div style="overflow: auto; width: 99%;"> -{PHPINFO} + {PHPINFO} </div> + <!-- INCLUDE overall_footer.html -->
\ No newline at end of file diff --git a/phpBB/adm/style/acp_profile.html b/phpBB/adm/style/acp_profile.html index ce260d1b98..55186376ef 100644 --- a/phpBB/adm/style/acp_profile.html +++ b/phpBB/adm/style/acp_profile.html @@ -11,10 +11,10 @@ <p>{L_EXPLAIN}</p> <!-- IF ERROR_MSG --> - <div class="errorbox"> - <h3>{L_WARNING}</h3> - <p>{ERROR_MSG}</p> - </div> + <div class="errorbox"> + <h3>{L_WARNING}</h3> + <p>{ERROR_MSG}</p> + </div> <!-- ENDIF --> <form id="add_profile_field" method="post" action="{U_ACTION}"> @@ -23,38 +23,38 @@ <fieldset> <legend>{L_TITLE}</legend> - <dl> - <dt><label>{L_FIELD_TYPE}:</label><br /><span>{L_FIELD_TYPE_EXPLAIN}</span></dt> - <dd><b>{FIELD_TYPE}</b></dd> - </dl> - <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> - <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" id="field_no_view" name="field_no_view" value="0"<!-- IF not S_FIELD_NO_VIEW --> checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" name="field_no_view" value="1"<!-- IF S_FIELD_NO_VIEW --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd> - </dl> + <dl> + <dt><label>{L_FIELD_TYPE}:</label><br /><span>{L_FIELD_TYPE_EXPLAIN}</span></dt> + <dd><b>{FIELD_TYPE}</b></dd> + </dl> + <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> + <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" id="field_no_view" name="field_no_view" value="0"<!-- IF not S_FIELD_NO_VIEW --> checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" name="field_no_view" value="1"<!-- IF S_FIELD_NO_VIEW --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd> + </dl> </fieldset> <fieldset> <legend>{L_VISIBILITY_OPTION}</legend> - <dl> - <dt><label for="field_option_none">{L_DISPLAY_AT_PROFILE}:</label></dt> - <dd><input type="radio" id="field_option_none" name="field_option" value="none"<!-- IF not S_SHOW_ON_REG and not S_FIELD_REQUIRED and not S_FIELD_HIDE --> checked="checked"<!-- ENDIF --> /></dd> - </dl> - <dl> - <dt><label for="field_show_on_reg">{L_DISPLAY_AT_REGISTER}:</label><br /><span>{L_DISPLAY_AT_REGISTER_EXPLAIN}</span></dt> - <dd><input type="radio" id="field_show_on_reg" name="field_option" value="field_show_on_reg"<!-- IF S_SHOW_ON_REG --> checked="checked"<!-- ENDIF --> /></dd> - </dl> - <dl> - <dt><label for="field_required">{L_REQUIRED_FIELD}:</label><br /><span>{L_REQUIRED_FIELD_EXPLAIN}</span></dt> - <dd><input type="radio" id="field_required" name="field_option" value="field_required"<!-- IF S_FIELD_REQUIRED --> checked="checked"<!-- ENDIF --> /></dd> - </dl> - <dl> - <dt><label for="field_hide">{L_HIDE_PROFILE_FIELD}:</label><br /><span>{L_HIDE_PROFILE_FIELD_EXPLAIN}</span></dt> - <dd><input type="radio" id="field_hide" name="field_option" value="field_hide"<!-- IF S_FIELD_HIDE --> checked="checked"<!-- ENDIF --> /></dd> - </dl> + <dl> + <dt><label for="field_option_none">{L_DISPLAY_AT_PROFILE}:</label></dt> + <dd><input type="radio" id="field_option_none" name="field_option" value="none"<!-- IF not S_SHOW_ON_REG and not S_FIELD_REQUIRED and not S_FIELD_HIDE --> checked="checked"<!-- ENDIF --> /></dd> + </dl> + <dl> + <dt><label for="field_show_on_reg">{L_DISPLAY_AT_REGISTER}:</label><br /><span>{L_DISPLAY_AT_REGISTER_EXPLAIN}</span></dt> + <dd><input type="radio" id="field_show_on_reg" name="field_option" value="field_show_on_reg"<!-- IF S_SHOW_ON_REG --> checked="checked"<!-- ENDIF --> /></dd> + </dl> + <dl> + <dt><label for="field_required">{L_REQUIRED_FIELD}:</label><br /><span>{L_REQUIRED_FIELD_EXPLAIN}</span></dt> + <dd><input type="radio" id="field_required" name="field_option" value="field_required"<!-- IF S_FIELD_REQUIRED --> checked="checked"<!-- ENDIF --> /></dd> + </dl> + <dl> + <dt><label for="field_hide">{L_HIDE_PROFILE_FIELD}:</label><br /><span>{L_HIDE_PROFILE_FIELD_EXPLAIN}</span></dt> + <dd><input type="radio" id="field_hide" name="field_option" value="field_hide"<!-- IF S_FIELD_HIDE --> checked="checked"<!-- ENDIF --> /></dd> + </dl> </fieldset> <!-- IF S_EDIT_MODE --> @@ -65,31 +65,31 @@ <fieldset> <legend>{L_LANG_SPECIFIC}</legend> + <dl> + <dt><label for="lang_name">{L_USER_FIELD_NAME}:</label></dt> + <dd><input class="medium" type="text" id="lang_name" name="lang_name" value="{LANG_NAME}" /></dd> + </dl> + <dl> + <dt><label for="lang_explain">{L_FIELD_DESCRIPTION}:</label><br /><span>{L_FIELD_DESCRIPTION_EXPLAIN}</span></dt> + <dd><textarea id="lang_explain" name="lang_explain" rows="3" cols="80">{LANG_EXPLAIN}</textarea></dd> + </dl> + <!-- IF S_TEXT or S_STRING --> <dl> - <dt><label for="lang_name">{L_USER_FIELD_NAME}:</label></dt> - <dd><input class="medium" type="text" id="lang_name" name="lang_name" value="{LANG_NAME}" /></dd> + <dt><label for="lang_default_value">{L_DEFAULT_VALUE}:</label><br /><span>{L_DEFAULT_VALUE_EXPLAIN}</span></dt> + <dd><!-- IF S_STRING --><input class="medium" type="text" id="lang_default_value" name="lang_default_value" value="{LANG_DEFAULT_VALUE}" /><!-- ELSE --><textarea id="lang_default_value" name="lang_default_value" rows="5" cols="80">{LANG_DEFAULT_VALUE}</textarea><!-- ENDIF --></dd> </dl> + <!-- ENDIF --> + <!-- IF S_BOOL or S_DROPDOWN --> <dl> - <dt><label for="lang_explain">{L_FIELD_DESCRIPTION}:</label><br /><span>{L_FIELD_DESCRIPTION_EXPLAIN}</span></dt> - <dd><textarea id="lang_explain" name="lang_explain" rows="3" cols="80">{LANG_EXPLAIN}</textarea></dd> - </dl> - <!-- IF S_TEXT or S_STRING --> - <dl> - <dt><label for="lang_default_value">{L_DEFAULT_VALUE}:</label><br /><span>{L_DEFAULT_VALUE_EXPLAIN}</span></dt> - <dd><!-- IF S_STRING --><input class="medium" type="text" id="lang_default_value" name="lang_default_value" value="{LANG_DEFAULT_VALUE}" /><!-- ELSE --><textarea id="lang_default_value" name="lang_default_value" rows="5" cols="80">{LANG_DEFAULT_VALUE}</textarea><!-- ENDIF --></dd> - </dl> - <!-- ENDIF --> - <!-- IF S_BOOL or S_DROPDOWN --> - <dl> - <dt><label for="lang_options">{L_ENTRIES}:</label><br /><span>{L_LANG_OPTIONS_EXPLAIN}</span></dt> - <!-- IF S_DROPDOWN --> - <dd><textarea id="lang_options" name="lang_options" rows="5" cols="80">{LANG_OPTIONS}</textarea></dd> - <!-- ELSE --> - <dd><input class="medium" id="lang_options" name="lang_options[0]" value="{FIRST_LANG_OPTION}" /> {L_FIRST_OPTION}</dd> - <dd><input class="medium" name="lang_options[1]" value="{SECOND_LANG_OPTION}" /> {L_SECOND_OPTION}</dd> - <!-- ENDIF --> - </dl> + <dt><label for="lang_options">{L_ENTRIES}:</label><br /><span>{L_LANG_OPTIONS_EXPLAIN}</span></dt> + <!-- IF S_DROPDOWN --> + <dd><textarea id="lang_options" name="lang_options" rows="5" cols="80">{LANG_OPTIONS}</textarea></dd> + <!-- ELSE --> + <dd><input class="medium" id="lang_options" name="lang_options[0]" value="{FIRST_LANG_OPTION}" /> {L_FIRST_OPTION}</dd> + <dd><input class="medium" name="lang_options[1]" value="{SECOND_LANG_OPTION}" /> {L_SECOND_OPTION}</dd> <!-- ENDIF --> + </dl> + <!-- ENDIF --> </fieldset> <fieldset class="quick"> diff --git a/phpBB/adm/style/acp_ranks.html b/phpBB/adm/style/acp_ranks.html index ee8c337725..924e2d4fb3 100644 --- a/phpBB/adm/style/acp_ranks.html +++ b/phpBB/adm/style/acp_ranks.html @@ -8,7 +8,6 @@ <script type="text/javascript"> <!-- - function update_image(newimage) { document.getElementById('image').src = (newimage) ? "{RANKS_PATH}/" + newimage : "./images/spacer.gif"; diff --git a/phpBB/adm/style/acp_reasons.html b/phpBB/adm/style/acp_reasons.html index e1f8fb2c8f..8011542447 100644 --- a/phpBB/adm/style/acp_reasons.html +++ b/phpBB/adm/style/acp_reasons.html @@ -22,14 +22,14 @@ <fieldset> <legend>{L_TITLE}</legend> <p><!-- IF S_TRANSLATED -->{L_IS_TRANSLATED}<!-- ELSE -->{L_IS_NOT_TRANSLATED}<!-- 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> - <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> + <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> + <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> </fieldset> <fieldset class="submit-buttons"> @@ -45,36 +45,37 @@ <p>{L_ACP_REASONS_EXPLAIN}</p> -<!-- IF reasons --> - <table cellspacing="1"> - <col class="row1" /><col class="row1" /><col class="row2" /> - <thead> - <tr> - <th>{L_REASON}</th> - <th>{L_USED_IN_REPORTS}</th> - <th>{L_OPTIONS}</th> - </tr> - </thead> - <tbody> - <!-- BEGIN reasons --> + <!-- IF .reasons --> + <table cellspacing="1"> + <col class="row1" /><col class="row1" /><col class="row2" /> + <thead> <tr> - <td> - <i style="float: right; font-size: .9em;"><!-- IF reasons.S_TRANSLATED -->{L_IS_TRANSLATED}<!-- ELSE -->{L_IS_NOT_TRANSLATED}<!-- ENDIF --></i> - <strong>{reasons.REASON_TITLE}<!-- IF reasons.S_OTHER_REASON --> *<!-- ENDIF --></strong> - <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}"><img src="images/icon_up.gif" alt="{L_MOVE_UP}" title="{L_MOVE_UP}" width="16" height="16" /></a> <!-- ENDIF --> - <!-- IF not reasons.S_LAST_ROW --><a href="{reasons.U_MOVE_DOWN}"><img src="images/icon_down.gif" alt="{L_MOVE_DOWN}" title="{L_MOVE_DOWN}" width="16" height="16" /></a> <!-- ENDIF --> - <a href="{reasons.U_EDIT}"><img src="images/icon_edit.gif" alt="{L_EDIT}" title="{L_EDIT}" width="16" height="16" /></a> - <!-- IF reasons.U_DELETE --><a href="{reasons.U_DELETE}"><img src="images/icon_delete.gif" alt="{L_DELETE}" title="{L_DELETE}" width="16" height="16" /></a><!-- ENDIF --> - </td> + <th>{L_REASON}</th> + <th>{L_USED_IN_REPORTS}</th> + <th>{L_OPTIONS}</th> </tr> - <!-- END reasons --> - </tbody> - </table> -<!-- ENDIF --> + </thead> + <tbody> + <!-- BEGIN reasons --> + <tr> + <td> + <i style="float: right; font-size: .9em;"><!-- IF reasons.S_TRANSLATED -->{L_IS_TRANSLATED}<!-- ELSE -->{L_IS_NOT_TRANSLATED}<!-- ENDIF --></i> + <strong>{reasons.REASON_TITLE}<!-- IF reasons.S_OTHER_REASON --> *<!-- ENDIF --></strong> + <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}"><img src="images/icon_up.gif" alt="{L_MOVE_UP}" title="{L_MOVE_UP}" width="16" height="16" /></a> <!-- ENDIF --> + <!-- IF not reasons.S_LAST_ROW --><a href="{reasons.U_MOVE_DOWN}"><img src="images/icon_down.gif" alt="{L_MOVE_DOWN}" title="{L_MOVE_DOWN}" width="16" height="16" /></a> <!-- ENDIF --> + <a href="{reasons.U_EDIT}"><img src="images/icon_edit.gif" alt="{L_EDIT}" title="{L_EDIT}" width="16" height="16" /></a> + <!-- IF reasons.U_DELETE --><a href="{reasons.U_DELETE}"><img src="images/icon_delete.gif" alt="{L_DELETE}" title="{L_DELETE}" width="16" height="16" /></a><!-- ENDIF --> + </td> + </tr> + <!-- END reasons --> + </tbody> + </table> + + <!-- ENDIF --> <form id="reasons" method="post" action="{U_ACTION}"> diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html index 281ede19a8..f27d9a43ea 100644 --- a/phpBB/adm/style/acp_search.html +++ b/phpBB/adm/style/acp_search.html @@ -3,14 +3,14 @@ <a name="maincontent"></a> <!-- IF S_SETTINGS --> -<h1>{L_ACP_SEARCH_SETTINGS}</h1> + <h1>{L_ACP_SEARCH_SETTINGS}</h1> -<p>{L_ACP_SEARCH_SETTINGS_EXPLAIN}</p> + <p>{L_ACP_SEARCH_SETTINGS_EXPLAIN}</p> -<form id="acp_search" method="post" action="{U_ACTION}"> -<fieldset> - <legend>{L_GENERAL_SEARCH_SETTINGS}</legend> + <form id="acp_search" method="post" action="{U_ACTION}"> + <fieldset> + <legend>{L_GENERAL_SEARCH_SETTINGS}</legend> <dl> <dt><label for="load_search">{L_YES_SEARCH}:</label><br /><span>{L_YES_SEARCH_EXPLAIN}</span></dt> <dd><input type="radio" id="load_search" name="config[load_search]" value="1"<!-- IF S_YES_SEARCH --> checked="checked"<!-- ENDIF --> class="radio" /> {L_YES} <input type="radio" name="config[load_search]" value="0"<!-- IF not S_YES_SEARCH --> checked="checked"<!-- ENDIF --> class="radio" /> {L_NO}</dd> @@ -35,89 +35,103 @@ <dt><label for="search_store_results">{L_SEARCH_STORE_RESULTS}:</label><br /><span>{L_SEARCH_STORE_RESULTS_EXPLAIN}</span></dt> <dd><input id="search_store_results" type="text" size="4" maxlength="6" name="config[search_store_results]" value="{SEARCH_STORE_RESULTS}" /></dd> </dl> -</fieldset> - -<fieldset> - <legend>{L_SEARCH_TYPE}</legend> + </fieldset> + <fieldset> + <legend>{L_SEARCH_TYPE}</legend> <dl> <dt><label for="search_type">{L_SEARCH_TYPE}:</label><br /><span>{L_SEARCH_TYPE_EXPLAIN}</span></dt> <dd><select id="search_type" name="config[search_type]">{S_SEARCH_TYPES}</select></dd> </dl> -</fieldset> + </fieldset> -<!-- BEGIN backend --> -<fieldset> - <legend>{backend.NAME}</legend> + <!-- BEGIN backend --> - {backend.SETTINGS} -</fieldset> -<!-- END backend --> + <fieldset> + <legend>{backend.NAME}</legend> + {backend.SETTINGS} + </fieldset> -<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" /> -</fieldset> + <!-- 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" /> + </fieldset> -</form> + </form> <!-- ELSEIF S_INDEX --> -<script language="javascript" type="text/javascript"> -<!-- - function popup_progress_bar(progress_type) - { - close_waitscreen = 0; - window.open('{UA_PROGRESS_BAR}&type=' + progress_type, '_index', 'HEIGHT=240,resizable=yes,scrollbars=no,WIDTH=400'); - } -//--> -</script> - -<h1>{L_ACP_SEARCH_INDEX}</h1> - -<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> - - <p>{L_CONTINUE_EXPLAIN}</p> -<!-- ELSE --> -<!-- BEGIN backend --> -<!-- IF backend.S_STATS --> -<table cellspacing="1"> - <caption>» {L_INDEX_STATS}: {backend.L_NAME} <!-- IF backend.S_ACTIVE -->({L_ACTIVE}) <!-- ENDIF --></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> - <!-- BEGIN data --> - <tr> - <td>{backend.data.STATISTIC_1}:</td> - <td>{backend.data.VALUE_1}</td> - <td>{backend.data.STATISTIC_2}<!-- IF backend.data.STATISTIC_2 -->:<!-- ENDIF --></td> - <td>{backend.data.VALUE_2}</td> - </tr> - <!-- END data --> - </tbody> -</table> -<!-- ENDIF --> -<form id="acp_search_index_{backend.NAME}" method="post" action="{U_ACTION}"> -{backend.S_HIDDEN_FIELDS} - <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')" /> - <!-- ELSE --> - <input class="button2" type="submit" name="action[create]" value="{L_CREATE_INDEX}" onclick="javascript:popup_progress_bar('create')" /> - <!-- ENDIF --> - </fieldset> -</form> -<!-- END backend --> -<!-- ENDIF --> + + <script type="text/javascript"> + <!-- + + /** + * Popup search progress bar + */ + function popup_progress_bar(progress_type) + { + close_waitscreen = 0; + window.open('{UA_PROGRESS_BAR}&type=' + progress_type, '_index', 'HEIGHT=240,resizable=yes,scrollbars=no,WIDTH=400'); + } + //--> + </script> + + <h1>{L_ACP_SEARCH_INDEX}</h1> + + <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> + + <p>{L_CONTINUE_EXPLAIN}</p> + <!-- ELSE --> + + <!-- BEGIN backend --> + + <!-- IF backend.S_STATS --> + + <table cellspacing="1"> + <caption>» {L_INDEX_STATS}: {backend.L_NAME} <!-- IF backend.S_ACTIVE -->({L_ACTIVE}) <!-- ENDIF --></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> + <!-- BEGIN data --> + <tr> + <td>{backend.data.STATISTIC_1}:</td> + <td>{backend.data.VALUE_1}</td> + <td>{backend.data.STATISTIC_2}<!-- IF backend.data.STATISTIC_2 -->:<!-- ENDIF --></td> + <td>{backend.data.VALUE_2}</td> + </tr> + <!-- END data --> + </tbody> + </table> + + <!-- ENDIF --> + + <form id="acp_search_index_{backend.NAME}" method="post" action="{U_ACTION}"> + {backend.S_HIDDEN_FIELDS} + + <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')" /> + <!-- ELSE --> + <input class="button2" type="submit" name="action[create]" value="{L_CREATE_INDEX}" onclick="javascript:popup_progress_bar('create')" /> + <!-- ENDIF --> + </fieldset> + + </form> + <!-- END backend --> + + <!-- ENDIF --> + <!-- ENDIF --> <!-- INCLUDE overall_footer.html -->
\ No newline at end of file diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html index 3a5b6330db..83e5e6c639 100644 --- a/phpBB/adm/style/acp_styles.html +++ b/phpBB/adm/style/acp_styles.html @@ -39,352 +39,367 @@ <p>{L_EXPLAIN}</p> <script language="javascript" type="text/javascript" defer="defer"> <!-- - - function update_image(newimage) - { - document.newimg.src = (newimage) ? "../styles/{NAME}/imageset/" + newimage : "images/no_image.png"; - } + function update_image(newimage) + { + document.newimg.src = (newimage) ? "../styles/{NAME}/imageset/" + newimage : "images/no_image.png"; + } //--> </script> - <form method="post" action="{U_ACTION}"><table width="95%" cellspacing="1" cellpadding="1" border="0" align="center"> - <tr> - <td align="right">{L_SELECT_IMAGE}: <select name="imgname" onchange="this.form.submit(); "> - <!-- BEGIN category --> + <form method="post" action="{U_ACTION}"> + + <table width="95%" cellspacing="1" cellpadding="1" border="0" align="center"> + <tr> + <td align="right">{L_SELECT_IMAGE}: <select name="imgname" onchange="this.form.submit(); "> + <!-- BEGIN category --> <option class="sep" value="">{category.NAME}</option> <!-- BEGIN images --><option value="{category.images.VALUE}"<!-- IF category.images.SELECTED--> selected="selected"<!-- ENDIF -->>{category.images.TEXT}</option> <!-- END images --> <!-- END category --> - </select> <input class="btnlite" type="submit" value="{L_SELECT}" tabindex="100" /></td> - </tr> - <tr> - <td><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center"> - <tr> - <th colspan="2">{L_EDIT_IMAGESET}</th> - </tr> - <!-- IF SUCCESS --> - <tr> - <td class="row1" colspan="2" align="center"><span style="color: green">{L_IMAGESET_UPDATED}</span><br /></td> - </tr> - <!-- ENDIF --> - <!-- IF ERROR --> - <tr> - <td class="row1" colspan="2" align="center"><span style="color: red">{L_NO_IMAGE}</span><br /></td> - </tr> - <!-- ENDIF --> - <tr> - <td class="row1" colspan="2" align="center"><table width="100%" cellspacing="2" cellpadding="2" border="0"> - <tr> - <td width="50%" align="center"><img src="<!-- IF IMAGE_REQUEST neq '' -->{IMAGE_REQUEST}<!-- ELSE -->images/no_image.png<!-- ENDIF -->"/></td> - <td width="50%" align="center"><img src="images/no_image.png" name="newimg" /></td> - </tr> - <tr> - <td class="gensmall" align="center">{L_CURRENT_IMAGE}</td> - <td class="gensmall" align="center">{L_SELECTED_IMAGE}</td> - </tr> - </table></td> - </tr> - <tr> - <th width="40%">{L_IMAGE_PARAMETER}</th> - <th>{L_IMAGE_VALUE}</th> - </tr> - <tr> - <td class="row1" width="40%"><b>{L_IMAGE}: </b></td> - <td class="row2"><select name="imgpath" onchange="update_image(this.options[selectedIndex].value);"><option value=""<!-- IF not IMAGE_SELECT--> selected="selected"<!-- ENDIF -->>{L_NONE}</option> + </select> <input class="btnlite" type="submit" value="{L_SELECT}" tabindex="100" /> + </td> + </tr> + <tr> + <td> + <table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center"> + <tr> + <th colspan="2">{L_EDIT_IMAGESET}</th> + </tr> + <!-- IF SUCCESS --> + <tr> + <td class="row1" colspan="2" align="center"><span style="color: green">{L_IMAGESET_UPDATED}</span><br /></td> + </tr> + <!-- ENDIF --> + <!-- IF ERROR --> + <tr> + <td class="row1" colspan="2" align="center"><span style="color: red">{L_NO_IMAGE}</span><br /></td> + </tr> + <!-- ENDIF --> + <tr> + <td class="row1" colspan="2" align="center"> + <table width="100%" cellspacing="2" cellpadding="2" border="0"> + <tr> + <td width="50%" align="center"><img src="<!-- IF IMAGE_REQUEST neq '' -->{IMAGE_REQUEST}<!-- ELSE -->images/no_image.png<!-- ENDIF -->"/></td> + <td width="50%" align="center"><img src="images/no_image.png" name="newimg" /></td> + </tr> + <tr> + <td class="gensmall" align="center">{L_CURRENT_IMAGE}</td> + <td class="gensmall" align="center">{L_SELECTED_IMAGE}</td> + </tr> + </table> + </td> + </tr> + <tr> + <th width="40%">{L_IMAGE_PARAMETER}</th> + <th>{L_IMAGE_VALUE}</th> + </tr> + <tr> + <td class="row1" width="40%"><b>{L_IMAGE}: </b></td> + <td class="row2"><select name="imgpath" onchange="update_image(this.options[selectedIndex].value);"><option value=""<!-- IF not IMAGE_SELECT--> selected="selected"<!-- ENDIF -->>{L_NONE}</option> <!-- BEGIN imagesetlist --> <option class="sep" value=""><!-- IF imagesetlist.TYPE -->{L_LOCALISED_IMAGES}<!-- ELSE -->{L_GLOBAL_IMAGES}<!-- ENDIF --></option> <!-- BEGIN images --> <option value="{imagesetlist.images.VALUE}"<!-- IF imagesetlist.images.SELECTED--> selected="selected"<!-- ENDIF -->>{imagesetlist.images.TEXT}</option> <!-- END images --> <!-- END imagesetlist --> - </select></td> - </tr> - <tr> - <td class="row1" width="40%"><b>{L_INCLUDE_DIMENSIONS}: </b><br /><span class="gensmall">{L_DIMENSIONS_EXPLAIN}</span></td> - <td class="row2"><input type="radio" name="imgsize" value="1"<!-- IF IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" name="imgsize" value="0"<!-- IF not IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_NO}</td> - </tr> - <tr> - <td class="cat" colspan="2" align="center"><input class="btnmain" type="submit" name="update" value="{L_SUBMIT}" /> <input class="btnmain" type="reset" value="{L_RESET}" /></td> - </tr> - </table></td> - </tr> - </table></form> + </select> + </td> + </tr> + <tr> + <td class="row1" width="40%"><b>{L_INCLUDE_DIMENSIONS}: </b><br /><span class="gensmall">{L_DIMENSIONS_EXPLAIN}</span></td> + <td class="row2"><input type="radio" name="imgsize" value="1"<!-- IF IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" name="imgsize" value="0"<!-- IF not IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_NO}</td> + </tr> + <tr> + <td class="cat" colspan="2" align="center"><input class="btnmain" type="submit" name="update" value="{L_SUBMIT}" /> <input class="btnmain" type="reset" value="{L_RESET}" /></td> + </tr> + </table> + </td> + </tr> + </table> + + </form> + <!-- ELSEIF S_EDIT_TEMPLATE or S_EDIT_THEME --> + <script language="javascript" type="text/javascript" defer="defer"> <!-- - - function append_text_rows(form_name, value) - { - url = document.getElementById(form_name).action; - var_start = url.indexOf('&text_rows='); - if (var_start == -1) - { - document.getElementById(form_name).action = url + "&text_rows=" + value; - } - else + function append_text_rows(form_name, value) { - url_start = url.substring(0, var_start + 1); - var_end = url.substring(var_start + 1).indexOf('&'); - if (var_end == -1) + url = document.getElementById(form_name).action; + var_start = url.indexOf('&text_rows='); + if (var_start == -1) { - document.getElementById(form_name).action = url_start + "text_rows=" + value; + document.getElementById(form_name).action = url + "&text_rows=" + value; } else { - document.getElementById(form_name).action = url_start + url.substring(var_end + var_start + 2) + "&text_rows=" + value; + url_start = url.substring(0, var_start + 1); + var_end = url.substring(var_start + 1).indexOf('&'); + if (var_end == -1) + { + document.getElementById(form_name).action = url_start + "text_rows=" + value; + } + else + { + document.getElementById(form_name).action = url_start + url.substring(var_end + var_start + 2) + "&text_rows=" + value; + } } } - } //--> </script> -<!-- IF S_EDIT_TEMPLATE --> - <a href="{U_BACK}" style="float: right">« {L_BACK}</a> + <!-- IF S_EDIT_TEMPLATE --> - <h1>{L_EDIT_TEMPLATE}</h1> + <a href="{U_BACK}" style="float: right">« {L_BACK}</a> - <p>{L_EDIT_TEMPLATE_EXPLAIN}</p> + <h1>{L_EDIT_TEMPLATE}</h1> - <p>{L_SELECTED_TEMPLATE}: <b>{SELECTED_TEMPLATE}</b></p> + <p>{L_EDIT_TEMPLATE_EXPLAIN}</p> - <form id="acp_styles" method="post" action="{U_ACTION}"> + <p>{L_SELECTED_TEMPLATE}: <b>{SELECTED_TEMPLATE}</b></p> - <fieldset> - <legend>{L_SELECT_TEMPLATE}</legend> + <form id="acp_styles" method="post" action="{U_ACTION}"> + + <fieldset> + <legend>{L_SELECT_TEMPLATE}</legend> <dl> <dt><label for="template_file">{L_TEMPLATE_FILE}:</label></dt> <dd><select id="template_file" name="template_file" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_TEMPLATES}</select> <input class="btnlite" type="submit" value="{L_SELECT}" /></dd> </dl> - </fieldset> + </fieldset> - </form> + </form> + + <!-- IF TEMPLATE_FILE --> + <script language="javascript" type="text/javascript" defer="defer"> + <!-- + + function change_editor_height(height) + { + editor = document.getElementById('template_data'); + editor.rows = Math.max(5, Math.min(height, 999)); + + append_text_rows('acp_styles', height); + append_text_rows('acp_template', height); + } + + function append_text_rows(form_name, value) + { + url = document.getElementById(form_name).action; + var_start = url.indexOf('&text_rows='); + if (var_start == -1) + { + document.getElementById(form_name).action = url + "&text_rows=" + value; + } + else + { + url_start = url.substring(0, var_start + 1); + var_end = url.substring(var_start + 1).indexOf('&'); + if (var_end == -1) + { + document.getElementById(form_name).action = url_start + "text_rows=" + value; + } + else + { + document.getElementById(form_name).action = url_start + url.substring(var_end + var_start + 2) + "&text_rows=" + value; + } + } + } + //--> + </script> + + <form id="acp_template" method="post" action="{U_ACTION}"> + + <fieldset> + <legend>{L_TEMPLATE_EDITOR}</legend> + <dl> + <dt><label>{L_SELECTED_TEMPLATE_FILE}:</label></dt> + <dd>{TEMPLATE_FILE}</dd> + </dl> + <dl> + <dt><label for="text_rows">{L_TEMPLATE_EDITOR_HEIGHT}:</label></dt> + <dd><input id="text_rows" type="text" maxlength="3" value="{TEXT_ROWS}" /> <input class="btnlite" type="button" name="update" onclick="change_editor_height(this.form.text_rows.value);" value="{L_UPDATE}" /></dd> + </dl> + <textarea id="template_data" name="template_data" style="font-family:'Courier New', monospace;font-size:9pt;line-height:125%;width:100%;" cols="80" rows="{TEXT_ROWS}">{TEMPLATE_DATA}</textarea> + </fieldset> - <!-- IF TEMPLATE_FILE --> - <script language="javascript" type="text/javascript" defer="defer"> - <!-- + <fieldset class="submit-buttons"> + {S_HIDDEN_FIELDS} + <input class="button1" id="save" type="submit" name="save" value="{L_SUBMIT}" /> + </fieldset> - function change_editor_height(height) - { - editor = document.getElementById('template_data'); - editor.rows = Math.max(5, Math.min(height, 999)); + </form> + <!-- ENDIF --> - append_text_rows('acp_styles', height); - append_text_rows('acp_template', height); - } + <!-- ELSEIF S_EDIT_THEME --> - function append_text_rows(form_name, value) - { - url = document.getElementById(form_name).action; - var_start = url.indexOf('&text_rows='); - if (var_start == -1) - { - document.getElementById(form_name).action = url + "&text_rows=" + value; - } - else - { - url_start = url.substring(0, var_start + 1); - var_end = url.substring(var_start + 1).indexOf('&'); - if (var_end == -1) - { - document.getElementById(form_name).action = url_start + "text_rows=" + value; - } - else + <script language="javascript" type="text/javascript"> + <!-- + + function swatch(field) { - document.getElementById(form_name).action = url_start + url.substring(var_end + var_start + 2) + "&text_rows=" + value; + window.open('{UA_SWATCH}' + field, '_swatch', 'HEIGHT=115,resizable=yes,scrollbars=no,WIDTH=636'); + return false; } - } - } - //--> - </script> - - <form id="acp_template" method="post" action="{U_ACTION}"> - - <fieldset> - <legend>{L_TEMPLATE_EDITOR}</legend> - <dl> - <dt><label>{L_SELECTED_TEMPLATE_FILE}:</label></dt> - <dd>{TEMPLATE_FILE}</dd> - </dl> - <dl> - <dt><label for="text_rows">{L_TEMPLATE_EDITOR_HEIGHT}:</label></dt> - <dd><input id="text_rows" type="text" maxlength="3" value="{TEXT_ROWS}" /> <input class="btnlite" type="button" name="update" onclick="change_editor_height(this.form.text_rows.value);" value="{L_UPDATE}" /></dd> - </dl> - <textarea id="template_data" name="template_data" style="font-family:'Courier New', monospace;font-size:9pt;line-height:125%;width:100%;" cols="80" rows="{TEXT_ROWS}">{TEMPLATE_DATA}</textarea> - </fieldset> - - <fieldset class="submit-buttons"> - {S_HIDDEN_FIELDS} - <input class="button1" id="save" type="submit" name="save" value="{L_SUBMIT}" /> - </fieldset> - - - </form> - <!-- ENDIF --> - -<!-- ELSEIF S_EDIT_THEME --> - <script language="javascript" type="text/javascript"> - <!-- + function change_editor_height(height) + { + editor = document.getElementById('css_data'); + editor.rows = Math.max(5, Math.min(height, 999)); - function swatch(field) - { - window.open('{UA_SWATCH}' + field, '_swatch', 'HEIGHT=115,resizable=yes,scrollbars=no,WIDTH=636'); - return false; - } + append_text_rows('acp_styles', height); + append_text_rows('acp_theme', height); + append_text_rows('acp_custom_class', height); + } - function change_editor_height(height) - { - editor = document.getElementById('css_data'); - editor.rows = Math.max(5, Math.min(height, 999)); + //--> + </script> - append_text_rows('acp_styles', height); - append_text_rows('acp_theme', height); - append_text_rows('acp_custom_class', height); - } + <a href="{U_BACK}" style="float: right">« {L_BACK}</a> - //--> - </script> + <h1>{L_EDIT_THEME}</h1> - <a href="{U_BACK}" style="float: right">« {L_BACK}</a> + <p>{L_EDIT_THEME_EXPLAIN}</p> - <h1>{L_EDIT_THEME}</h1> + <p>{L_SELECTED_THEME}: <b>{SELECTED_THEME}</b></p> - <p>{L_EDIT_THEME_EXPLAIN}</p> + <!-- IF S_SHOWCSS --> + <h3>{L_SHOW_CSS_NOTE}</h3> + <p>{L_SHOW_CSS_EXPLAIN}</p> + <!-- ENDIF --> - <p>{L_SELECTED_THEME}: <b>{SELECTED_THEME}</b></p> + <form id="acp_styles" method="post" action="{U_ACTION}"> - <!-- IF S_SHOWCSS --> - <h3>{L_SHOW_CSS_NOTE}</h3> - <p>{L_SHOW_CSS_EXPLAIN}</p> - <!-- ENDIF --> - - <form id="acp_styles" method="post" action="{U_ACTION}"> - <fieldset> - <legend>{L_SELECT_CLASS}</legend> + <fieldset> + <legend>{L_SELECT_CLASS}</legend> <dl> <dt><label for="css_class">{L_SELECT_CLASS}:</label></dt> <dd><select id="css_class" name="css_class" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_CLASSES}</select> <input class="btnlite" type="submit" id="select_class" name="select_class" value="{L_SELECT}" /></dd> </dl> <!-- IF S_CLASS --> - <dl> - <dt><label>{L_SELECTED_CLASS}:</label></dt> - <dd>{S_CLASS}</dd> - </dl> + <dl> + <dt><label>{L_SELECTED_CLASS}:</label></dt> + <dd>{S_CLASS}</dd> + </dl> <!-- ENDIF --> - </fieldset> - </form> - - <!-- IF S_CLASS --> - - <form id="acp_theme" method="post" action="{U_ACTION}"> - - <!-- IF S_SHOWCSS --> + </fieldset> + + </form> - <fieldset> - <legend>{L_THEME_EDITOR}</legend> - <dl> - <dt><label for="text_rows">{L_THEME_EDITOR_HEIGHT}:</label></dt> - <dd><input id="text_rows" type="text" maxlength="3" value="{TEXT_ROWS}" /> <input class="btnlite" type="button" name="update" onclick="change_editor_height(this.form.text_rows.value);" value="{L_UPDATE}" /></dd> - </dl> - <textarea id="css_data" name="css_data" style="font-family:'Courier New', monospace;font-size:9pt;line-height:125%;width:100%;" cols="80" rows="{TEXT_ROWS}">{CSS_DATA}</textarea> - </fieldset> + <!-- IF S_CLASS --> - <!-- ELSE --> + <form id="acp_theme" method="post" action="{U_ACTION}"> + + <!-- IF S_SHOWCSS --> + + <fieldset> + <legend>{L_THEME_EDITOR}</legend> + <dl> + <dt><label for="text_rows">{L_THEME_EDITOR_HEIGHT}:</label></dt> + <dd><input id="text_rows" type="text" maxlength="3" value="{TEXT_ROWS}" /> <input class="btnlite" type="button" name="update" onclick="change_editor_height(this.form.text_rows.value);" value="{L_UPDATE}" /></dd> + </dl> + <textarea id="css_data" name="css_data" style="font-family:'Courier New', monospace;font-size:9pt;line-height:125%;width:100%;" cols="80" rows="{TEXT_ROWS}">{CSS_DATA}</textarea> + </fieldset> + + <!-- ELSE --> + + <fieldset> + <legend>{L_BACKGROUND}</legend> + <dl> + <dt><label for="background_color">{L_BACKGROUND_COLOUR}:</label><br /><span>{L_CSS_COLOUR_EXPLAIN}</span></dt> + <dd><input id="background_color" name="background_color" type="text" value="{BACKGROUND_COLOR}" size="6" /> <span>[ <a href="#" onclick="swatch('background_color'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd> + </dl> + <dl> + <dt><label for="backround_image">{L_BACKGROUND_IMAGE}:</label></td> + <dd><select id="background_image" name="background_image">{S_BACKGROUND_IMAGE}</select></dd> + </dl> + <dl> + <dt><label for="background_repeat">{L_BACKGROUND_REPEAT}:</label></dt> + <dd><select id="background_repeat" name="background_repeat">{S_BACKGROUND_REPEAT}</select></dd> + </dl> + </fieldset> + + <fieldset> + <legend>{L_FOREGROUND}</legend> + <dl> + <dt><label for="color">{L_FONT_COLOUR}:</label><br /><span>{L_CSS_COLOUR_EXPLAIN}</span></dt> + <dd><input id="color" name="color" type="text" value="{COLOR}" size="6" /> <span>[ <a href="#" onclick="swatch('color'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd> + </dl> + <dl> + <dt><label for="font_family">{L_FONT_FACE}:</label><br /><span>{L_FONT_FACE_EXPLAIN}</span></dt> + <dd><input id="font_family" name="font_family" type="text" value="{FONT_FAMILY}" size="40" maxlength="255" /></dd> + </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> + </dl> + <dl> + <dt><label for="font_weight">{L_BOLD}:</label></dt> + <dd><input id="font_weight" type="radio" name="font_weight" value="bold"<!-- IF FONT_WEIGHT eq "bold" --> checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" name="font_weight" value="normal"<!-- IF FONT_WEIGHT eq "normal" --> checked="checked"<!-- ENDIF --> /> {L_NO} <input type="radio" name="font_weight" value=""<!-- IF not FONT_WEIGHT --> checked="checked"<!-- ENDIF --> /> {L_UNSET}</dd> + </dl> + <dl> + <dt><label for="font_style">{L_ITALIC}:</label></dt> + <dd><input id="font_style" type="radio" name="font_style" value="italic"<!-- IF FONT_STYLE eq "italic" --> checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" name="font_style" value="normal"<!-- IF FONT_STYLE eq "normal" --> checked="checked"<!-- ENDIF --> /> {L_NO} <input type="radio" name="font_style" value=""<!-- IF not FONT_STYLE --> checked="checked"<!-- ENDIF --> /> {L_UNSET}</dd> + </dl> + <dl> + <dt><label for="text_decoration">{L_UNDERLINE}:</label></dt> + <dd><input id="text_decoration" type="radio" name="text_decoration" value="underline"<!-- IF TEXT_DECORATION eq "underline" --> checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" name="text_decoration" value="normal"<!-- IF TEXT_DECORATION eq "normal" --> checked="checked"<!-- ENDIF --> /> {L_NO} <input type="radio" name="text_decoration" value=""<!-- IF not TEXT_DECORATION --> checked="checked"<!-- ENDIF --> /> {L_UNSET}</dd> + </dl> + <dl> + <dt><label for="line_height">{L_LINE_SPACING}</label></dt> + <dd><input id="line_height" name="line_height" type="text" value="{LINE_HEIGHT}" size="3" maxlength="3" /> <select id="line_height_unit" name="line_height_unit">{S_LINE_HEIGHT_UNITS}</select></dd> + </dl> + </fieldset> - <fieldset> - <legend>{L_BACKGROUND}</legend> - <dl> - <dt><label for="background_color">{L_BACKGROUND_COLOUR}:</label><br /><span>{L_CSS_COLOUR_EXPLAIN}</span></dt> - <dd><input id="background_color" name="background_color" type="text" value="{BACKGROUND_COLOR}" size="6" /> <span>[ <a href="#" onclick="swatch('background_color'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd> - </dl> - <dl> - <dt><label for="backround_image">{L_BACKGROUND_IMAGE}:</label></td> - <dd><select id="background_image" name="background_image">{S_BACKGROUND_IMAGE}</select></dd> - </dl> - <dl> - <dt><label for="background_repeat">{L_BACKGROUND_REPEAT}:</label></dt> - <dd><select id="background_repeat" name="background_repeat">{S_BACKGROUND_REPEAT}</select></dd> - </dl> - </fieldset> + <!-- ENDIF --> - <fieldset> - <legend>{L_FOREGROUND}</legend> - <dl> - <dt><label for="color">{L_FONT_COLOUR}:</label><br /><span>{L_CSS_COLOUR_EXPLAIN}</span></dt> - <dd><input id="color" name="color" type="text" value="{COLOR}" size="6" /> <span>[ <a href="#" onclick="swatch('color'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd> - </dl> - <dl> - <dt><label for="font_family">{L_FONT_FACE}:</label><br /><span>{L_FONT_FACE_EXPLAIN}</span></dt> - <dd><input id="font_family" name="font_family" type="text" value="{FONT_FAMILY}" size="40" maxlength="255" /></dd> - </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> - </dl> - <dl> - <dt><label for="font_weight">{L_BOLD}:</label></dt> - <dd><input id="font_weight" type="radio" name="font_weight" value="bold"<!-- IF FONT_WEIGHT eq "bold" --> checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" name="font_weight" value="normal"<!-- IF FONT_WEIGHT eq "normal" --> checked="checked"<!-- ENDIF --> /> {L_NO} <input type="radio" name="font_weight" value=""<!-- IF not FONT_WEIGHT --> checked="checked"<!-- ENDIF --> /> {L_UNSET}</dd> - </dl> - <dl> - <dt><label for="font_style">{L_ITALIC}:</label></dt> - <dd><input id="font_style" type="radio" name="font_style" value="italic"<!-- IF FONT_STYLE eq "italic" --> checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" name="font_style" value="normal"<!-- IF FONT_STYLE eq "normal" --> checked="checked"<!-- ENDIF --> /> {L_NO} <input type="radio" name="font_style" value=""<!-- IF not FONT_STYLE --> checked="checked"<!-- ENDIF --> /> {L_UNSET}</dd> - </dl> - <dl> - <dt><label for="text_decoration">{L_UNDERLINE}:</label></dt> - <dd><input id="text_decoration" type="radio" name="text_decoration" value="underline"<!-- IF TEXT_DECORATION eq "underline" --> checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" name="text_decoration" value="normal"<!-- IF TEXT_DECORATION eq "normal" --> checked="checked"<!-- ENDIF --> /> {L_NO} <input type="radio" name="text_decoration" value=""<!-- IF not TEXT_DECORATION --> checked="checked"<!-- ENDIF --> /> {L_UNSET}</dd> - </dl> - <dl> - <dt><label for="line_height">{L_LINE_SPACING}</label></dt> - <dd><input id="line_height" name="line_height" type="text" value="{LINE_HEIGHT}" size="3" maxlength="3" /> <select id="line_height_unit" name="line_height_unit">{S_LINE_HEIGHT_UNITS}</select></dd> - </dl> - </fieldset> + <fieldset class="submit-buttons"> + {S_HIDDEN_FIELDS} + <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /> + <!-- IF S_SHOWCSS --> + <input class="button2" type="submit" id="hidecss" name="hidecss" value="{L_HIDE_CSS}" /> + <!-- ELSE --> + <input class="button2" type="submit" id="showcss" name="showcss" value="{L_SHOW_CSS}" /> + <!-- ENDIF --> + <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> + </fieldset> - <!-- ENDIF --> + </form> - <fieldset class="submit-buttons"> - {S_HIDDEN_FIELDS} - <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /> - <!-- IF S_SHOWCSS --> - <input class="button2" type="submit" id="hidecss" name="hidecss" value="{L_HIDE_CSS}" /> - <!-- ELSE --> - <input class="button2" type="submit" id="showcss" name="showcss" value="{L_SHOW_CSS}" /> <!-- ENDIF --> - <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> - </fieldset> - </form> - - <!-- ENDIF --> + <br /> + <h1>{L_CUSTOM_CLASS}</h1> - <br /> - <h1>{L_CUSTOM_CLASS}</h1> + <p>{L_CUSTOM_CLASS_EXPLAIN}</p> - <p>{L_CUSTOM_CLASS_EXPLAIN}</p> + <form id="acp_custom_class" method="post" action="{U_ACTION}"> - <form id="acp_custom_class" method="post" action="{U_ACTION}"> - - <fieldset> - <legend>{L_CUSTOM_CLASS}</legend> + <fieldset> + <legend>{L_CUSTOM_CLASS}</legend> <dl> <dt><label for="custom_class">{L_CSS_CLASS_NAME}:</label></dt></dt> <dd><input id="custom_class" name="custom_class" type="text" value="" maxlength="40" size="40" /></dd> </dl> - </fieldset> + </fieldset> - <fieldset class="quick"> - <input class="button1" type="submit" id="add_custom" name="add_custom" value="{L_SUBMIT}" /> - </fieldset> + <fieldset class="quick"> + <input class="button1" type="submit" id="add_custom" name="add_custom" value="{L_SUBMIT}" /> + </fieldset> + + </form> + + <!-- ENDIF --> - </form> -<!-- ENDIF --> <!-- ELSEIF S_CACHE --> + <script language="Javascript" type="text/javascript"> <!-- - function viewsource(url) - { - window.open(url, '_source', 'HEIGHT=550,resizable=yes,scrollbars=yes,WIDTH=750'); - return false; - } + function viewsource(url) + { + window.open(url, '_source', 'HEIGHT=550,resizable=yes,scrollbars=yes,WIDTH=750'); + return false; + } //--> </script> @@ -398,17 +413,17 @@ <form name="acp_styles" method="post" action="{U_ACTION}"> <table cellspacing="1"> - <thead> - <tr> - <th>{L_CACHE_FILENAME}</th> - <th>{L_CACHE_FILESIZE}</th> - <th>{L_CACHE_CACHED}</th> - <th>{L_CACHE_MODIFIED}</th> - <th>{L_MARK}</th> - </tr> - </thead> - <tbody> - <!-- BEGIN file --> + <thead> + <tr> + <th>{L_CACHE_FILENAME}</th> + <th>{L_CACHE_FILESIZE}</th> + <th>{L_CACHE_CACHED}</th> + <th>{L_CACHE_MODIFIED}</th> + <th>{L_MARK}</th> + </tr> + </thead> + <tbody> + <!-- BEGIN file --> <!-- IF file.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> <td><a href="{file.U_VIEWSOURCE}" onclick="viewsource('{file.UA_VIEWSOURCE}');return false">{file.FILENAME}</a></td> <td>{file.FILESIZE}</td> @@ -416,11 +431,12 @@ <td>{file.MODIFIED}</td> <td><input type="checkbox" name="delete[]" value="{file.FILENAME}" /></td> </tr> - <!-- BEGINELSE --> + <!-- BEGINELSE --> <tr class="row1"> <td colspan="5">{L_TEMPLATE_CACHE_EMPTY}</td> </tr> - <!-- END file --> + <!-- END file --> + </tbody> </table> <fieldset class="quick"> @@ -428,7 +444,9 @@ <input class="button1" type="submit" id="submit" name="submit" value="{L_DELETE_MARKED}" /> </fieldset> + </form> + <!-- ELSEIF S_EXPORT --> <a href="{U_BACK}" style="float: right">« {L_BACK}</a> @@ -438,10 +456,10 @@ <p>{L_EXPLAIN}</p> <!-- IF S_ERROR_MSG --> - <div class="errorbox"> - <h3>{L_WARNING}</h3> - <p>{ERROR_MSG}</p> - </div> + <div class="errorbox"> + <h3>{L_WARNING}</h3> + <p>{ERROR_MSG}</p> + </div> <!-- ENDIF --> <form id="acp_styles" method="post" action="{U_ACTION}"> @@ -453,18 +471,18 @@ <dd><b>{NAME}</b></dd> </dl> <!-- IF S_STYLE --> - <dl> - <dt><label for="inc_template">{L_INCLUDE_TEMPLATE}:</label></dt> - <dd><input type="radio" class="radio" id="inc_template" name="inc_template" value="1" checked="checked" /> {L_YES} <input type="radio" class="radio" name="inc_template" value="0" /> {L_NO}</dd> - </dl> - <dl> - <dt><label for="inc_theme">{L_INCLUDE_THEME}:</label></dt> - <dd><input type="radio" class="radio" id="inc_theme" name="inc_theme" value="1" checked="checked" /> {L_YES} <input type="radio" class="radio" name="inc_theme" value="0" /> {L_NO}</dd> - </dl> - <dl> - <dt><label for="inc_imageset">{L_INCLUDE_IMAGESET}:</label></dt> - <dd><input type="radio" class="radio" id="inc_imageset" name="inc_imageset" value="1" checked="checked" /> {L_YES} <input type="radio" class="radio" name="inc_imageset" value="0" /> {L_NO}</dd> - </dl> + <dl> + <dt><label for="inc_template">{L_INCLUDE_TEMPLATE}:</label></dt> + <dd><input type="radio" class="radio" id="inc_template" name="inc_template" value="1" checked="checked" /> {L_YES} <input type="radio" class="radio" name="inc_template" value="0" /> {L_NO}</dd> + </dl> + <dl> + <dt><label for="inc_theme">{L_INCLUDE_THEME}:</label></dt> + <dd><input type="radio" class="radio" id="inc_theme" name="inc_theme" value="1" checked="checked" /> {L_YES} <input type="radio" class="radio" name="inc_theme" value="0" /> {L_NO}</dd> + </dl> + <dl> + <dt><label for="inc_imageset">{L_INCLUDE_IMAGESET}:</label></dt> + <dd><input type="radio" class="radio" id="inc_imageset" name="inc_imageset" value="1" checked="checked" /> {L_YES} <input type="radio" class="radio" name="inc_imageset" value="0" /> {L_NO}</dd> + </dl> <!-- ENDIF --> <dl> <dt><label for="store">{L_DOWNLOAD_STORE}:</label><br /><span>{L_DOWNLOAD_STORE_EXPLAIN}</span></dt> @@ -523,27 +541,27 @@ <td class="row3" colspan="{$COLSPAN}"><b>{L_UNINSTALLED}</b></td> </tr> <!-- IF not .uninstalled --> - <tr> - <td class="row1" colspan="{$COLSPAN}" style="text-align: center;">{L_NO_UNINSTALLED}</td> - </tr> + <tr> + <td class="row1" colspan="{$COLSPAN}" style="text-align: center;">{L_NO_UNINSTALLED}</td> + </tr> <!-- ENDIF --> <!-- BEGIN uninstalled --> - <tr> - <td<!-- IF S_STYLE --> colspan="2"<!-- ENDIF -->><b>{uninstalled.NAME}</b><br /><span>{L_COPYRIGHT}: {uninstalled.COPYRIGHT}</span></td> - <td style="text-align: center;"><a href="{uninstalled.U_INSTALL}">{L_INSTALL}</a></td> - </tr> + <tr> + <td<!-- IF S_STYLE --> colspan="2"<!-- ENDIF -->><b>{uninstalled.NAME}</b><br /><span>{L_COPYRIGHT}: {uninstalled.COPYRIGHT}</span></td> + <td style="text-align: center;"><a href="{uninstalled.U_INSTALL}">{L_INSTALL}</a></td> + </tr> <!-- END uninstalled --> </tbody> </table> <!-- IF S_STYLE --> - <form id="acp_styles" method="post" action="{U_ACTION}"> + <form id="acp_styles" method="post" action="{U_ACTION}"> <fieldset class="quick"> {L_CREATE}: <input type="text" name="name" value="" /> {L_FROM} <select name="basis">{S_BASIS_OPTIONS}</select> <input class="button2" type="submit" name="add" value="{L_SUBMIT}" /> </fieldset> - </form> + </form> <!-- ENDIF --> <!-- ELSEIF S_DETAILS --> @@ -555,10 +573,10 @@ <p>{L_EXPLAIN}</p> <!-- IF S_ERROR_MSG --> - <div class="errorbox"> - <h3>{L_WARNING}</h3> - <p>{ERROR_MSG}</p> - </div> + <div class="errorbox"> + <h3>{L_WARNING}</h3> + <p>{ERROR_MSG}</p> + </div> <!-- ENDIF --> <form id="acp_styles" method="post" action="{U_ACTION}"> diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html index a787d9283f..8e0747a1ae 100644 --- a/phpBB/adm/style/acp_users.html +++ b/phpBB/adm/style/acp_users.html @@ -437,11 +437,11 @@ <fieldset> <legend>{L_ACP_USER_AVATAR}</legend> - <dl> - <dt><label>{L_CURRENT_IMAGE}:</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt> - <dd>{AVATAR_IMAGE}</dd> - <dd><input type="checkbox" name="delete" /> <span>{L_DELETE_AVATAR}</span></dd> - </dl> + <dl> + <dt><label>{L_CURRENT_IMAGE}:</label><br /><span>{L_AVATAR_EXPLAIN}</span></dt> + <dd>{AVATAR_IMAGE}</dd> + <dd><input type="checkbox" name="delete" /> <span>{L_DELETE_AVATAR}</span></dd> + </dl> <!-- IF not S_IN_AVATAR_GALLERY --> <!-- IF S_CAN_UPLOAD --> <dl> @@ -474,26 +474,26 @@ <fieldset> <legend>{L_AVATAR_GALLERY}</legend> - <dl> - <dt><label for="category">{L_AVATAR_CATEGORY}:</label></dt> - <dd><select name="category" id="category">{S_CAT_OPTIONS}</select> <input class="button2" type="submit" value="{L_GO}" name="display_gallery" /></dd> - </dl> - <dl> - <table cellspacing="1"> - <!-- BEGIN avatar_row --> - <tr> - <!-- BEGIN avatar_column --> - <td class="row1" style="text-align: center;"><img src="{avatar_row.avatar_column.AVATAR_IMAGE}" alt="{avatar_row.avatar_column.AVATAR_NAME}" title="{avatar_row.avatar_column.AVATAR_NAME}" /></td> - <!-- END avatar_column --> - </tr> - <tr> - <!-- BEGIN avatar_option_column --> - <td class="row2" style="text-align: center;"><input type="radio" class="radio" name="avatar_select" value="{avatar_row.avatar_option_column.S_OPTIONS_AVATAR}" /></td> - <!-- END avatar_option_column --> - </tr> - <!-- END avatar_row --> - </table> - </dl> + <dl> + <dt><label for="category">{L_AVATAR_CATEGORY}:</label></dt> + <dd><select name="category" id="category">{S_CAT_OPTIONS}</select> <input class="button2" type="submit" value="{L_GO}" name="display_gallery" /></dd> + </dl> + <dl> + <table cellspacing="1"> + <!-- BEGIN avatar_row --> + <tr> + <!-- BEGIN avatar_column --> + <td class="row1" style="text-align: center;"><img src="{avatar_row.avatar_column.AVATAR_IMAGE}" alt="{avatar_row.avatar_column.AVATAR_NAME}" title="{avatar_row.avatar_column.AVATAR_NAME}" /></td> + <!-- END avatar_column --> + </tr> + <tr> + <!-- BEGIN avatar_option_column --> + <td class="row2" style="text-align: center;"><input type="radio" class="radio" name="avatar_select" value="{avatar_row.avatar_option_column.S_OPTIONS_AVATAR}" /></td> + <!-- END avatar_option_column --> + </tr> + <!-- END avatar_row --> + </table> + </dl> </fieldset> <fieldset class="quick" style="margin-top: -15px;"> @@ -515,10 +515,10 @@ <fieldset> <legend>{L_ACP_USER_RANK}</legend> - <dl> - <dt><label for="user_rank">{L_USER_RANK}:</label></dt> - <dd><select name="user_rank" id="user_rank">{S_RANK_OPTIONS}</select></dd> - </dl> + <dl> + <dt><label for="user_rank">{L_USER_RANK}:</label></dt> + <dd><select name="user_rank" id="user_rank">{S_RANK_OPTIONS}</select></dd> + </dl> </fieldset> <fieldset class="quick"> @@ -562,10 +562,10 @@ <form id="user_signature" method="post" action="{U_ACTION}"> <!-- IF SIGNATURE_PREVIEW --> - <fieldset> - <legend>{L_ADMIN_SIG_PREVIEW}</legend> - <p>{SIGNATURE_PREVIEW}</p> - </fieldset> + <fieldset> + <legend>{L_ADMIN_SIG_PREVIEW}</legend> + <p>{SIGNATURE_PREVIEW}</p> + </fieldset> <!-- ENDIF --> <fieldset> @@ -591,19 +591,19 @@ <a href="javascript:bbstyle(-1)" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a> </div> <p><input type="text" name="helpbox" value="{L_STYLES_TIP}" class="full" style="border: 0; background: none;" /></p> - <dl> - <dt style="width: 110px;"><script type="text/javascript"><!-- - colorPalette('v', 17, 5); - //--></script> - </dt> - <dd style="text-align: left; margin-left: 110px;"><textarea name="signature" rows="10" cols="60" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></dd> - <dd style="text-align: left; margin-left: 110px;"> - <!-- IF S_BBCODE_ALLOWED --><input type="checkbox" name="disable_bbcode"{S_BBCODE_CHECKED} /> {L_DISABLE_BBCODE} <!-- ENDIF --> - <!-- IF S_SMILIES_ALLOWED --><input type="checkbox" name="disable_smilies"{S_SMILIES_CHECKED} /> {L_DISABLE_SMILIES} <!-- ENDIF --> - <input type="checkbox" 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} - </dd> - </dl> + <dl> + <dt style="width: 110px;"><script type="text/javascript"><!-- + colorPalette('v', 17, 5); + //--></script> + </dt> + <dd style="text-align: left; margin-left: 110px;"><textarea name="signature" rows="10" cols="60" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></dd> + <dd style="text-align: left; margin-left: 110px;"> + <!-- IF S_BBCODE_ALLOWED --><input type="checkbox" name="disable_bbcode"{S_BBCODE_CHECKED} /> {L_DISABLE_BBCODE} <!-- ENDIF --> + <!-- IF S_SMILIES_ALLOWED --><input type="checkbox" name="disable_smilies"{S_SMILIES_CHECKED} /> {L_DISABLE_SMILIES} <!-- ENDIF --> + <input type="checkbox" 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} + </dd> + </dl> </fieldset> <fieldset class="quick"> diff --git a/phpBB/adm/style/acp_words.html b/phpBB/adm/style/acp_words.html index b17e80a8e8..ca02124956 100644 --- a/phpBB/adm/style/acp_words.html +++ b/phpBB/adm/style/acp_words.html @@ -40,11 +40,11 @@ <table cellspacing="1"> <thead> - <tr> - <th>{L_WORD}</th> - <th>{L_REPLACEMENT}</th> - <th colspan="2">{L_ACTION}</th> - </tr> + <tr> + <th>{L_WORD}</th> + <th>{L_REPLACEMENT}</th> + <th colspan="2">{L_ACTION}</th> + </tr> </thead> <tbody> <!-- BEGIN words --> diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index 67cd36ae16..759a5e0749 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -1,8 +1,6 @@ /* phpBB 3.0 Admin Style Sheet ------------------------------------------------------------------------ Original author: subBlue ( http://www.subBlue.com/ ) - Official update: $Id$ - Copyright 2006 phpBB Group ( http://www.phpbb.com/ ) ------------------------------------------------------------------------ */ @@ -14,12 +12,14 @@ /* Reset browsers default margin, padding and font sizes */ margin: 0; padding: 0; - } +} + html { font-size: 100%; height: 100%; margin-bottom: 1px; - } +} + body { /* Text-Sizing with ems: http://www.clagnut.com/blog/348/ */ font-family: Verdana, Helvetica, Arial, sans-serif; @@ -27,48 +27,55 @@ body { background: #E4EDF0 url("../images/bg_header.gif") 0 0 repeat-x; font-size: 62.5%; /* This sets the default font size to be equivalent to 10px */ margin: 0; - } +} + img { border: 0; - } +} + h1 { font: bold 1.8em 'Trebuchet MS', Verdana, sans-serif; text-decoration: none; color: #333333; - } +} + h2, caption { font: bold 1.2em Arial, Helvetica, sans-serif; text-decoration: none; line-height: 120%; text-align: left; margin-top: 25px; - } +} + p { margin-bottom: 0.7em; line-height: 1.4em; font-size: 1.1em; - } +} + hr { border: 0 none; border-top: 1px solid #999999; margin-bottom: 5px; padding-bottom: 5px; height: 1px; - } +} + .small { font-size: 1em; - } +} /* General links */ a:link, a:active, a:visited { color: #006699; text-decoration: none; - } +} + a:hover { color: #DD6900; text-decoration: underline; - } +} /* Main blocks @@ -76,45 +83,54 @@ a:hover { #wrap { padding: 0 20px 15px 20px; min-width: 615px; - } +} + #page-header { text-align: right; background: url("../images/phpbb_logo.gif") 0 0 no-repeat; height: 84px; - } +} + #page-header h1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 1.5em; font-weight: normal; padding-top: 15px; - } +} + #page-header p { font-size: 1.1em; - } +} + #page-body { clear: both; - } +} + #page-footer { clear: both; font-size: 1em; text-align: center; - } +} + #content { padding: 30px 10px 10px 10px; - } +} + #content h1 { line-height: 1.2em; margin-bottom: 0px; - } +} + #main { float:left; width: 76%; margin-left: 3%; min-height: 350px; - } +} + * html #main { height: 350px; - } +} /* Tabbed menu @@ -124,19 +140,22 @@ a:hover { line-height: normal; margin: 0 0 -6px 7px; min-width: 570px; - } +} + #tabs ul { margin:0; padding: 0; list-style: none; - } +} + #tabs li { display: inline; margin: 0; padding: 0; font-size: 1em; font-weight: bold; - } +} + #tabs a { float:left; background:url("../images/bg_tabs1.gif") no-repeat 0% -35px; @@ -144,7 +163,8 @@ a:hover { padding: 0 0 0 6px; text-decoration: none; position: relative; - } +} + #tabs a span { float: left; display: block; @@ -153,32 +173,38 @@ a:hover { color: #536482; white-space: nowrap; text-transform: uppercase; - } +} + /* Commented Backslash Hack hides rule from IE5-Mac \*/ #tabs a span { float:none; } /* End hack */ #tabs a:hover span { color: #DD6900; - } +} + #tabs #activetab a { background-position: 0 0px; border-bottom: 1px solid #FFFFFF; - } +} + #tabs #activetab a span { background-position: 100% 0px; padding-bottom: 7px; color: #333333; - } +} + #tabs a:hover { background-position: 0 -70px; - } +} + #tabs a:hover span { background-position:100% -70px; - } +} + #tabs #activetab a:hover span { color: #333333; - } +} /* Main Panel @@ -187,11 +213,12 @@ a:hover { margin: 4px 0; background-color: #FFFFFF; border: solid 1px #A9B8C2; - } +} + span.corners-top, span.corners-bottom, span.corners-top span, span.corners-bottom span { display: none; - } +} /* Sub-navigation Menu @@ -201,20 +228,22 @@ span.corners-top span, span.corners-bottom span { width: 20%; font-size: 100%; padding: 0; - } +} + #menu p { font-size: 1em; - } +} + #menu ul { list-style: none; - } +} /* Default list state */ #menu li { font-size: 1em; font-weight: bold; display: inline; - } +} /* Link styles for the sub-section links */ #menu li span { @@ -226,17 +255,20 @@ span.corners-top span, span.corners-bottom span { font-weight: bold; background-color: #ECECEC; border-top: 1px solid #FFFFFF; - } +} + #menu li a:hover span, #menu li#activemenu span { text-decoration: none; background-color: #FFA34F; color: #FFFFFF; - } +} + #menu li span.completed { text-decoration: none; background-color: #B9DBB3; color: #006699; - } +} + #menu li.header { display: block; padding: 5px; @@ -247,17 +279,19 @@ span.corners-top span, span.corners-bottom span { background: #006699 url("../images/cellpic3.gif") 0 0 repeat-x; margin-top: 5px; text-transform: uppercase; - } +} + #menu li#activemenu a span { text-decoration: none; font-weight: bold; color: #000; background-color: #DADFE4; - } +} + #menu li#activemenu a:hover span { text-decoration: none; color: #000; - } +} /* Table styles @@ -266,22 +300,25 @@ span.corners-top span, span.corners-bottom span { table { width: 100%; /*background-color: #ACBBC6;*/ - } +} + th, td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 1.1em; text-align: left; - } -th { +} + +th { padding: 6px 4px; color: #FFA34F; font-weight: bold; background: #006699 url("../images/cellpic3.gif") 0 0 repeat-x; - } +} + td { padding: 4px; line-height: 1.2em; - } +} .row1 { background-color: #EFEFEF; } .row2 { background-color: #DEE3E7; } @@ -294,24 +331,26 @@ td { background-color: #D1D7DC; height: 1px; line-height: 1px; - } +} table.type2 { border: none; background: none; padding: 0; width: 0; - } +} + table.type2 th { background: none; border-top: none; text-align: center; color: #FFA34F; padding: 2px 0; - } +} + table.type2 td { padding: 0; - } +} /* General form styles @@ -325,13 +364,16 @@ fieldset { border-top: 1px solid #D5D5C8; background-color: #ECECEC; position: relative; - } +} + * html fieldset { padding: 0 10px 5px 10px; - } +} + fieldset p { font-size: 1.1em; - } +} + legend { padding: 1px 0; font-family: arial,Verdana,Sans-serif; @@ -343,12 +385,13 @@ legend { line-height: 100%; top: 0em; vertical-align:middle; - } +} + * html legend { margin-bottom: -10px; margin-left: -7px; top: -1.2em; - } +} input { font-family: Verdana, Helvetica, Arial, sans-serif; @@ -363,7 +406,8 @@ input { padding: 2px; cursor: text; vertical-align: middle; - } +} + select { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 100%; @@ -375,17 +419,21 @@ select { border: 1px solid #666666; padding: 1px; background-color: #FAFAFA; - } +} + optgroup { font-weight: bold; - } +} + option { padding-right: 1em; - } +} + .sep { color: black; background-color: #FFA34F; - } +} + textarea { font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 100%; @@ -397,19 +445,22 @@ textarea { border-right: 1px solid #D5D5C8; border-bottom: 1px solid #D5D5C8; cursor: text; - } +} + label { cursor:pointer; font-size: 1.1em; padding-right: 5px; - } +} + label input { font-size: 100%; vertical-align: middle; - } +} + label img { vertical-align: middle; - } +} fieldset.quick { margin: 0 0 5px 0; @@ -418,14 +469,16 @@ fieldset.quick { background-color: transparent; text-align: right; font-size: 1.1em; - } +} + fieldset.nobg { margin: 15px 0 0 0; padding: 0; border: none; background-color: transparent; font-size: 1.1em; - } +} + fieldset.display-options { margin: 15px 0 2px 0; padding: 0 0 4px 0; @@ -433,21 +486,23 @@ fieldset.display-options { background-color: transparent; text-align: center; font-size: 1.1em; - } +} + fieldset.display-options select, fieldset.display-options input, fieldset.display-options label { font-size: 100%; vertical-align: middle; - } +} + select option.disabled { background-color: #bbb; color: #fff; - } +} /* Special case inputs */ select#board_timezone, select#full_folder_action { width: 95%; - } +} /* Definition list layout for forms @@ -455,11 +510,12 @@ select#full_folder_action { ---------------------------------------- */ dl { font-family: Verdana, Helvetica, Arial, sans-serif; - } +} + dt { float: left; width: auto; - } +} dd { color: #000; } dd + dd { padding-top: 5px; } @@ -471,46 +527,55 @@ dt label { font-size: 100%; text-align: left; font-weight: bold; - } +} + dd label { white-space: nowrap; margin-right: 10px; - } +} html>body dd label input { vertical-align: text-bottom; } /* Tweak for Moz to align checkboxes/radio buttons nicely */ + dd input, dd select { max-width: 100%; - } +} + dd textarea { width: 100%; - } +} + input.radio { width: auto !important; background-color: transparent; border: none; cursor: default; - } +} + dd select { width: auto; font-size: 100%; - } +} + fieldset dl { margin-bottom: 10px; font-size: 1.1em; - } +} + fieldset dt { width: 45%; text-align: left; border-right: 1px solid #CCC; padding-top: 3px; - } +} + fieldset dd { margin-left: 45%; padding-left: 5px; border-left: 1px solid #CCC; vertical-align: top; - } +} + dd.full { margin-left: 0; border: 0; @@ -518,15 +583,16 @@ dd.full { padding-top: 3px; text-align: center; width: 95%; - } +} /* Hover highlights for form rows */ fieldset dl:hover dt label { color: #000000; - } +} + input:focus, textarea:focus { color: #000000; - } +} /* Submit button fieldset @@ -537,10 +603,11 @@ fieldset.submit-buttons { margin: 0; padding: 4px; margin-top: -1px; - } +} + fieldset.submit-buttons input { padding: 3px 2px; - } +} /* Input field styles @@ -556,29 +623,33 @@ fieldset.submit-buttons input { padding:2px; cursor: text; width: 75%; - } +} + select.inputbox { cursor: pointer; padding: 0; width: auto; - } +} + .inputbox:hover { border-left: 1px solid #AFAEAA; border-top: 1px solid #AFAEAA; border-right: 1px solid #AFAEAA; border-bottom: 1px solid #AFAEAA; background-color: #E9E9E2; - } +} + .inputbox:focus { border: 1px solid #BC2A4D; background-color: #E9E9E2; color: #BC2A4D; - } +} input.full, textarea.full { width: 99%; - } +} + * html input.full, * html textarea.full { width: 95%; } input.medium { width: 50%; } input.narrow { width: 25%; } @@ -596,11 +667,13 @@ input.autowidth { width: auto !important; } margin-top: 5px; font-size: 1em; padding-bottom: 2px; - } +} + .pagination strong, .pagination b { font-weight: normal; - } +} + .pagination span strong { padding: 0 2px; margin: 0 2px; @@ -608,7 +681,8 @@ input.autowidth { width: auto !important; } color: #FFFFFF; background: #069; border: 1px solid #069; - } +} + .pagination span a, .pagination span a:link, .pagination span a:visited, .pagination span a:active { font-weight: normal; text-decoration: none; @@ -617,16 +691,18 @@ input.autowidth { width: auto !important; } padding: 0 2px; background: #ECEDEE; border: 1px solid #B4BAC0; - } +} + .pagination span a:hover { border-color: #069; background: #069; color: #FFF; text-decoration: none; - } +} + .pagination img { vertical-align: middle; - } +} /* Form button styles @@ -639,14 +715,16 @@ a.button2, input.button2 { color: #000; background-color: #EFEFEF; cursor: pointer; - } +} + a.button1, input.button1 { font-weight: bold; border: 1px solid #666666; - } +} + a.button2, input.button2 { border: 1px solid #666666; - } +} /* <a> button in the style of the form buttons */ a.button1, a.button1:link, a.button1:visited, a.button1:active, @@ -654,7 +732,7 @@ a.button2, a.button2:link, a.button2:visited, a.button2:active { text-decoration: none; color: #000000; padding: 4px 8px; - } +} /* Permission related ---------------------------------------- */ @@ -823,55 +901,65 @@ table.pmask td.name { ---------------------------------------- */ .success { color: #282 !important; - } +} + .error { color: #BC2A4D !important; - } +} + .successbox, .errorbox { padding: 10px; margin: 20px 0; color: #1F5B13; text-align: center; - } +} + .successbox { background-color: #B9DBB3; - } +} + .errorbox { background-color: #ECECEC; - } +} + .successbox h3, .errorbox h3 { font-weight: bold; font-size: 1.4em; margin-bottom: 0.5em; - } +} + .successbox p, .errorbox p { font-size: 1.1em; margin-bottom: 0; - } +} + .successbox a, .errorbox a { font-weight: bold; text-decoration: none; - } +} /* Special cases for the error page */ #errorpage #page-header a { font-weight: bold; line-height: 6em; - } +} + #errorpage #content { padding-top: 10px; - } +} + #errorpage #content h1 { color: #DF075C; - } +} + #errorpage #content h2 { margin-top: 20px; margin-bottom: 5px; border-bottom: 1px solid #CCCCCC; padding-bottom: 5px; color: #333333; - } +} /* Tooltip for permission roles */ .tooltip { @@ -896,10 +984,11 @@ table.pmask td.name { */ #format-buttons { margin: 15px 0 2px 0; - } +} + #format-buttons input, #format-buttons select { vertical-align: middle; - } +} /* Nice method for clearing floated blocks without having to insert any extra markup From http://www.positioniseverything.net/easyclearing.html */ @@ -910,6 +999,7 @@ table.pmask td.name { clear: both; visibility: hidden; } + /* Hide from Mac IE, Windows IE uses this as it doesn't support the :after method above \*/ .clearfix, #tabs, .row, #content, fieldset dl, #page-body { height: 1%; @@ -927,27 +1017,34 @@ table.pmask td.name { text-align: right; padding: 0px; } + .source { font-family: 'Courier New', monospace; font-size: 125%; line-height: 120%; padding: 0px; } + .syntaxbg { color: #FFFFFF; - } +} + .syntaxcomment { color: #FF8000; - } +} + .syntaxdefault { color: #0000BB; - } +} + .syntaxhtml { color: #000000; - } +} + .syntaxkeyword { color: #007700; - } +} + .syntaxstring { color: #DD0000; - }
\ No newline at end of file +} diff --git a/phpBB/adm/style/editor.js b/phpBB/adm/style/editor.js index c9a93bd7bf..ef52b65998 100644 --- a/phpBB/adm/style/editor.js +++ b/phpBB/adm/style/editor.js @@ -1,5 +1,7 @@ -// bbCode control by subBlue design [ www.subBlue.com ] -// Includes unixsafe colour palette selector by SHS` +/** +* bbCode control by subBlue design [ www.subBlue.com ] +* Includes unixsafe colour palette selector by SHS` +*/ // Startup variables var imageTag = false; @@ -10,51 +12,74 @@ var theSelection = false; var clientPC = navigator.userAgent.toLowerCase(); // Get client info var clientVer = parseInt(navigator.appVersion); // Get browser version -var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1)); -var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1) - && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1) - && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1)); +var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1)); +var is_nav = ((clientPC.indexOf('mozilla') != -1) && (clientPC.indexOf('spoofer') == -1) && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera') == -1) && (clientPC.indexOf('webtv') == -1) && (clientPC.indexOf('hotjava') == -1)); -var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1)); -var is_mac = (clientPC.indexOf("mac")!=-1); +var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1)); +var is_mac = (clientPC.indexOf('mac') != -1); -// Shows the help messages in the helpline window -function helpline(help) { - document.forms[form_name].helpbox.value = eval(help + "_help"); +/** +* Shows the help messages in the helpline window +*/ +function helpline(help) +{ + document.forms[form_name].helpbox.value = eval(help + '_help'); } -// Replacement for arrayname.length property -function getarraysize(thearray) { - for (i = 0; i < thearray.length; i++) { - if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null)) +/** +* Replacement for arrayname.length property +*/ +function getarraysize(thearray) +{ + for (i = 0; i < thearray.length; i++) + { + if (thearray[i] == 'undefined' || thearray[i] == '' || thearray[i] == null) + { return i; } + } + return thearray.length; } -// Replacement for arrayname.push(value) not implemented in IE until version 5.5 -// Appends element to the array -function arraypush(thearray,value) { - thearray[ getarraysize(thearray) ] = value; +/** +* Replacement for arrayname.push(value) not implemented in IE until version 5.5 +* Appends element to the array +*/ +function arraypush(thearray,value) +{ + thearray[getarraysize(thearray)] = value; } -// Replacement for arrayname.pop() not implemented in IE until version 5.5 -// Removes and returns the last element of an array -function arraypop(thearray) { +/** +* Replacement for arrayname.pop() not implemented in IE until version 5.5 +* Removes and returns the last element of an array +*/ +function arraypop(thearray) +{ thearraysize = getarraysize(thearray); retval = thearray[thearraysize - 1]; delete thearray[thearraysize - 1]; + return retval; } -function smiley(text) { +/** +* Insert emoticon +*/ +function smiley(text) +{ text = ' ' + text + ' '; - if (document.forms[form_name].elements[text_name].createTextRange && document.forms[form_name].elements[text_name].caretPos) { + + 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 { + } + else + { var selStart = document.forms[form_name].elements[text_name].selectionStart; var selEnd = document.forms[form_name].elements[text_name].selectionEnd; @@ -65,30 +90,70 @@ function smiley(text) { } } -function bbfontstyle(bbopen, bbclose) { - if ((clientVer >= 4) && is_ie && is_win) { +/** +* Apply bbcodes +*/ +function bbfontstyle(bbopen, bbclose) +{ + theSelection = false; + document.forms[form_name].elements[text_name].focus(); + + if ((clientVer >= 4) && is_ie && is_win) + { + // Get text selection theSelection = document.selection.createRange().text; - if (!theSelection) { - insert_text(bbopen + bbclose); + + if (theSelection) + { + // Add tags around selection + document.selection.createRange().text = bbopen + theSelection + bbclose; document.forms[form_name].elements[text_name].focus(); + theSelection = ''; return; } - document.selection.createRange().text = bbopen + theSelection + bbclose; - document.forms[form_name].elements[text_name].focus(); - return; - } else { - insert_text(bbopen + bbclose); + } + else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0)) + { + mozWrap(document.forms[form_name].elements[text_name], bbopen, bbclose); document.forms[form_name].elements[text_name].focus(); + theSelection = ''; return; } + + // Close image tag before adding + if (imageTag) + { + insert_text(bbtags[15]); + + // Remove the close image tag from the list + lastValue = arraypop(bbcode) - 1; + + // Return button back to normal state + document.forms[form_name].addbbcode14.value = 'Img'; + imageTag = false; + } + + // Open tag + insert_text(bbopen + bbclose); + + document.forms[form_name].elements[text_name].focus(); + storeCaret(document.forms[form_name].elements[text_name]); + return; } -function insert_text(text) { - if (document.forms[form_name].elements[text_name].createTextRange && document.forms[form_name].elements[text_name].caretPos) { +/** +* Insert text at position +*/ +function insert_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; - } else { + } + else if (document.forms[form_name].elements[text_name].selectionStart) + { var selStart = document.forms[form_name].elements[text_name].selectionStart; var selEnd = document.forms[form_name].elements[text_name].selectionEnd; @@ -96,44 +161,127 @@ function insert_text(text) { document.forms[form_name].elements[text_name].selectionStart = selStart + text.length; document.forms[form_name].elements[text_name].selectionEnd = selEnd + text.length; } + else + { + document.forms[form_name].elements[text_name].value = document.forms[form_name].elements[text_name].value + text; + } } -function attach_inline() { +/** +* Add inline attachment at position +*/ +function attach_inline() +{ insert_text('[attachment=' + document.forms[form_name].elements['attachments'].value + ']' + document.forms[form_name].elements['attachments'].options[document.forms[form_name].elements['attachments'].selectedIndex].text + '[/attachment]'); + document.forms[form_name].elements[text_name].focus(); } -function bbstyle(bbnumber) { +/** +* Add quote text to message +*/ +function addquote(post_id, username) +{ + var message_name = 'message_' + post_id; + var theSelection = ''; + var divarea = false; + if (document.all) + { + eval('divarea = document.all.' + message_name + ';'); + } + else + { + eval("divarea = document.getElementById('" + message_name + "');"); + } + + // Get text selection - not only the post content :( + if (window.getSelection) + { + theSelection = window.getSelection().toString(); + } + else if (document.getSelection) + { + theSelection = document.getSelection(); + } + else if (document.selection) + { + theSelection = document.selection.createRange().text; + } + + if (theSelection == '') + { + if (document.all) + { + theSelection = divarea.innerText; + } + else if (divarea.textContent) + { + theSelection = divarea.textContent; + } + else if (divarea.firstChild.nodeValue) + { + theSelection = divarea.firstChild.nodeValue; + } + } + + if (theSelection) + { + insert_text('[quote="' + username + '"]' + theSelection + '[/quote]'); + } + + return; +} + +/** +* bbstyle +*/ +function bbstyle(bbnumber) +{ donotinsert = false; theSelection = false; bblast = 0; document.forms[form_name].elements[text_name].focus(); - if (bbnumber == -1) { // Close all open tags & default button names - while (bbcode[0]) { + // Close all open tags & default button names + if (bbnumber == -1) + { + while (bbcode[0]) + { butnumber = arraypop(bbcode) - 1; document.forms[form_name].elements[text_name].value += bbtags[butnumber + 1]; buttext = eval('document.forms[form_name].addbbcode' + butnumber + '.value'); - if (buttext != "[*]") + + if (buttext != '[*]') { eval('document.forms[form_name].addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); } } - document.forms[form_name].addbbcode10.value = "List"; - bbtags[10] = "[list]"; - document.forms[form_name].addbbcode12.value = "List="; - bbtags[12] = "[list=]"; - imageTag = false; // All tags are closed including image tags :D + + document.forms[form_name].addbbcode10.value = 'List'; + bbtags[10] = '[list]'; + + document.forms[form_name].addbbcode12.value = 'List='; + bbtags[12] = '[list=]'; + + // All tags are closed including image tags :D + imageTag = false; document.forms[form_name].elements[text_name].focus(); + return; } + // [*] doesn't have an end tag + noEndTag = (bbtags[bbnumber] == '[*]') + if ((clientVer >= 4) && is_ie && is_win) { - theSelection = document.selection.createRange().text; // Get text selection - if (theSelection) { + // Get text selection + theSelection = document.selection.createRange().text; + + if (theSelection) + { // Add tags around selection - document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1]; + document.selection.createRange().text = bbtags[bbnumber] + theSelection + ((!noEndTag) ? bbtags[bbnumber+1] : ''); document.forms[form_name].elements[text_name].focus(); theSelection = ''; return; @@ -141,99 +289,121 @@ function bbstyle(bbnumber) { } else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0)) { - mozWrap(document.forms[form_name].elements[text_name], bbtags[bbnumber], bbtags[bbnumber+1]); + mozWrap(document.forms[form_name].elements[text_name], bbtags[bbnumber], ((!noEndTag) ? bbtags[bbnumber+1] : '')); document.forms[form_name].elements[text_name].focus(); theSelection = ''; return; } // Find last occurance of an open tag the same as the one just clicked - for (i = 0; i < bbcode.length; i++) { - if (bbcode[i] == bbnumber+1) { + for (i = 0; i < bbcode.length; i++) + { + if (bbcode[i] == bbnumber+1) + { bblast = i; donotinsert = true; } } - if ((bbnumber == 10) && (bbtags[10] != "[*]")) + if (bbnumber == 10 && bbtags[10] != '[*]') { if (donotinsert) { - document.forms[form_name].addbbcode12.value = "List="; + document.forms[form_name].addbbcode12.value = 'List='; tmp_help = o_help; o_help = e_help; e_help = tmp_help; - bbtags[12] = "[list=]"; + bbtags[12] = '[list=]'; } else { - document.forms[form_name].addbbcode12.value = "[*]"; + document.forms[form_name].addbbcode12.value = '[*]'; tmp_help = o_help; o_help = e_help; e_help = tmp_help; - bbtags[12] = "[*]"; + bbtags[12] = '[*]'; } } - if ((bbnumber == 12) && (bbtags[12] != "[*]")) + if (bbnumber == 12 && bbtags[12] != '[*]') { if (donotinsert) { - document.forms[form_name].addbbcode10.value = "List"; + document.forms[form_name].addbbcode10.value = 'List'; tmp_help = l_help; l_help = e_help; e_help = tmp_help; - bbtags[10] = "[list]"; + bbtags[10] = '[list]'; } else { - document.forms[form_name].addbbcode10.value = "[*]"; + document.forms[form_name].addbbcode10.value = '[*]'; tmp_help = l_help; l_help = e_help; e_help = tmp_help; - bbtags[10] = "[*]"; + bbtags[10] = '[*]'; } } - if (donotinsert) { // Close all open tags up to the one just clicked & default button names - while (bbcode[bblast]) { - butnumber = arraypop(bbcode) - 1; - if (bbtags[butnumber] != "[*]") - { - insert_text(bbtags[butnumber + 1]); - } - else - { - insert_text(bbtags[butnumber]); - } - buttext = eval('document.forms[form_name].addbbcode' + butnumber + '.value'); - if (bbtags[butnumber] != "[*]") - { - eval('document.forms[form_name].addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); - } - imageTag = false; + // Close all open tags up to the one just clicked & default button names + if (donotinsert) + { + while (bbcode[bblast]) + { + butnumber = arraypop(bbcode) - 1; + + if (bbtags[butnumber] != '[*]') + { + insert_text(bbtags[butnumber + 1]); + } + else + { + insert_text(bbtags[butnumber]); } - document.forms[form_name].elements[text_name].focus(); - return; - } else { // Open tags - if (imageTag && (bbnumber != 14)) { // Close image tag before adding another + buttext = eval('document.forms[form_name].addbbcode' + butnumber + '.value'); + + if (bbtags[butnumber] != '[*]') + { + eval('document.forms[form_name].addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); + } + imageTag = false; + } + document.forms[form_name].elements[text_name].focus(); + return; + } + else + { + // Open tags + + // Close image tag before adding another + if (imageTag && (bbnumber != 14)) + { insert_text(bbtags[15]); - lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list - document.forms[form_name].addbbcode14.value = "Img"; // Return button back to normal state + // Remove the close image tag from the list + lastValue = arraypop(bbcode) - 1; + + // Return button back to normal state + document.forms[form_name].addbbcode14.value = 'Img'; imageTag = false; } // Open tag insert_text(bbtags[bbnumber]); - if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag - if (bbtags[bbnumber] != "[*]") + // Check to stop additional tags after an unclosed image tag + if (bbnumber == 14 && imageTag == false) + { + imageTag = 1; + } + + if (bbtags[bbnumber] != '[*]') { - arraypush(bbcode,bbnumber+1); + arraypush(bbcode, bbnumber + 1); eval('document.forms[form_name].addbbcode'+bbnumber+'.value += "*"'); } + document.forms[form_name].elements[text_name].focus(); return; } @@ -241,66 +411,94 @@ function bbstyle(bbnumber) { storeCaret(document.forms[form_name].elements[text_name]); } -// From http://www.massless.org/mozedit/ +/** +* From http://www.massless.org/mozedit/ +*/ function mozWrap(txtarea, open, close) { var selLength = txtarea.textLength; var selStart = txtarea.selectionStart; var selEnd = txtarea.selectionEnd; + var scrollTop = txtarea.scrollTop; + if (selEnd == 1 || selEnd == 2) + { selEnd = selLength; + } var s1 = (txtarea.value).substring(0,selStart); var s2 = (txtarea.value).substring(selStart, selEnd) var s3 = (txtarea.value).substring(selEnd, selLength); + txtarea.value = s1 + open + s2 + close + s3; + txtarea.selectionStart = selEnd + open.length + close.length; + txtarea.selectionEnd = txtarea.selectionStart; + txtarea.focus(); + txtarea.scrollTop = scrollTop; + return; } -// Insert at Claret position. Code from -// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130 -function storeCaret(textEl) { - if (textEl.createTextRange) { textEl.caretPos = document.selection.createRange().duplicate(); } +/** +* Insert at Claret position. Code from +* http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130 +*/ +function storeCaret(textEl) +{ + if (textEl.createTextRange) + { + textEl.caretPos = document.selection.createRange().duplicate(); + } } +/** +* Color pallette +*/ function colorPalette(dir, width, height) { var r = 0, g = 0, b = 0; var numberList = new Array(6); - numberList[0] = "00"; - numberList[1] = "40"; - numberList[2] = "80"; - numberList[3] = "BF"; - numberList[4] = "FF"; - document.writeln('<table class="type2">'); - for(r = 0; r < 5; r++) + + numberList[0] = '00'; + numberList[1] = '40'; + numberList[2] = '80'; + numberList[3] = 'BF'; + numberList[4] = 'FF'; + + document.writeln('<table cellspacing="1" cellpadding="0" border="0">'); + + for (r = 0; r < 5; r++) { if (dir == 'h') { document.writeln('<tr>'); } - for(g = 0; g < 5; g++) + + for (g = 0; g < 5; g++) { if (dir == 'v') { document.writeln('<tr>'); } - for(b = 0; b < 5; b++) + + for (b = 0; b < 5; b++) { 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 + '" alt="#' + color + '" title="#' + color + '" /></a>'); + 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.writeln('</td>'); } + if (dir == 'v') { document.writeln('</tr>'); } } + if (dir == 'h') { document.writeln('</tr>'); } } document.writeln('</table>'); -}
\ No newline at end of file +} diff --git a/phpBB/adm/style/install_convert.html b/phpBB/adm/style/install_convert.html index 7755cf957e..22f3426626 100755 --- a/phpBB/adm/style/install_convert.html +++ b/phpBB/adm/style/install_convert.html @@ -6,16 +6,16 @@ {BODY} <!-- IF S_LIST --> -<table cellspacing="1"> - <caption>{L_AVAILABLE_CONVERTORS}</caption> - <col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" /> + <table cellspacing="1"> + <caption>{L_AVAILABLE_CONVERTORS}</caption> + <col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" /> <thead> - <tr> - <th>{L_SOFTWARE}</th> - <th>{L_VERSION}</th> - <th>{L_AUTHOR}</th> - <th>{L_OPTIONS}</th> - </tr> + <tr> + <th>{L_SOFTWARE}</th> + <th>{L_VERSION}</th> + <th>{L_AUTHOR}</th> + <th>{L_OPTIONS}</th> + </tr> </thead> <tbody> <!-- IF .convertors --> @@ -36,7 +36,7 @@ </tr> <!-- ENDIF --> </tbody> -</table> + </table> <!-- ENDIF --> <!-- IF .checks --> @@ -88,13 +88,13 @@ <!-- ENDIF --> <!-- IF L_SUBMIT --> -<fieldset class="submit-buttons"> - <!-- IF L_MESSAGE --><p>{L_MESSAGE}</p><!-- ENDIF --> - {S_HIDDEN} - <!-- IF L_SUBMIT --><input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /><!-- ENDIF --> -</fieldset> + <fieldset class="submit-buttons"> + <!-- IF L_MESSAGE --><p>{L_MESSAGE}</p><!-- ENDIF --> + {S_HIDDEN} + <!-- IF L_SUBMIT --><input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /><!-- ENDIF --> + </fieldset> <!-- ENDIF --> - </form> + <!-- INCLUDE install_footer.html -->
\ No newline at end of file diff --git a/phpBB/adm/style/install_footer.html b/phpBB/adm/style/install_footer.html index e46ca774c3..dd249d9259 100755 --- a/phpBB/adm/style/install_footer.html +++ b/phpBB/adm/style/install_footer.html @@ -1,4 +1,4 @@ - + </div> </div> <span class="corners-bottom"><span></span></span> diff --git a/phpBB/adm/style/install_install.html b/phpBB/adm/style/install_install.html index 148097acc6..3d265af354 100755 --- a/phpBB/adm/style/install_install.html +++ b/phpBB/adm/style/install_install.html @@ -54,22 +54,24 @@ <!-- ENDIF --> <!-- IF S_SHOW_DOWNLOAD --> -<fieldset> - <legend>{L_DL_CONFIG}</legend> - <p>{L_DL_CONFIG_EXPLAIN}</p> -</fieldset> -<fieldset class="submit-buttons"> - {S_HIDDEN} - <input class="button1" type="submit" id="dlconfig" name="dlconfig" value="{L_DL_DOWNLOAD}" /> <input class="button1" type="submit" id="dldone" name="dldone" value="{L_DL_DONE}" /> -</fieldset> + <fieldset> + <legend>{L_DL_CONFIG}</legend> + <p>{L_DL_CONFIG_EXPLAIN}</p> + </fieldset> + + <fieldset class="submit-buttons"> + {S_HIDDEN} + <input class="button1" type="submit" id="dlconfig" name="dlconfig" value="{L_DL_DOWNLOAD}" /> <input class="button1" type="submit" id="dldone" name="dldone" value="{L_DL_DONE}" /> + </fieldset> <!-- ENDIF --> <!-- IF L_SUBMIT --> -<fieldset class="submit-buttons"> - {S_HIDDEN} - <!-- IF L_SUBMIT --><input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /><!-- ENDIF --> -</fieldset> + <fieldset class="submit-buttons"> + {S_HIDDEN} + <!-- IF L_SUBMIT --><input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /><!-- ENDIF --> + </fieldset> <!-- ENDIF --> </form> + <!-- INCLUDE install_footer.html -->
\ No newline at end of file diff --git a/phpBB/adm/style/install_main.html b/phpBB/adm/style/install_main.html index 983b6aa0c4..5624102612 100755 --- a/phpBB/adm/style/install_main.html +++ b/phpBB/adm/style/install_main.html @@ -1,5 +1,6 @@ <!-- INCLUDE install_header.html --> - <h2>{TITLE}</h2> - {BODY} + <h2>{TITLE}</h2> + {BODY} + <!-- INCLUDE install_footer.html -->
\ No newline at end of file diff --git a/phpBB/adm/style/overall_footer.html b/phpBB/adm/style/overall_footer.html index b81eba5000..1ca5c4304e 100644 --- a/phpBB/adm/style/overall_footer.html +++ b/phpBB/adm/style/overall_footer.html @@ -1,4 +1,4 @@ - + </div> </div> <span class="corners-bottom"><span></span></span> @@ -13,7 +13,7 @@ "phpBB" linked to www.phpbb.com. If you refuse to include even this then support on our forums may be affected. - The phpBB Group : 2004 + The phpBB Group : 2006 // --> <div id="page-footer"> diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index 6d3e412347..518ce835f2 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -17,7 +17,9 @@ var on_page = '{ON_PAGE}'; var per_page = '{PER_PAGE}'; var base_url = '{BASE_URL}'; -// Jump to page +/** +* Jump to page +*/ function jumpto() { var page = prompt(jump_page, on_page); @@ -28,8 +30,10 @@ function jumpto() } } -// Set display of page element -// s[-1,0,1] = hide,toggle display,show +/** +* Set display of page element +* s[-1,0,1] = hide,toggle display,show +*/ function dE(n, s, type) { if (!type) @@ -45,8 +49,10 @@ function dE(n, s, type) e.style.display = (s == 1) ? type : 'none'; } -// Mark/unmark checkboxes -// id = ID of parent container, name = name prefix, state = state [true/false] +/** +* Mark/unmark checkboxes +* id = ID of parent container, name = name prefix, state = state [true/false] +*/ function marklist(id, name, state) { var parent = document.getElementById(id); @@ -71,6 +77,9 @@ function marklist(id, name, state) } } +/** +* Open trace popup +*/ function trace(link) { window.open(link, '_trace', 'height=515, resizable=yes, scrollbars=yes, width=680'); @@ -78,6 +87,9 @@ function trace(link) } <!-- IF S_INCLUDE_SWATCH --> + /** + * Color swatch + */ function swatch() { window.open('{UA_SWATCH}', '_swatch', 'height=150, resizable=yes, scrollbars=no, width=636'); diff --git a/phpBB/adm/style/permission_mask.html b/phpBB/adm/style/permission_mask.html index 5df845702d..beec9d011f 100644 --- a/phpBB/adm/style/permission_mask.html +++ b/phpBB/adm/style/permission_mask.html @@ -11,8 +11,10 @@ {S_ROLE_JS_ARRAY} <!-- ENDIF --> - // Show/hide option panels - // value = suffix for ID to show + /** + * Show/hide option panels + * value = suffix for ID to show + */ function swap_options(pmask, fmask, cat) { id = pmask + fmask + cat; @@ -38,19 +40,21 @@ active_cat = cat; } - // Mark all radio buttons in one panel - // id = table ID container, s = status ['y'/'u'/'n'] + /** + * Mark all radio buttons in one panel + * id = table ID container, s = status ['y'/'u'/'n'] + */ function mark_options(id, s) { var t = document.getElementById(id); - + if (!t) { return; } - + var rb = t.getElementsByTagName('input'); - + for (var r = 0; r < rb.length; r++ ) { if (rb[r].id.substr(rb[r].id.length-1) == s) @@ -60,19 +64,21 @@ } } - // Mark one radio button in one panel - // id = table ID container, field_name = the auth option, s = status ['y'/'u'/'n'] + /** + * Mark one radio button in one panel + * id = table ID container, field_name = the auth option, s = status ['y'/'u'/'n'] + */ function mark_one_option(id, field_name, s) { var t = document.getElementById(id); - + if (!t) { return; } var rb = t.getElementsByTagName('input'); - + for (var r = 0; r < rb.length; r++ ) { if (rb[r].id.substr(rb[r].id.length-field_name.length-3, field_name.length) == field_name && rb[r].id.substr(rb[r].id.length-1) == s) @@ -82,7 +88,9 @@ } } - // Reset role dropdown field to Select role... if an option gets changed + /** + * Reset role dropdown field to Select role... if an option gets changed + */ function reset_role(id) { var t = document.getElementById(id); @@ -95,7 +103,9 @@ t.options[0].selected = true; } - // Load role and set options accordingly + /** + * Load role and set options accordingly + */ function set_role_settings(role_id, target_id) { settings = role_options[role_id]; diff --git a/phpBB/adm/style/permission_trace.html b/phpBB/adm/style/permission_trace.html index 0bf889adaf..6b21865562 100644 --- a/phpBB/adm/style/permission_trace.html +++ b/phpBB/adm/style/permission_trace.html @@ -42,9 +42,9 @@ </tr> <!-- END trace --> </tbody> -</table> + </table> -<br /> + <br /> <!-- INCLUDE simple_footer.html --> diff --git a/phpBB/adm/style/search_index_progress_bar.html b/phpBB/adm/style/search_index_progress_bar.html index a55d4a3a77..ef9590119f 100644 --- a/phpBB/adm/style/search_index_progress_bar.html +++ b/phpBB/adm/style/search_index_progress_bar.html @@ -1,7 +1,10 @@ <!-- INCLUDE simple_header.html --> -<script language="javascript" type="text/javascript"> +<script type="text/javascript"> <!-- + /** + * Close previously opened popup + */ function close_popup() { if (opener != null) @@ -22,14 +25,13 @@ //--> </script> - <div class="successbox"> <h3>{L_PROGRESS}</h3> <img src="images/progress_bar.gif" alt="{L_PROGRESS}" /> <p>{L_PROGRESS_EXPLAIN}</p> </div> -<script language="javascript" type="text/javascript"> +<script type="text/javascript"> <!-- close_popup(); //--> diff --git a/phpBB/adm/style/simple_footer.html b/phpBB/adm/style/simple_footer.html index 6fca6972c3..8dbec6ace3 100644 --- a/phpBB/adm/style/simple_footer.html +++ b/phpBB/adm/style/simple_footer.html @@ -10,13 +10,13 @@ "phpBB" linked to www.phpbb.com. If you refuse to include even this then support on our forums may be affected. - The phpBB Group : 2004 + The phpBB Group : 2006 // --> <div id="page-footer"> <!-- IF S_COPYRIGHT_HTML --> - <br />Powered by phpBB {VERSION} © 2005 <a href="http://www.phpbb.com/">phpBB Group</a> + <br />Powered by phpBB {VERSION} © 2006 <a href="http://www.phpbb.com/">phpBB Group</a> <!-- ENDIF --> <!-- IF DEBUG_OUTPUT --> diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html index 98138debc5..67e66b3a9d 100644 --- a/phpBB/adm/style/simple_header.html +++ b/phpBB/adm/style/simple_header.html @@ -17,7 +17,9 @@ var on_page = '{ON_PAGE}'; var per_page = '{PER_PAGE}'; var base_url = '{BASE_URL}'; -// Jump to page +/** +* Jump to page +*/ function jumpto() { var page = prompt(jump_page, on_page); @@ -28,8 +30,10 @@ function jumpto() } } -// Set display of page element -// s[-1,0,1] = hide,toggle display,show +/** +* Set display of page element +* s[-1,0,1] = hide,toggle display,show +*/ function dE(n, s, type) { if (!type) @@ -45,8 +49,10 @@ function dE(n, s, type) e.style.display = (s == 1) ? type : 'none'; } -// Mark/unmark checkboxes -// id = ID of parent container, name = name prefix, state = state [true/false] +/** +* Mark/unmark checkboxes +* id = ID of parent container, name = name prefix, state = state [true/false] +*/ function marklist(id, name, state) { var parent = document.getElementById(id); @@ -67,6 +73,9 @@ function marklist(id, name, state) } <!-- IF S_INCLUDE_SWATCH --> + /** + * Color swatch + */ function swatch() { window.open('{UA_SWATCH}', '_swatch', 'height=115, resizable=yes, scrollbars=no, width=636'); diff --git a/phpBB/adm/style/tooltip.js b/phpBB/adm/style/tooltip.js index 0b5a2408f4..20610b52fe 100644 --- a/phpBB/adm/style/tooltip.js +++ b/phpBB/adm/style/tooltip.js @@ -60,6 +60,9 @@ function enable_tooltips_link(id, headline, sub_id) tooltip_mode = 'link'; } +/** +* Enable tooltip replacements for selects +*/ function enable_tooltips_select(id, headline, sub_id) { var links, i, hold; @@ -105,6 +108,9 @@ function enable_tooltips_select(id, headline, sub_id) tooltip_mode = 'select'; } +/** +* Prepare elements to replace +*/ function prepare(element) { var tooltip, text, desc, title; @@ -132,14 +138,25 @@ function prepare(element) element.tooltip = tooltip; element.onmouseover = show_tooltip; element.onmouseout = hide_tooltip; + + if (tooltip_mode == 'link') + { + element.onmousemove = locate; + } } +/** +* Show tooltip +*/ function show_tooltip(e) { document.getElementById('_tooltip_container').appendChild(this.tooltip); locate(this); } +/** +* Hide tooltip +*/ function hide_tooltip(e) { var d = document.getElementById('_tooltip_container'); @@ -149,6 +166,9 @@ function hide_tooltip(e) } } +/** +* Set opacity on tooltip element +*/ function set_opacity(element) { element.style.filter = 'alpha(opacity:95)'; @@ -157,6 +177,9 @@ function set_opacity(element) element.style.opacity = '0.95'; } +/** +* Create new element +*/ function create_element(tag, c) { var x = document.createElement(tag); @@ -165,59 +188,64 @@ function create_element(tag, c) return x; } +/** +* Correct positioning of tooltip container +*/ function locate(e) { var posx = 0; var posy = 0; - if (tooltip_mode == 'link') - { - if (e == null) - { - e = window.event; - } + e = e.parentNode; - if (e.pageX || e.pageY) + if (e.offsetParent) + { + for (var posx = 0, posy = 0; e.offsetParent; e = e.offsetParent) { - posx = e.pageX; - posy = e.pageY; - } - else if (e.clientX || e.clientY) - { - if (document.documentElement.scrollTop) - { - posx = e.clientX+document.documentElement.scrollLeft; - posy = e.clientY+document.documentElement.scrollTop; - } - else - { - posx = e.clientX+document.body.scrollLeft; - posy = e.clientY+document.body.scrollTop; - } + posx += e.offsetLeft; + posy += e.offsetTop; } + } + else + { + posx = e.offsetLeft; + posy = e.offsetTop; + } - document.getElementById('_tooltip_container').style.top=(posy+10) + 'px'; + if (tooltip_mode == 'link') + { + document.getElementById('_tooltip_container').style.top=(posy+20) + 'px'; document.getElementById('_tooltip_container').style.left=(posx-20) + 'px'; } else { - e = e.parentNode; + document.getElementById('_tooltip_container').style.top=(posy+30) + 'px'; + document.getElementById('_tooltip_container').style.left=(posx-205) + 'px'; + } - if (e.offsetParent) +/* + if (e == null) + { + e = window.event; + } + + if (e.pageX || e.pageY) + { + posx = e.pageX; + posy = e.pageY; + } + else if (e.clientX || e.clientY) + { + if (document.documentElement.scrollTop) { - for (var posx = 0, posy = 0; e.offsetParent; e = e.offsetParent) - { - posx += e.offsetLeft; - posy += e.offsetTop; - } + posx = e.clientX+document.documentElement.scrollLeft; + posy = e.clientY+document.documentElement.scrollTop; } else { - posx = e.offsetLeft; - posy = e.offsetTop; + posx = e.clientX+document.body.scrollLeft; + posy = e.clientY+document.body.scrollTop; } - - document.getElementById('_tooltip_container').style.top=(posy+30) + 'px'; - document.getElementById('_tooltip_container').style.left=(posx-205) + 'px'; } +*/ } diff --git a/phpBB/adm/style/viewsource.html b/phpBB/adm/style/viewsource.html index 44b1ad6be4..da374037e8 100644 --- a/phpBB/adm/style/viewsource.html +++ b/phpBB/adm/style/viewsource.html @@ -1,19 +1,20 @@ <!-- INCLUDE simple_header.html --> -<div class="panel" style="padding:10px"> +<div class="panel" style="padding: 10px;"> <h1>{FILENAME}</h1> - + <table> - <tbody> - <!-- BEGIN source --> + <tbody> + <!-- BEGIN source --> <tr valign="top"> <td class="sourcenum">{source.LINENUM} </td> <td class="source">{source.LINE}</td> </tr> - <!-- END source --> - </tbody> + <!-- END source --> + </tbody> </table> + </div> <!-- INCLUDE simple_footer.html -->
\ No newline at end of file diff --git a/phpBB/adm/swatch.php b/phpBB/adm/swatch.php index 8f73a93c06..ee3a5455c5 100644 --- a/phpBB/adm/swatch.php +++ b/phpBB/adm/swatch.php @@ -3,7 +3,7 @@ <head> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="imagetoolbar" content="no" /> -<title>phpBB3 Color Swatch</title> +<title>Color Swatch</title> <style type="text/css"> <!-- diff --git a/phpBB/common.php b/phpBB/common.php index 6164b8d714..66a40e022b 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -33,17 +33,17 @@ error_reporting(E_ALL ^ E_NOTICE); function deregister_globals() { $not_unset = array( - 'GLOBALS' => true, - '_GET' => true, - '_POST' => true, - '_COOKIE' => true, - '_REQUEST' => true, - '_SERVER' => true, - '_SESSION' => true, - '_ENV' => true, - '_FILES' => true, - 'phpEx' => true, - 'phpbb_root_path' => true + 'GLOBALS' => true, + '_GET' => true, + '_POST' => true, + '_COOKIE' => true, + '_REQUEST' => true, + '_SERVER' => true, + '_SESSION' => true, + '_ENV' => true, + '_FILES' => true, + 'phpEx' => true, + 'phpbb_root_path' => true ); // Not only will array_merge and array_keys give a warning if @@ -54,8 +54,7 @@ function deregister_globals() $_SESSION = array(); } - // Merge all into one extremely huge array; unset - // this later + // Merge all into one extremely huge array; unset this later $input = array_merge( array_keys($_GET), array_keys($_POST), @@ -107,11 +106,11 @@ if (defined('IN_CRON')) $phpbb_root_path = getcwd() . '/'; } -require($phpbb_root_path . 'config.'.$phpEx); +require($phpbb_root_path . 'config.' . $phpEx); if (!defined('PHPBB_INSTALLED')) { - header('Location: install/index.'.$phpEx); + redirect($phpbb_root_path . 'install/index.' . $phpEx); exit; } diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php index 1f79716657..8e1b8a753f 100644 --- a/phpBB/develop/add_permissions.php +++ b/phpBB/develop/add_permissions.php @@ -78,7 +78,7 @@ $f_permissions = array( 'f_print' => array(1, 0), 'f_ignoreflood' => array(1, 0), 'f_postcount' => array(1, 0), - 'f_moderate'=> array(1, 0), + 'f_noapprove'=> array(1, 0), 'f_report' => array(1, 0), 'f_subscribe' => array(1, 0), ); diff --git a/phpBB/download.php b/phpBB/download.php index c7a1a46a5f..1fe953101a 100644 --- a/phpBB/download.php +++ b/phpBB/download.php @@ -14,7 +14,7 @@ define('IN_PHPBB', true); $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.'.$phpEx); +include($phpbb_root_path . 'common.' . $phpEx); $download_id = request_var('id', 0); @@ -65,7 +65,7 @@ if (!$attachment['in_message']) $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if ($auth->acl_gets('f_download', 'u_download', $row['forum_id'])) + if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id'])) { if ($row['forum_password']) { @@ -138,7 +138,7 @@ if ($download_mode == PHYSICAL_LINK) trigger_error($user->lang['PHYSICAL_DOWNLOAD_NOT_POSSIBLE']); } - redirect($config['upload_path'] . '/' . $attachment['physical_filename']); + redirect($phpbb_root_path . $config['upload_path'] . '/' . $attachment['physical_filename']); exit; } else @@ -234,10 +234,10 @@ function send_file_to_browser($attachment, $upload_dir, $category) // PHP track_errors setting On? if (!empty($php_errormsg)) { - trigger_error('Unable to deliver file.<br />Error was: ' . $php_errormsg, E_USER_WARNING); + trigger_error('Unable to deliver file.<br />Error was: ' . $php_errormsg, E_USER_ERROR); } - trigger_error('Unable to deliver file.', E_USER_WARNING); + trigger_error('Unable to deliver file.', E_USER_ERROR); } flush(); @@ -342,7 +342,6 @@ function download_allowed() } } } - $db->sql_freeresult($result); } diff --git a/phpBB/faq.php b/phpBB/faq.php index d246052eff..a0976e7c67 100644 --- a/phpBB/faq.php +++ b/phpBB/faq.php @@ -14,7 +14,7 @@ define('IN_PHPBB', true); $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.'.$phpEx); +include($phpbb_root_path . 'common.' . $phpEx); // Start session management $user->session_begin(); @@ -29,85 +29,45 @@ switch ($mode) case 'bbcode': $l_title = $user->lang['BBCODE_GUIDE']; $user->add_lang('bbcode', false, true); - break; + break; default: $l_title = $user->lang['FAQ']; $user->add_lang('faq', false, true); - break; + break; } // Pull the array data from the lang pack -$j = 0; -$counter = 0; -$counter_2 = 0; -$help_block = array(); -$help_block_titles = array(); - +$help_blocks = array(); foreach ($user->help as $help_ary) { - if ($help_ary[0] != '--') + if ($help_ary[0] == '--') { - $help_block[$j][$counter]['id'] = $counter_2; - $help_block[$j][$counter]['question'] = $help_ary[0]; - $help_block[$j][$counter]['answer'] = $help_ary[1]; + $template->assign_block_vars('faq_block', array( + 'BLOCK_TITLE' => $help_ary[1]) + ); - $counter++; - $counter_2++; + continue; } - else - { - $j = ($counter != 0) ? $j + 1 : 0; - - $help_block_titles[$j] = $help_ary[1]; - $counter = 0; - } + $template->assign_block_vars('faq_block.faq_row', array( + 'FAQ_QUESTION' => $help_ary[0], + 'FAQ_ANSWER' => $help_ary[1]) + ); } -// // Lets build a page ... $template->assign_vars(array( 'L_FAQ_TITLE' => $l_title, 'L_BACK_TO_TOP' => $user->lang['BACK_TO_TOP']) ); -for ($i = 0, $size = sizeof($help_block); $i < $size; $i++) -{ - if (sizeof($help_block[$i])) - { - $template->assign_block_vars('faq_block', array( - 'BLOCK_TITLE' => $help_block_titles[$i]) - ); - - $template->assign_block_vars('faq_block_link', array( - 'BLOCK_TITLE' => $help_block_titles[$i]) - ); - - for ($j = 0, $_size = sizeof($help_block[$i]); $j < $_size; $j++) - { - $template->assign_block_vars('faq_block.faq_row', array( - 'FAQ_QUESTION' => $help_block[$i][$j]['question'], - 'FAQ_ANSWER' => $help_block[$i][$j]['answer'], - - 'U_FAQ_ID' => 'f'.$help_block[$i][$j]['id']) - ); - - $template->assign_block_vars('faq_block_link.faq_row_link', array( - 'FAQ_LINK' => $help_block[$i][$j]['question'], - - 'U_FAQ_LINK' => '#f' . $help_block[$i][$j]['id']) - ); - } - } -} - page_header($l_title); $template->set_filenames(array( 'body' => 'faq_body.html') ); -make_jumpbox('viewforum.'.$phpEx); +make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); page_footer(); diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index cbee63aaf7..976c2b2257 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -19,7 +19,7 @@ class acp_attachments function main($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $SID, $phpbb_admin_path, $phpbb_root_path, $phpEx; + global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx; $user->add_lang(array('posting', 'viewtopic', 'acp/attachments')); @@ -684,7 +684,7 @@ class acp_attachments 'S_NO_IMAGE' => $no_image_select, 'S_FORUM_IDS' => (sizeof($forum_ids)) ? true : false, - 'U_EXTENSIONS' => $phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=extensions", + 'U_EXTENSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=extensions"), 'L_LEGEND' => $user->lang[strtoupper($action) . '_EXTENSION_GROUP'], ) @@ -1108,7 +1108,7 @@ class acp_attachments // Submit Attachment $attach_sql = $message_parser->attachment_data; - $db->sql_transaction(); + $db->sql_transaction('begin'); $sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $attach_sql); $db->sql_query($sql); diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php index 778809d1b0..834fdd19a8 100644 --- a/phpBB/includes/acp/acp_ban.php +++ b/phpBB/includes/acp/acp_ban.php @@ -18,7 +18,7 @@ class acp_ban function main($id, $mode) { global $config, $db, $user, $auth, $template, $cache; - global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; include($phpbb_root_path . 'includes/functions_user.' . $phpEx); @@ -91,7 +91,7 @@ class acp_ban 'S_USERNAME_BAN' => ($mode == 'user') ? true : false, 'U_ACTION' => $this->u_action, - 'U_FIND_USER' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=acp_ban&field=ban", + 'U_FIND_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_ban&field=ban'), ) ); } diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 4f7f4b191b..4dfcaf7e8a 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -18,7 +18,7 @@ class acp_bbcodes function main($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/posting'); diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 60f6706d75..60d3631673 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -20,7 +20,7 @@ class acp_board function main($id, $mode) { global $db, $user, $auth, $template; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/board'); @@ -61,6 +61,7 @@ class acp_board '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), @@ -112,9 +113,7 @@ class acp_board 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false), 'auth_download_pm' => array('lang' => 'ALLOW_DOWNLOAD_PM', 'type' => 'radio:yes_no', 'explain' => false), 'allow_sig_pm' => array('lang' => 'ALLOW_SIG_PM', 'type' => 'radio:yes_no', 'explain' => false), -// 'auth_quote_pm' => array('lang' => 'ALLOW_QUOTE_PM', 'type' => 'radio:yes_no', 'explain' => false), 'print_pm' => array('lang' => 'ALLOW_PRINT_PM', 'type' => 'radio:yes_no', 'explain' => false), -// 'email_pm' => array('lang' => 'ALLOW_EMAIL_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), @@ -263,6 +262,7 @@ class acp_board '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_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), @@ -323,6 +323,7 @@ class acp_board '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), ) ); break; @@ -339,7 +340,8 @@ class acp_board '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), + '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), diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php index 070ac75bea..407bf554a5 100644 --- a/phpBB/includes/acp/acp_bots.php +++ b/phpBB/includes/acp/acp_bots.php @@ -18,7 +18,7 @@ class acp_bots function main($id, $mode) { global $config, $db, $user, $auth, $template, $cache; - global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; $action = request_var('action', ''); $submit = (isset($_POST['submit'])) ? true : false; @@ -86,7 +86,7 @@ class acp_bots } $db->sql_freeresult($result); - $db->sql_transaction(); + $db->sql_transaction('begin'); $sql = 'DELETE FROM ' . BOTS_TABLE . " WHERE bot_id $sql_id"; @@ -142,7 +142,7 @@ class acp_bots if (!sizeof($error)) { - $db->sql_transaction(); + $db->sql_transaction('begin'); // New bot? Create a new user and group entry if ($action == 'add') diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 7502cbe8be..fc38a5ed9d 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -18,7 +18,7 @@ class acp_database function main($id, $mode) { global $db, $user, $auth, $template, $table_prefix; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/database'); diff --git a/phpBB/includes/acp/acp_disallow.php b/phpBB/includes/acp/acp_disallow.php index 53fde19048..3065b8cceb 100644 --- a/phpBB/includes/acp/acp_disallow.php +++ b/phpBB/includes/acp/acp_disallow.php @@ -18,7 +18,7 @@ class acp_disallow function main($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; include($phpbb_root_path . 'includes/functions_user.' . $phpEx); diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index 86ddd5ce56..2109011014 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -18,7 +18,7 @@ class acp_email function main($id, $mode) { global $config, $db, $user, $auth, $template, $cache; - global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; $user->add_lang('acp/email'); $this->tpl_name = 'acp_email'; @@ -188,7 +188,7 @@ class acp_email } else { - $message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . $phpbb_admin_path . "index.$phpEx$SID&i=logs&mode=critical" . '">', '</a>'); + $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)); } @@ -215,7 +215,7 @@ class acp_email 'U_ACTION' => $this->u_action, 'S_GROUP_OPTIONS' => $select_list, 'USERNAMES' => $usernames, - 'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=acp_email&field=usernames", + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_email&field=usernames'), '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 a9e9e727ce..d8d9aadeec 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -15,11 +15,11 @@ class acp_forums { var $u_action; var $parent_id = 0; - + function main($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx, $SID; + global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx; $user->add_lang('acp/forums'); $this->tpl_name = 'acp_forums'; @@ -136,7 +136,7 @@ class acp_forums } $errors = $this->update_forum_data($forum_data); - + if (!sizeof($errors)) { $forum_perm_from = request_var('forum_perm_from', 0); @@ -147,7 +147,6 @@ class acp_forums // From the mysql documentation: // Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14. // Due to this we stay on the safe side if we do the insertion "the manual way" - // Copy permisisons from/to the acl users table (only forum_id gets changed) $sql = 'SELECT user_id, auth_option_id, auth_role_id, auth_setting @@ -225,12 +224,12 @@ class acp_forums // Redirect to permissions $message = ($action == 'add') ? $user->lang['FORUM_CREATED'] : $user->lang['FORUM_UPDATED']; - $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . $phpbb_admin_path . "index.$phpEx$SID&i=permissions" . $acl_url . '">', '</a>'); + $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url) . '">', '</a>'); // redirect directly to permission settings screen if ($action == 'add' && !$forum_perm_from) { - meta_refresh(4, $phpbb_admin_path . "index.$phpEx$SID&i=permissions" . $acl_url); + meta_refresh(4, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url)); } trigger_error($message . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); @@ -244,12 +243,12 @@ class acp_forums { case 'move_up': case 'move_down': - + if (!$forum_id) { trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); } - + $sql = 'SELECT parent_id, left_id, right_id FROM ' . FORUMS_TABLE . " WHERE forum_id = $forum_id"; @@ -519,7 +518,7 @@ class acp_forums $db->sql_freeresult($result); $s_show_display_on_index = false; - + if ($forum_data['parent_id'] > 0) { // if this forum is a subforum put the "display on index" checkbox @@ -603,7 +602,7 @@ class acp_forums { trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); } - + $forum_data = $this->get_forum_info($forum_id); $subforums_id = array(); @@ -706,12 +705,13 @@ class acp_forums default: $folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" width="46" height="25" alt="' . $user->lang['SUBFORUM'] . '" />' : '<img src="images/icon_folder.gif" width="46" height="25" alt="' . $user->lang['FOLDER'] . '" />'; + break; } } $url = $this->u_action . "&parent_id=$this->parent_id&f={$row['forum_id']}"; - - $forum_title = ($forum_type != FORUM_LINK) ? "<a href=\"admin_forums.$phpEx$SID&parent_id=" . $row['forum_id'] . '">' : ''; + + $forum_title = ($forum_type != FORUM_LINK) ? '<a href="' . $this->u_action . '&parent_id=' . $row['forum_id'] . '">' : ''; $forum_title .= $row['forum_name']; $forum_title .= ($forum_type != FORUM_LINK) ? '</a>' : ''; @@ -721,17 +721,16 @@ class acp_forums 'FORUM_DESCRIPTION' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield']), 'FORUM_TOPICS' => $row['forum_topics'], 'FORUM_POSTS' => $row['forum_posts'], - + 'S_FORUM_LINK' => ($forum_type == FORUM_LINK) ? true : false, 'S_FORUM_POST' => ($forum_type == FORUM_POST) ? true : false, - + 'U_FORUM' => $this->u_action . '&parent_id=' . $row['forum_id'], 'U_MOVE_UP' => $url . '&action=move_up', 'U_MOVE_DOWN' => $url . '&action=move_down', 'U_EDIT' => $url . '&action=edit', 'U_DELETE' => $url . '&action=delete', - 'U_SYNC' => $url . '&action=sync', - ) + 'U_SYNC' => $url . '&action=sync') ); } while ($row = $db->sql_fetchrow($result)); @@ -759,7 +758,6 @@ class acp_forums 'U_SEL_ACTION' => $this->u_action, 'U_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id) ); - } /** @@ -778,7 +776,7 @@ class acp_forums if (!$row) { - trigger_error("Forum #$forum_id does not exist"); + trigger_error("Forum #$forum_id does not exist", E_USER_ERROR); } return $row; @@ -792,7 +790,7 @@ class acp_forums global $db, $user; $errors = array(); - + if (!$forum_data['forum_name']) { $errors[] = $user->lang['FORUM_NAME_EMPTY']; @@ -853,12 +851,13 @@ class acp_forums FROM ' . FORUMS_TABLE . ' WHERE forum_id = ' . $forum_data['parent_id']; $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['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&' . $this->parent_id)); } - $db->sql_freeresult($result); $sql = 'UPDATE ' . FORUMS_TABLE . ' SET left_id = left_id + 2, right_id = right_id + 2 @@ -878,7 +877,6 @@ class acp_forums $sql = 'SELECT MAX(right_id) AS right_id FROM ' . FORUMS_TABLE; $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -890,7 +888,7 @@ class acp_forums $db->sql_query($sql); $forum_data['forum_id'] = $db->sql_nextid(); - + add_log('admin', 'LOG_FORUM_ADD', $forum_data['forum_name']); } else @@ -929,19 +927,19 @@ class acp_forums { return $errors; } - + if ($row['parent_id'] != $forum_data['parent_id']) { $errors = $this->move_forum($forum_data['forum_id'], $forum_data['parent_id']); } - + if (sizeof($errors)) { return $errors; } unset($forum_data['type_action']); - + if ($row['forum_name'] != $forum_data['forum_name']) { // the forum name has changed, clear the parents list of child forums @@ -1020,7 +1018,7 @@ class acp_forums // Resync moved branch $to_data['right_id'] += $diff; - + if ($to_data['right_id'] > $from_data['right_id']) { $diff = '+ ' . ($to_data['right_id'] - $from_data['right_id'] - 1); @@ -1036,7 +1034,6 @@ class acp_forums FROM ' . FORUMS_TABLE . ' WHERE forum_id NOT IN (' . implode(', ', $moved_ids) . ')'; $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -1057,7 +1054,7 @@ class acp_forums global $db; $table_ary = array(LOG_TABLE, POSTS_TABLE, TOPICS_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE); - + foreach ($table_ary as $table) { $sql = "UPDATE $table @@ -1078,8 +1075,7 @@ class acp_forums if ($sync) { - // Delete ghost topics that link back to the same forum - // then resync counters + // Delete ghost topics that link back to the same forum then resync counters sync('topic_moved'); sync('forum', 'forum_id', $to_id); } @@ -1118,16 +1114,17 @@ class acp_forums FROM ' . FORUMS_TABLE . ' WHERE forum_id = ' . $posts_to_id; $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!$row = $db->sql_fetchrow($result)) + if (!$row) { $errors[] = $user->lang['NO_FORUM']; } else { $posts_to_name = $row['forum_name']; - - $errors = array_merge($errors, $this->move_forum_content($forum_id, $subforums_to_id)); + $errors = array_merge($errors, $this->move_forum_content($forum_id, $posts_to_id)); } } } @@ -1175,8 +1172,10 @@ class acp_forums FROM ' . FORUMS_TABLE . ' WHERE forum_id = ' . $subforums_to_id; $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!$row = $db->sql_fetchrow($result)) + if (!$row) { $errors[] = $user->lang['NO_FORUM']; } @@ -1238,12 +1237,16 @@ class acp_forums // Delete forum ids from extension groups table $sql = 'SELECT group_id, allowed_forums - FROM ' . EXTENSION_GROUPS_TABLE . " - WHERE allowed_forums <> ''"; + FROM ' . EXTENSION_GROUPS_TABLE; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { + if (!$row['allowed_forums']) + { + continue; + } + $allowed_forums = unserialize(trim($row['allowed_forums'])); $allowed_forums = array_diff($allowed_forums, $forum_ids); @@ -1252,6 +1255,8 @@ class acp_forums WHERE group_id = {$row['group_id']}"; $db->sql_query($sql); } + $db->sql_freeresult($result); + $cache->destroy('_extensions'); $log_action = implode('_', array($log_action_posts, $log_action_forums)); @@ -1261,19 +1266,19 @@ class acp_forums case 'MOVE_POSTS_MOVE_FORUMS': add_log('admin', 'LOG_FORUM_DEL_MOVE_POSTS_MOVE_FORUMS', $posts_to_name, $subforums_to_name, $forum_data['forum_name']); break; - + case 'MOVE_POSTS_FORUMS': add_log('admin', 'LOG_FORUM_DEL_MOVE_POSTS_FORUMS', $posts_to_name, $forum_data['forum_name']); break; - + case 'POSTS_MOVE_FORUMS': add_log('admin', 'LOG_FORUM_DEL_POSTS_MOVE_FORUMS', $subforums_to_name, $forum_data['forum_name']); break; - + case '_MOVE_FORUMS': add_log('admin', 'LOG_FORUM_DEL_MOVE_FORUMS', $subforums_to_name, $forum_data['forum_name']); break; - + case 'MOVE_POSTS_': add_log('admin', 'LOG_FORUM_DEL_MOVE_POSTS', $posts_to_name, $forum_data['forum_name']); break; @@ -1281,11 +1286,11 @@ class acp_forums case 'POSTS_FORUMS': add_log('admin', 'LOG_FORUM_DEL_POSTS_FORUMS', $forum_data['forum_name']); break; - + case '_FORUMS': add_log('admin', 'LOG_FORUM_DEL_FORUMS', $forum_data['forum_name']); break; - + case 'POSTS_': add_log('admin', 'LOG_FORUM_DEL_POSTS', $forum_data['forum_name']); break; @@ -1316,14 +1321,14 @@ class acp_forums AND a.in_message = 0 AND a.topic_id = p.topic_id"; $result = $db->sql_query($sql); - + $topic_ids = array(); while ($row = $db->sql_fetchrow($result)) { $topic_ids[] = $row['topic_id']; } $db->sql_freeresult($result); - + delete_attachments('topic', $topic_ids, false); switch (SQL_LAYER) @@ -1367,7 +1372,7 @@ class acp_forums REPORTS_TABLE, WARNINGS_TABLE, ), - + 'topic_id' => array( BOOKMARKS_TABLE, TOPICS_WATCH_TABLE, @@ -1380,7 +1385,7 @@ class acp_forums foreach ($tables_ary as $field => $tables) { $start = 0; - + do { $sql = "SELECT $field diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 9a0aa1409d..a216a4d24f 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -18,7 +18,7 @@ class acp_groups function main($id, $mode) { global $config, $db, $user, $auth, $template, $cache; - global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads; $user->add_lang('acp/groups'); $this->tpl_name = 'acp_groups'; @@ -473,7 +473,7 @@ class acp_groups switch ($back_link) { case 'acp_users_groups': - $u_back = $phpbb_admin_path . "index.$phpEx$SID&i=users&mode=groups&u=" . request_var('u', 0); + $u_back = append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=groups&u=' . request_var('u', 0)); break; default: @@ -523,8 +523,8 @@ class acp_groups 'GROUP_HIDDEN' => $type_hidden, 'U_BACK' => $u_back, - 'U_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&form=settings&name=group_colour", - 'UA_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&form=settings&name=group_colour", + 'U_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=settings&name=group_colour'), + 'UA_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=settings&name=group_colour', false), 'U_ACTION' => "{$this->u_action}&action=$action&g=$group_id", 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)), ) @@ -607,13 +607,13 @@ class acp_groups 'U_ACTION' => $this->u_action . "&g=$group_id", 'U_BACK' => $this->u_action, - 'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=list&field=usernames") + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=list&field=usernames')) ); foreach ($group_data['leader'] as $row) { $template->assign_block_vars('leader', array( - 'U_USER_EDIT' => $phpbb_admin_path . "index.$phpEx$SID&i=users&action=edit&u={$row['user_id']}", + 'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&action=edit&u={$row['user_id']}"), 'USERNAME' => $row['username'], 'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false, @@ -637,7 +637,7 @@ class acp_groups } $template->assign_block_vars('member', array( - 'U_USER_EDIT' => $phpbb_admin_path . "index.$phpEx$SID&i=users&action=edit&u={$row['user_id']}", + 'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&action=edit&u={$row['user_id']}"), 'USERNAME' => $row['username'], 'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false, diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index 69b37c2427..1f99793462 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -19,7 +19,7 @@ class acp_icons function main($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/posting'); @@ -374,6 +374,7 @@ class acp_icons trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action)); } + // Stripslash here because it got addslashed before... (on export) $img = stripslashes($data[1][0]); $width = stripslashes($data[1][1]); $height = stripslashes($data[1][2]); diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php index c62cede3df..2977859b2f 100644 --- a/phpBB/includes/acp/acp_jabber.php +++ b/phpBB/includes/acp/acp_jabber.php @@ -19,7 +19,7 @@ class acp_jabber function main($id, $mode) { global $db, $user, $auth, $template; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/board'); diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 3a6ee380ac..2fbe2aec2f 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -24,7 +24,7 @@ class acp_language function main($id, $mode) { global $config, $db, $user, $auth, $template, $cache; - global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; global $safe_mode, $file_uploads; include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); @@ -702,9 +702,9 @@ class acp_language $lang_pack = array( 'iso' => $lang_iso, - 'name' => trim(htmlspecialchars(stripslashes($file[0]))), - 'local_name'=> trim(htmlspecialchars(stripslashes($file[1]))), - 'author' => trim(htmlspecialchars(stripslashes($file[2]))) + 'name' => trim(htmlspecialchars($file[0])), + 'local_name'=> trim(htmlspecialchars($file[1])), + 'author' => trim(htmlspecialchars($file[2])) ); unset($file); diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php index 33a4ce13c2..038a3b0d3c 100644 --- a/phpBB/includes/acp/acp_logs.php +++ b/phpBB/includes/acp/acp_logs.php @@ -18,7 +18,7 @@ class acp_logs function main($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('mcp'); diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 3cc00db36e..292d78973f 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -18,7 +18,7 @@ class acp_main function main($id, $mode) { global $config, $db, $user, $auth, $template; - global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; $action = request_var('action', ''); $mark = (isset($_REQUEST['mark'])) ? implode(', ', request_var('mark', array(0))) : ''; @@ -49,7 +49,7 @@ class acp_main if ($action == 'activate') { - include($phpbb_root_path . 'includes/functions_user.php'); + include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); $mark_ary = explode(', ', $mark); foreach ($mark_ary as $user_id) @@ -424,7 +424,7 @@ class acp_main 'UPLOAD_DIR_SIZE' => $upload_dir_size, 'GZIP_COMPRESSION' => ($config['gzip_compress']) ? $user->lang['ON'] : $user->lang['OFF'], - 'U_ACTION' => "{$phpbb_admin_path}index.$phpEx$SID", + 'U_ACTION' => append_sid("{$phpbb_admin_path}index.$phpEx"), 'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? $s_action_options : '', ) @@ -462,7 +462,7 @@ class acp_main 'DATE' => $user->format_date($row['user_regdate']), 'USER_ID' => $row['user_id'], 'USERNAME' => $row['username'], - 'U_USER_ADMIN' => "{$phpbb_admin_path}index.$phpEx$SID&i=users&mode=overview&u={$row['user_id']}") + 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&mode=overview&u={$row['user_id']}")) ); } diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index ebb1245c22..f5c7d5fd55 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -29,7 +29,7 @@ class acp_modules function main($id, $mode) { global $db, $user, $auth, $template; - global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx, $SID; + global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx; // Set a global define for modules we might include (the author is able to prevent executing of code with this) define('MODULE_INCLUDE', true); diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php index c161f8c0f2..8022498f67 100644 --- a/phpBB/includes/acp/acp_permission_roles.php +++ b/phpBB/includes/acp/acp_permission_roles.php @@ -18,7 +18,7 @@ class acp_permission_roles function main($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx); diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 8aa17017cc..79f55a7dd2 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -19,7 +19,7 @@ class acp_permissions function main($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx); @@ -304,7 +304,7 @@ class acp_permissions $template->assign_vars(array( 'S_SELECT_USER' => true, - 'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=select_victim&field=username") + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_victim&field=username')) ); break; @@ -435,7 +435,7 @@ class acp_permissions 'S_DEFINED_USER_OPTIONS' => $s_defined_user_options, 'S_DEFINED_GROUP_OPTIONS' => $s_defined_group_options, 'S_ADD_GROUP_OPTIONS' => group_select_options(false, $defined_group_ids), - 'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=add_user&field=username") + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username')) ); break; diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php index 55f1227c1d..44917bd8fc 100644 --- a/phpBB/includes/acp/acp_php_info.php +++ b/phpBB/includes/acp/acp_php_info.php @@ -18,7 +18,7 @@ class acp_php_info function main($id, $mode) { global $db, $user, $auth, $template; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; if ($mode != 'info') { diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 9ee89fcf35..4822e9158d 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -18,7 +18,7 @@ class acp_profile function main($id, $mode) { global $config, $db, $user, $auth, $template, $cache; - global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); include($phpbb_root_path . 'includes/functions_user.' . $phpEx); @@ -1386,7 +1386,7 @@ class acp_profile } } - $db->sql_transaction(); + $db->sql_transaction('begin'); if ($action == 'create') { diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 2214a8c9bd..cb9cf02573 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -17,7 +17,7 @@ class acp_prune function main($id, $mode) { - global $user, $phpEx, $SID, $phpbb_admin_path, $phpbb_root_path; + global $user, $phpEx, $phpbb_admin_path, $phpbb_root_path; $user->add_lang('acp/prune'); include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); @@ -44,7 +44,7 @@ class acp_prune function prune_forums($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $forum_id = request_var('f', array(0)); $submit = (isset($_POST['submit'])) ? true : false; @@ -186,7 +186,7 @@ class acp_prune function prune_users($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('memberlist'); @@ -359,7 +359,7 @@ class acp_prune 'S_JOINED_OPTIONS' => $s_find_join_time, 'S_ACTIVE_OPTIONS' => $s_find_active_time, 'S_COUNT_OPTIONS' => $s_find_count, - 'U_FIND_USER' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=acp_prune&field=users") + 'U_FIND_USER' => append_sid($phpbb_root_path . "memberlist.$phpEx", 'mode=searchuser&form=acp_prune&field=users')) ); } diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php index 3978ed25ec..f5ec4bae30 100644 --- a/phpBB/includes/acp/acp_ranks.php +++ b/phpBB/includes/acp/acp_ranks.php @@ -18,7 +18,7 @@ class acp_ranks function main($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/posting'); diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php index 02e06e87f2..0867158eff 100644 --- a/phpBB/includes/acp/acp_reasons.php +++ b/phpBB/includes/acp/acp_reasons.php @@ -18,7 +18,7 @@ class acp_reasons function main($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang(array('mcp', 'acp/posting')); diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php index 8a601467dd..cafb3c795d 100644 --- a/phpBB/includes/acp/acp_search.php +++ b/phpBB/includes/acp/acp_search.php @@ -40,7 +40,7 @@ class acp_search function settings($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $submit = (isset($_POST['submit'])) ? true : false; @@ -148,7 +148,7 @@ class acp_search { add_log('admin', 'LOG_CONFIG_SEARCH'); } - $extra_message = '<br />' . $user->lang['SWITCHED_SEARCH_BACKEND'] . "<br /><a href=\"{$phpbb_admin_path}index.$phpEx$SID&i=search&mode=index\">» " . $user->lang['GO_TO_SEARCH_INDEX'] . '</a>'; + $extra_message = '<br />' . $user->lang['SWITCHED_SEARCH_BACKEND'] . '<br /><a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=search&mode=index') . '">» ' . $user->lang['GO_TO_SEARCH_INDEX'] . '</a>'; } else { @@ -197,7 +197,7 @@ class acp_search function index($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; if (isset($_REQUEST['action']) && is_array($_REQUEST['action'])) { @@ -258,7 +258,7 @@ class acp_search if (method_exists($this->search, 'delete_index')) { // pass a reference to myself so the $search object can make use of save_state() and attributes - if ($error = $this->search->delete_index($this, $phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=$mode&action=delete")) + if ($error = $this->search->delete_index($this, append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=delete", false))) { $this->state = array(''); $this->save_state(); @@ -293,7 +293,7 @@ class acp_search if ($post_counter <= $this->max_post_id) { - redirect($phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=$mode&action=delete", 3); + redirect($this->u_action . '&action=delete', 3); } } @@ -309,7 +309,7 @@ class acp_search if (method_exists($this->search, 'create_index')) { // pass a reference to myself so the $search object can make use of save_state() and attributes - if ($error = $this->search->create_index($this, $phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=$mode&action=create")) + if ($error = $this->search->create_index($this, append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=create", false))) { $this->state = array(''); $this->save_state(); @@ -337,7 +337,7 @@ class acp_search if ($post_counter <= $this->max_post_id) { - redirect($phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=$mode&action=create", 3); + redirect($this->u_action . '&action=create', 3); } } @@ -415,15 +415,15 @@ class acp_search $template->assign_vars(array( 'S_INDEX' => true, 'U_ACTION' => $this->u_action, - 'U_PROGRESS_BAR' => $phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=$mode&action=progress_bar", - 'UA_PROGRESS_BAR' => $phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=$mode&action=progress_bar") + 'U_PROGRESS_BAR' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=progress_bar"), + 'UA_PROGRESS_BAR' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=progress_bar", false)) ); if (isset($this->state[1])) { $template->assign_vars(array( 'S_CONTINUE_INDEXING' => $this->state[1], - 'U_CONTINUE_INDEXING' => $phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=$mode&action=" . $this->state[1], + 'U_CONTINUE_INDEXING' => $this->u_action . '&action=' . $this->state[1], 'L_CONTINUE' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING'] : $user->lang['CONTINUE_INDEX_DELETING'], 'L_CONTINUE_EXPLAIN' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING_EXPLAIN'] : $user->lang['CONTINUE_INDEX_DELETING_EXPLAIN']) ); diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index d0257dfed7..548cb743d8 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -24,7 +24,7 @@ class acp_styles function main($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; // Hardcoded template bitfield to add for new templates define('TEMPLATE_BITFIELD', 6921); @@ -332,7 +332,7 @@ pagination_sep = \'{PAGINATION_SEP}\' */ function frontend($mode, $options) { - global $user, $template, $db, $config, $phpbb_root_path, $phpEx, $SID; + global $user, $template, $db, $config, $phpbb_root_path, $phpEx; $sql_from = ''; $style_count = array(); @@ -414,7 +414,7 @@ pagination_sep = \'{PAGINATION_SEP}\' 'U_STYLE_ACT_DEACT' => $this->u_action . '&action=' . $stylevis . '&id=' . $row[$mode . '_id'], 'L_STYLE_ACT_DEACT' => $user->lang['STYLE_' . strtoupper($stylevis)], 'S_OPTIONS' => implode(' | ', $s_options), - 'U_PREVIEW' => ($mode == 'style') ? "{$phpbb_root_path}index.$phpEx$SID&$mode=" . $row[$mode . '_id'] : '', + 'U_PREVIEW' => ($mode == 'style') ? append_sid("{$phpbb_root_path}index.$phpEx", "$mode=" . $row[$mode . '_id']) : '', 'NAME' => $row[$mode . '_name'], 'STYLE_COUNT' => ($mode == 'style' && isset($style_count[$row['style_id']])) ? $style_count[$row['style_id']] : 0, @@ -477,7 +477,7 @@ pagination_sep = \'{PAGINATION_SEP}\' */ function edit_template($template_id) { - global $phpbb_root_path, $phpEx, $SID, $config, $db, $cache, $user, $template, $safe_mode; + global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template, $safe_mode; $this->page_title = 'EDIT_TEMPLATE'; @@ -687,7 +687,7 @@ pagination_sep = \'{PAGINATION_SEP}\' */ function template_cache($template_id) { - global $phpbb_root_path, $phpEx, $SID, $config, $db, $cache, $user, $template; + global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template; $source = str_replace('/', '.', request_var('source', '')); $file_ary = array_diff(request_var('delete', array('')), array('')); @@ -811,7 +811,7 @@ pagination_sep = \'{PAGINATION_SEP}\' */ function edit_theme($theme_id) { - global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $config, $db, $cache, $user, $template, $safe_mode; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $config, $db, $cache, $user, $template, $safe_mode; $this->page_title = 'EDIT_THEME'; @@ -1214,8 +1214,8 @@ pagination_sep = \'{PAGINATION_SEP}\' $template->assign_vars(array( 'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields), - 'U_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&form=acp_theme&name=", - 'UA_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&form=acp_theme&name=", + 'U_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=acp_theme') . '&name=', + 'UA_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=acp_theme', false) . '&name=', 'CSS_DATA' => htmlspecialchars($css_data)) ); @@ -2350,7 +2350,7 @@ pagination_sep = \'{PAGINATION_SEP}\' */ function install($mode) { - global $phpbb_root_path, $phpEx, $SID, $config, $db, $cache, $user, $template; + global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template; $l_type = strtoupper($mode); @@ -2498,7 +2498,7 @@ pagination_sep = \'{PAGINATION_SEP}\' */ function add($mode) { - global $phpbb_root_path, $phpEx, $SID, $config, $db, $cache, $user, $template; + global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template; $l_type = strtoupper($mode); $element_ary = array('template' => STYLES_TPL_TABLE, 'theme' => STYLES_CSS_TABLE, 'imageset' => STYLES_IMAGE_TABLE); diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 071996d192..8621f30324 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -18,7 +18,7 @@ class acp_users function main($id, $mode) { global $config, $db, $user, $auth, $template, $cache; - global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads; $user->add_lang(array('posting', 'ucp', 'acp/users')); $this->tpl_name = 'acp_users'; @@ -68,7 +68,7 @@ class acp_users 'ANONYMOUS_USER_ID' => ANONYMOUS, 'S_SELECT_USER' => true, - 'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=select_user&field=username", + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_user&field=username'), ) ); @@ -125,7 +125,7 @@ class acp_users $template->assign_vars(array( 'U_BACK' => $this->u_action, - 'U_MODE_SELECT' => "{$phpbb_admin_path}index.$phpEx$SID&i=$id&u=$user_id", + 'U_MODE_SELECT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&u=$user_id"), 'U_ACTION' => $this->u_action . '&u=' . $user_id, 'S_FORM_OPTIONS' => $s_form_options) ); @@ -729,7 +729,7 @@ class acp_users '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']}", - 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? "{$phpbb_root_path}ucp.$phpEx$SID&mode=switch_perm&u={$user_row['user_id']}" : '', + 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_row['user_id']}") : '', 'USER' => $user_row['username'], 'USER_REGISTERED' => $user->format_date($user_row['user_regdate']), @@ -1494,7 +1494,7 @@ 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="' . $phpbb_root_path . "faq.$phpEx$SID&mode=bbcode" . '" onclick="target=\'_phpbbcode\';">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . "{$phpbb_root_path}faq.$phpEx$SID&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') . '" 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>'), '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'], @@ -1596,11 +1596,11 @@ class acp_users { if ($row['in_message']) { - $view_topic = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&p={$row['post_msg_id']}"; + $view_topic = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&p={$row['post_msg_id']}"); } else { - $view_topic = "{$phpbb_root_path}viewtopic.$phpEx$SID&t={$row['topic_id']}&p={$row['post_msg_id']}#{$row['post_msg_id']}"; + $view_topic = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&p={$row['post_msg_id']}#{$row['post_msg_id']}"); } $template->assign_block_vars('attach', array( @@ -1618,7 +1618,7 @@ class acp_users 'S_IN_MESSAGE' => $row['in_message'], - 'U_DOWNLOAD' => $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $row['attach_id'], + 'U_DOWNLOAD' => append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $row['attach_id']), 'U_VIEW_TOPIC' => $view_topic) ); } @@ -1757,7 +1757,7 @@ class acp_users foreach ($data_ary as $data) { $template->assign_block_vars('group', array( - 'U_EDIT_GROUP' => "{$phpbb_admin_path}index.$phpEx$SID&i=groups&mode=manage&action=edit&u=$user_id&g=" . $data['group_id'] . '&back_link=acp_users_groups', + 'U_EDIT_GROUP' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=groups&mode=manage&action=edit&u=$user_id&g={$data['group_id']}&back_link=acp_users_groups"), 'U_DEFAULT' => $this->u_action . "&action=default&u=$user_id&g=" . $data['group_id'], 'U_DEMOTE_PROMOTE' => $this->u_action . '&action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&u=$user_id&g=" . $data['group_id'], 'U_DELETE' => $this->u_action . "&action=delete&u=$user_id&g=" . $data['group_id'], @@ -1819,8 +1819,8 @@ class acp_users $template->assign_vars(array( 'S_PERMISSIONS' => true, - 'U_USER_PERMISSIONS' => $phpbb_admin_path . 'index.' . $phpEx . $SID . '&i=permissions&mode=setting_user_global&user_id[]=' . $user_id, - 'U_USER_FORUM_PERMISSIONS' => $phpbb_admin_path . 'index.' . $phpEx . $SID . '&i=permissions&mode=setting_user_local&user_id[]=' . $user_id) + 'U_USER_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx" ,'i=permissions&mode=setting_user_global&user_id[]=' . $user_id), + 'U_USER_FORUM_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions&mode=setting_user_local&user_id[]=' . $user_id)) ); break; diff --git a/phpBB/includes/acp/acp_words.php b/phpBB/includes/acp/acp_words.php index ef75eedcba..155443f04b 100644 --- a/phpBB/includes/acp/acp_words.php +++ b/phpBB/includes/acp/acp_words.php @@ -19,7 +19,7 @@ class acp_words function main($id, $mode) { global $db, $user, $auth, $template, $cache; - global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/posting'); diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 7007c05104..3da19f5c0b 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -271,7 +271,7 @@ class auth_admin extends auth */ function display_mask($mode, $permission_type, &$hold_ary, $user_mode = 'user', $local = false, $group_display = true) { - global $template, $user, $db, $phpbb_root_path, $phpEx, $SID; + global $template, $user, $db, $phpbb_root_path, $phpEx; // Define names for template loops, might be able to be set $tpl_pmask = 'p_mask'; @@ -570,7 +570,7 @@ class auth_admin extends auth */ function display_role_mask(&$hold_ary) { - global $db, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID; + global $db, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx; if (!sizeof($hold_ary)) { @@ -610,7 +610,7 @@ class auth_admin extends auth $template->assign_block_vars('role_mask.users', array( 'USER_ID' => $row['user_id'], 'USERNAME' => $row['username'], - 'U_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['user_id']}") + 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u={$row['user_id']}")) ); } $db->sql_freeresult($result); @@ -629,7 +629,7 @@ class auth_admin extends auth $template->assign_block_vars('role_mask.groups', array( 'GROUP_ID' => $row['group_id'], 'GROUP_NAME' => ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'], - 'U_PROFILE' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=group&g={$row['group_id']}") + 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=group&g={$row['group_id']}")) ); } $db->sql_freeresult($result); @@ -1083,7 +1083,7 @@ class auth_admin extends auth */ function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $show_trace = false) { - global $template, $user, $phpbb_admin_path, $phpEx, $SID; + global $template, $user, $phpbb_admin_path, $phpEx; foreach ($category_array as $cat => $cat_array) { @@ -1107,7 +1107,7 @@ class auth_admin extends auth 'FIELD_NAME' => $permission, 'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']', - 'U_TRACE' => ($show_trace) ? "{$phpbb_admin_path}index.$phpEx$SID&i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission" : '', + 'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission") : '', 'PERMISSION' => $user->lang['acl_' . $permission]['lang']) ); diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index d9887d569d..edeb72aee6 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -310,17 +310,17 @@ class auth function acl_cache(&$userdata) { global $db; - + // Empty user_permissions $userdata['user_permissions'] = ''; - + $hold_ary = $this->acl_raw_data($userdata['user_id'], false, false); if (isset($hold_ary[$userdata['user_id']])) { $hold_ary = $hold_ary[$userdata['user_id']]; } - + // Key 0 in $hold_ary are global options, all others are forum_ids // If this user is founder we're going to force fill the admin options ... @@ -508,9 +508,9 @@ class auth ), 'WHERE' => '(ao.auth_option_id = a.auth_option_id OR ao.auth_option_id = r.auth_option_id) - ' . (($sql_user) ? 'AND a.' . $sql_user : '') . " - $sql_forum - $sql_opts", + ' . (($sql_user) ? 'AND a.' . $sql_user : '') . " + $sql_forum + $sql_opts", 'ORDER_BY' => 'a.forum_id, ao.auth_option' )); @@ -541,10 +541,10 @@ class auth ), 'WHERE' => '(ao.auth_option_id = a.auth_option_id OR ao.auth_option_id = r.auth_option_id) - AND a.group_id = ug.group_id - ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . " - $sql_forum - $sql_opts", + AND a.group_id = ug.group_id + ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . " + $sql_forum + $sql_opts", 'ORDER_BY' => 'a.forum_id, ao.auth_option' )); @@ -561,7 +561,7 @@ class auth if ($setting == ACL_NO) { $flag = substr($row['auth_option'], 0, strpos($row['auth_option'], '_') + 1); - + if (isset($hold_ary[$row['user_id']][$row['forum_id']][$flag]) && $hold_ary[$row['user_id']][$row['forum_id']][$flag] == ACL_YES) { unset($hold_ary[$row['user_id']][$row['forum_id']][$flag]); @@ -622,9 +622,9 @@ class auth ), 'WHERE' => '(ao.auth_option_id = a.auth_option_id OR ao.auth_option_id = r.auth_option_id) - ' . (($sql_user) ? 'AND a.' . $sql_user : '') . " - $sql_forum - $sql_opts", + ' . (($sql_user) ? 'AND a.' . $sql_user : '') . " + $sql_forum + $sql_opts", 'ORDER_BY' => 'a.forum_id, ao.auth_option' )); @@ -667,12 +667,12 @@ class auth // Grab group settings... $sql = $db->sql_build_query('SELECT', array( 'SELECT' => 'a.group_id, ao.auth_option, a.forum_id, a.auth_setting, a.auth_role_id, r.auth_setting as role_auth_setting', - + 'FROM' => array( ACL_OPTIONS_TABLE => 'ao', ACL_GROUPS_TABLE => 'a' ), - + 'LEFT_JOIN' => array( array( 'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'), @@ -681,9 +681,9 @@ class auth ), 'WHERE' => '(ao.auth_option_id = a.auth_option_id OR ao.auth_option_id = r.auth_option_id) - ' . (($sql_group) ? 'AND a.' . $sql_group : '') . " - $sql_forum - $sql_opts", + ' . (($sql_group) ? 'AND a.' . $sql_group : '') . " + $sql_forum + $sql_opts", 'ORDER_BY' => 'a.forum_id, ao.auth_option' )); @@ -701,13 +701,12 @@ class auth /** * Authentication plug-ins is largely down to Sergey Kanareykin, our thanks to him. - * @todo replace this with a new system */ function login($username, $password, $autologin = false, $viewonline = 1, $admin = 0) { global $config, $db, $user, $phpbb_root_path, $phpEx; - $method = trim($config['auth_method']); + $method = trim(basename($config['auth_method'])); if (file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx)) { diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 4900486a9e..3ad4bf86ba 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -121,6 +121,48 @@ class dbal } /** + * SQL Transaction + * @private + */ + function sql_transaction($status = 'begin') + { + switch ($status) + { + case 'begin': + // Commit previously opened transaction before opening another transaction + if ($this->transaction) + { + $this->_sql_transaction('commit'); + } + + $result = $this->_sql_transaction('begin'); + $this->transaction = true; + break; + + case 'commit': + $result = $this->_sql_transaction('commit'); + $this->transaction = false; + + if (!$result) + { + $this->_sql_transaction('rollback'); + } + break; + + case 'rollback': + $result = $this->_sql_transaction('rollback'); + $this->transaction = false; + break; + + default: + $result = $this->_sql_transaction($status); + break; + } + + return $result; + } + + /** * Build sql statement from array for insert/update/select statements * * Idea for this from Ikonboard @@ -328,7 +370,7 @@ class dbal */ function sql_report($mode, $query = '') { - global $cache, $starttime, $phpbb_root_path, $user, $SID; + global $cache, $starttime, $phpbb_root_path, $user; if (empty($_GET['explain'])) { diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 61d76e275c..616e064176 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -49,37 +49,27 @@ class dbal_firebird extends dbal } /** - * sql transaction + * SQL Transaction + * @private */ - function sql_transaction($status = 'begin') + function _sql_transaction($status = 'begin') { switch ($status) { case 'begin': - $result = true; - $this->transaction = true; + return true; break; case 'commit': - $result = @ibase_commit(); - $this->transaction = false; - - if (!$result) - { - @ibase_rollback(); - } + return @ibase_commit(); break; case 'rollback': - $result = @ibase_rollback(); - $this->transaction = false; + return @ibase_rollback(); break; - - default: - $result = true; } - return $result; + return true; } /** diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index c700525577..ef6f406edc 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -56,37 +56,27 @@ class dbal_mssql extends dbal } /** - * sql transaction + * SQL Transaction + * @private */ - function sql_transaction($status = 'begin') + function _sql_transaction($status = 'begin') { switch ($status) { case 'begin': - $result = @mssql_query('BEGIN TRANSACTION', $this->db_connect_id); - $this->transaction = true; + return @mssql_query('BEGIN TRANSACTION', $this->db_connect_id); break; case 'commit': - $result = @mssql_query('commit', $this->db_connect_id); - $this->transaction = false; - - if (!$result) - { - @mssql_query('ROLLBACK', $this->db_connect_id); - } + return @mssql_query('commit', $this->db_connect_id); break; case 'rollback': - $result = @mssql_query('ROLLBACK', $this->db_connect_id); - $this->transaction = false; + return @mssql_query('ROLLBACK', $this->db_connect_id); break; - - default: - $result = true; } - return $result; + return true; } /** diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php index 4ae5339a62..0ae0d7e770 100644 --- a/phpBB/includes/db/mssql_odbc.php +++ b/phpBB/includes/db/mssql_odbc.php @@ -50,40 +50,31 @@ class dbal_mssql_odbc extends dbal } /** - * sql transaction + * SQL Transaction + * @private */ - function sql_transaction($status = 'begin') + function _sql_transaction($status = 'begin') { switch ($status) { case 'begin': - $result = @odbc_autocommit($this->db_connect_id, false); - $this->transaction = true; + return @odbc_autocommit($this->db_connect_id, false); break; case 'commit': $result = @odbc_commit($this->db_connect_id); @odbc_autocommit($this->db_connect_id, true); - $this->transaction = false; - - if (!$result) - { - @odbc_rollback($this->db_connect_id); - @odbc_autocommit($this->db_connect_id, true); - } + return $result; break; case 'rollback': $result = @odbc_rollback($this->db_connect_id); @odbc_autocommit($this->db_connect_id, true); - $this->transaction = false; + return $result; break; - - default: - $result = true; } - return $result; + return true; } /** diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index c31132b990..f346663d56 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -56,37 +56,27 @@ class dbal_mysql extends dbal } /** - * sql transaction + * SQL Transaction + * @private */ - function sql_transaction($status = 'begin') + function _sql_transaction($status = 'begin') { switch ($status) { case 'begin': - $result = @mysql_query('BEGIN', $this->db_connect_id); - $this->transaction = true; + return @mysql_query('BEGIN', $this->db_connect_id); break; case 'commit': - $result = @mysql_query('COMMIT', $this->db_connect_id); - $this->transaction = false; - - if (!$result) - { - @mysql_query('ROLLBACK', $this->db_connect_id); - } + return @mysql_query('COMMIT', $this->db_connect_id); break; case 'rollback': - $result = @mysql_query('ROLLBACK', $this->db_connect_id); - $this->transaction = false; + return @mysql_query('ROLLBACK', $this->db_connect_id); break; - - default: - $result = true; } - return $result; + return true; } /** diff --git a/phpBB/includes/db/mysql4.php b/phpBB/includes/db/mysql4.php index 26da6432c1..d98a8069e8 100644 --- a/phpBB/includes/db/mysql4.php +++ b/phpBB/includes/db/mysql4.php @@ -58,37 +58,27 @@ class dbal_mysql4 extends dbal } /** - * sql transaction + * SQL Transaction + * @private */ - function sql_transaction($status = 'begin') + function _sql_transaction($status = 'begin') { switch ($status) { case 'begin': - $result = @mysql_query('BEGIN', $this->db_connect_id); - $this->transaction = true; + return @mysql_query('BEGIN', $this->db_connect_id); break; case 'commit': - $result = @mysql_query('COMMIT', $this->db_connect_id); - $this->transaction = false; - - if (!$result) - { - @mysql_query('ROLLBACK', $this->db_connect_id); - } + return @mysql_query('COMMIT', $this->db_connect_id); break; case 'rollback': - $result = @mysql_query('ROLLBACK', $this->db_connect_id); - $this->transaction = false; + return @mysql_query('ROLLBACK', $this->db_connect_id); break; - - default: - $result = true; } - return $result; + return true; } /** diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index 1a969684a2..cdcdc58d87 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -58,40 +58,31 @@ class dbal_mysqli extends dbal } /** - * sql transaction + * SQL Transaction + * @private */ - function sql_transaction($status = 'begin') + function _sql_transaction($status = 'begin') { switch ($status) { case 'begin': - $result = @mysqli_autocommit($this->db_connect_id, false); - $this->transaction = true; + return @mysqli_autocommit($this->db_connect_id, false); break; case 'commit': $result = @mysqli_commit($this->db_connect_id); @mysqli_autocommit($this->db_connect_id, true); - $this->transaction = false; - - if (!$result) - { - @mysqli_rollback($this->db_connect_id); - @mysqli_autocommit($this->db_connect_id, true); - } + return $result; break; case 'rollback': $result = @mysqli_rollback($this->db_connect_id); @mysqli_autocommit($this->db_connect_id, true); - $this->transaction = false; + return $result; break; - - default: - $result = true; } - return $result; + return true; } /** diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php index bef33b4fd2..05f910e25d 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -48,37 +48,27 @@ class dbal_oracle extends dbal } /** - * sql transaction + * SQL Transaction + * @private */ - function sql_transaction($status = 'begin') + function _sql_transaction($status = 'begin') { switch ($status) { case 'begin': - $result = true; - $this->transaction = true; + return true; break; case 'commit': - $result = @ocicommit($this->db_connect_id); - $this->transaction = false; - - if (!$result) - { - @ocirollback($this->db_connect_id); - } + return @ocicommit($this->db_connect_id); break; case 'rollback': - $result = @ocirollback($this->db_connect_id); - $this->transaction = false; + return @ocirollback($this->db_connect_id); break; - - default: - $result = true; } - return $result; + return true; } /** @@ -355,7 +345,7 @@ class dbal_oracle extends dbal */ function sql_escape($msg) { - return str_replace("'", "''", str_replace('\\', '\\\\', $msg)); + return str_replace("'", "''", $msg); } function _sql_custom_build($stage, $data) diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index fbb113178a..3589f0c552 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -85,37 +85,27 @@ class dbal_postgres extends dbal } /** - * sql transaction + * SQL Transaction + * @private */ - function sql_transaction($status = 'begin') + function _sql_transaction($status = 'begin') { switch ($status) { case 'begin': - $result = @pg_query($this->db_connect_id, 'BEGIN'); - $this->transaction = true; + return @pg_query($this->db_connect_id, 'BEGIN'); break; case 'commit': - $result = @pg_query($this->db_connect_id, 'COMMIT'); - $this->transaction = false; - - if (!$result) - { - @pg_query($this->db_connect_id, 'ROLLBACK'); - } + return @pg_query($this->db_connect_id, 'COMMIT'); break; case 'rollback': - $result = @pg_query($this->db_connect_id, 'ROLLBACK'); - $this->transaction = false; + return @pg_query($this->db_connect_id, 'ROLLBACK'); break; - - default: - $result = true; } - return $result; + return true; } /** diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php index 0bfe9a40ca..be2ec3e400 100644 --- a/phpBB/includes/db/sqlite.php +++ b/phpBB/includes/db/sqlite.php @@ -52,37 +52,27 @@ class dbal_sqlite extends dbal } /** - * sql transaction + * SQL Transaction + * @private */ - function sql_transaction($status = 'begin') + function _sql_transaction($status = 'begin') { switch ($status) { case 'begin': - $result = @sqlite_query('BEGIN', $this->db_connect_id); - $this->transaction = true; + return @sqlite_query('BEGIN', $this->db_connect_id); break; case 'commit': - $result = @sqlite_query('COMMIT', $this->db_connect_id); - $this->transaction = false; - - if (!$result) - { - @sqlite_query('ROLLBACK', $this->db_connect_id); - } + return @sqlite_query('COMMIT', $this->db_connect_id); break; case 'rollback': - $result = @sqlite_query('ROLLBACK', $this->db_connect_id); - $this->transaction = false; + return @sqlite_query('ROLLBACK', $this->db_connect_id); break; - - default: - $result = true; } - return $result; + return true; } /** diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 8d3b0c19ce..a9e3a59673 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -86,7 +86,7 @@ function request_var($var_name, $default, $multibyte = false) { set_var($var, $var, $type, $multibyte); } - + return $var; } @@ -195,7 +195,7 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, */ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false) { - global $config, $auth, $template, $user, $db, $phpEx, $SID; + global $config, $auth, $template, $user, $db, $phpEx; if (!$config['load_jumpbox']) { @@ -364,7 +364,7 @@ function language_select($default = '') $sql = 'SELECT lang_iso, lang_local_name FROM ' . LANG_TABLE . ' ORDER BY lang_english_name'; - $result = $db->sql_query($sql); + $result = $db->sql_query($sql, 600); $lang_options = ''; while ($row = $db->sql_fetchrow($result)) @@ -433,7 +433,7 @@ function tz_select($default = '') function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $user_id = 0) { global $db, $user, $config; - + if ($mode == 'all') { if ($forum_id === false || !sizeof($forum_id)) @@ -447,15 +447,16 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ } else { - $tracking = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array(); + $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : ''; + $tracking_topics = ($tracking_topics) ? unserialize($tracking_topics) : array(); - unset($tracking['tf']); - unset($tracking['t']); - unset($tracking['f']); - $tracking['l'] = base_convert(time() - $config['board_startdate'], 10, 36); + unset($tracking_topics['tf']); + unset($tracking_topics['t']); + unset($tracking_topics['f']); + $tracking_topics['l'] = base_convert(time() - $config['board_startdate'], 10, 36); - $user->set_cookie('track', serialize($tracking), time() + 31536000); - unset($tracking); + $user->set_cookie('track', serialize($tracking_topics), time() + 31536000); + unset($tracking_topics); if ($user->data['is_registered']) { @@ -463,7 +464,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ } } } - + return; } else if ($mode == 'topics') @@ -479,9 +480,10 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ if ($config['load_db_lastread'] && $user->data['is_registered']) { - $db->sql_query('DELETE FROM ' . TOPICS_TRACK_TABLE . " + $sql = 'DELETE FROM ' . TOPICS_TRACK_TABLE . " WHERE user_id = {$user->data['user_id']} - AND forum_id IN (" . implode(', ', $forum_id) . ")"); + AND forum_id IN (" . implode(', ', $forum_id) . ")"; + $db->sql_query($sql); $sql = 'SELECT forum_id FROM ' . FORUMS_TRACK_TABLE . " @@ -539,7 +541,8 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ } else { - $tracking = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array(); + $tracking = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : ''; + $tracking = ($tracking) ? unserialize($tracking) : array(); foreach ($forum_id as $f_id) { @@ -554,7 +557,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ { unset($tracking['t'][$topic_id36]); } - + if (isset($tracking['f'][$f_id])) { unset($tracking['f'][$f_id]); @@ -603,7 +606,8 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ } else { - $tracking = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array(); + $tracking = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : ''; + $tracking = ($tracking) ? unserialize($tracking) : array(); $topic_id36 = base_convert($topic_id, 10, 36); @@ -611,7 +615,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ { $tracking['tf'][$forum_id][$topic_id36] = true; } - + $post_time = ($post_time) ? $post_time : time(); $tracking['t'][$topic_id36] = base_convert($post_time - $config['board_startdate'], 10, 36); @@ -653,7 +657,6 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ { $tracking['l'] = max($time_keys); } - } $user->set_cookie('track', serialize($tracking), time() + 31536000); @@ -681,7 +684,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ ); $db->sql_query('INSERT INTO ' . TOPICS_POSTED_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); - + $db->sql_return_on_error(false); } @@ -775,7 +778,7 @@ function get_topic_tracking($forum_id, $topic_ids, &$rowset, $forum_mark_time, $ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_list = false) { global $config, $user; - + $last_read = array(); if (!is_array($topic_ids)) @@ -807,7 +810,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis FROM ' . FORUMS_TRACK_TABLE . " WHERE user_id = {$user->data['user_id']} AND forum_id " . - (($global_announce_list && sizeof($global_announce_list)) ? "IN (0, $forum_id)" : "= $forum_id"); + (($global_announce_list && sizeof($global_announce_list)) ? "IN (0, $forum_id)" : "= $forum_id"); $result = $db->sql_query($sql); $mark_time = array(); @@ -838,7 +841,8 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis if (!isset($tracking_topics) || !sizeof($tracking_topics)) { - $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array(); + $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : ''; + $tracking_topics = ($tracking_topics) ? unserialize($tracking_topics) : array(); } if (!$user->data['is_registered']) @@ -908,7 +912,6 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add global $template, $user; $seperator = $user->theme['pagination_sep']; - $total_pages = ceil($num_items/$per_page); if ($total_pages == 1 || !$num_items) @@ -917,7 +920,6 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add } $on_page = floor($start_item / $per_page) + 1; - $page_string = ($on_page == 1) ? '<strong>1</strong>' : '<a href="' . $base_url . '">1</a>'; if ($total_pages > 5) @@ -927,7 +929,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add $page_string .= ($start_cnt > 1) ? ' ... ' : $seperator; - for($i = $start_cnt + 1; $i < $end_cnt; $i++) + for ($i = $start_cnt + 1; $i < $end_cnt; $i++) { $page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "&start=" . (($i - 1) * $per_page) . '">' . $i . '</a>'; if ($i < $end_cnt - 1) @@ -942,7 +944,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add { $page_string .= $seperator; - for($i = 2; $i < $total_pages; $i++) + for ($i = 2; $i < $total_pages; $i++) { $page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "&start=" . (($i - 1) * $per_page) . '">' . $i . '</a>'; if ($i < $total_pages) @@ -972,7 +974,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add $tpl_prefix . 'PER_PAGE' => $per_page, $tpl_prefix . 'PREVIOUS_PAGE' => ($on_page == 1) ? '' : $base_url . '&start=' . (($on_page - 2) * $per_page), - $tpl_prefix . 'NEXT_PAGE' => ($on_page == $total_pages) ? '' : $base_url . '&start=' . ($on_page * $per_page)) + $tpl_prefix . 'NEXT_PAGE' => ($on_page == $total_pages) ? '' : $base_url . '&start=' . ($on_page * $per_page)) ); return $page_string; @@ -997,6 +999,68 @@ function on_page($num_items, $per_page, $start) // Server functions (building urls, redirecting...) /** +* Append session id to url +* +* @param string $url The url the session id needs to be appended to (can have params) +* @param mixed $params String or array of additional url parameters +* @param bool $is_amp Is url using & (true) or & (false) +* @param string $session_id Possibility to use a custom session id instead of the global one +* +* Examples: +* <code> +* append_sid("{$phpbb_root_path}viewtopic.$phpEx?t=1&f=2"); +* append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&f=2'); +* append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&f=2', false); +* append_sid("{$phpbb_root_path}viewtopic.$phpEx", array('t' => 1, 'f' => 2)); +* </code> +*/ +function append_sid($url, $params = false, $is_amp = true, $session_id = false) +{ + global $_SID, $_EXTRA_URL; + + // Assign sid if session id is not specified + if ($session_id === false) + { + $session_id = $_SID; + } + + $amp_delim = ($is_amp) ? '&' : '&'; + $url_delim = (strpos($url, '?') === false) ? '?' : $amp_delim; + + // Appending custom url parameter? + $append_url = (!empty($_EXTRA_URL)) ? implode($amp_delim, $_EXTRA_URL) : ''; + + // Use the short variant if possible ;) + if ($params === false) + { + // Append session id + return (!$session_id) ? $url . (($append_url) ? $url_delim . $append_url : '') : $url . (($append_url) ? $url_delim . $append_url . $amp_delim : $url_delim) . 'sid=' . $session_id; + } + + // Build string if parameters are specified as array + if (is_array($params)) + { + $output = array(); + + foreach ($params as $key => $item) + { + if ($item === NULL) + { + continue; + } + + $output[] = $key . '=' . $item; + } + + $params = implode($amp_delim, $output); + } + + // Append session id and parameters (even if they are empty) + // If parameters are empty, the developer can still append his/her parameters without caring about the delimiter + return $url . (($append_url) ? $url_delim . $append_url . $amp_delim : $url_delim) . $params . ((!$session_id) ? '' : $amp_delim . 'sid=' . $session_id); +} + +/** * Generate board url (example: http://www.foo.bar/phpBB) * @param bool $without_script_path if set to true the script path gets not appended (example: http://www.foo.bar) */ @@ -1029,7 +1093,8 @@ function generate_board_url($without_script_path = false) return $url; } - return $url . $user->page['root_script_path']; + // Strip / from the end + return $url . substr($user->page['root_script_path'], 0, -1); } /** @@ -1094,20 +1159,23 @@ function redirect($url) } else { - $url = str_replace($pathinfo['dirname'] . '/', '', $url); + // Get the realpath of dirname + $root_dirs = explode('/', str_replace('\\', '/', realpath('./'))); + $page_dirs = explode('/', str_replace('\\', '/', realpath($pathinfo['dirname']))); + $intersection = array_intersect_assoc($root_dirs, $page_dirs); - // Make sure we point to the correct directory, we transform the relative uri to an absolute uri... - $substract_path = str_replace(realpath($pathinfo['dirname']), '', realpath('./')); - $dir = str_replace($substract_path, '', $user->page['script_path']); + $root_dirs = array_diff_assoc($root_dirs, $intersection); + $page_dirs = array_diff_assoc($page_dirs, $intersection); - if (!$dir) - { - $url = '/' . $url; - } - else + $dir = str_repeat('../', sizeof($root_dirs)) . implode('/', $page_dirs); + + if ($dir && substr($dir, -1, 1) == '/') { - $url = (strpos($dir, '/') !== 0) ? '/' . $dir . '/' . $url : $dir . '/' . $url; + $dir = substr($dir, 0, -1); } + + $url = $dir . '/' . str_replace($pathinfo['dirname'] . '/', '', $url); + $url = generate_board_url() . '/' . $url; } } @@ -1126,24 +1194,36 @@ function redirect($url) } /** -* Re-Apply $SID after page reloads +* Re-Apply session id after page reloads */ function reapply_sid($url) { - global $SID, $phpEx; + global $phpEx, $phpbb_root_path; if ($url === "index.$phpEx") { - return "index.$phpEx$SID"; + return append_sid("index.$phpEx"); + } + else if ($url === "{$phpbb_root_path}index.$phpEx") + { + return append_sid("{$phpbb_root_path}index.$phpEx"); } // Remove previously added sid - if (strpos($url, '?sid=')) + if (strpos($url, '?sid=') !== false) { - $url = preg_replace('/\?sid=[a-z0-9]+(&|&)?/', $SID . '\1', $url); + $url = preg_replace('/(\?)sid=[a-z0-9]+(&|&)?/', '\1', $url); + } + else if (strpos($url, '&sid=') !== false) + { + $url = preg_replace('/&sid=[a-z0-9]+(&)?/', '\1', $url); + } + else if (strpos($url, '&sid=') !== false) + { + $url = preg_replace('/&sid=[a-z0-9]+(&)?/', '\1', $url); } - return (strpos($url, '?') === false) ? $url . $SID : $url . str_replace('?', '&', $SID); + return append_sid($url); } /** @@ -1151,10 +1231,11 @@ function reapply_sid($url) */ function build_url($strip_vars = false) { - global $user, $phpbb_root_path, $SID; + global $user, $phpbb_root_path; // Append SID - $redirect = (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name'] . $SID . (($user->page['query_string']) ? "&{$user->page['query_string']}" : ''); + $redirect = (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name'] . (($user->page['query_string']) ? "?{$user->page['query_string']}" : ''); + $redirect = append_sid($redirect, false, false); // Strip vars... if ($strip_vars !== false && strpos($redirect, '?') !== false) @@ -1218,7 +1299,7 @@ function meta_refresh($time, $url) function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '') { global $user, $template, $db; - global $SID, $phpEx, $phpbb_root_path; + global $phpEx, $phpbb_root_path; if (isset($_POST['cancel'])) { @@ -1287,9 +1368,9 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo return false; } - // re-add $SID / transform & to & for user->page (user->page is always using &) + // re-add sid / transform & to & for user->page (user->page is always using &) $use_page = ($u_action) ? $phpbb_root_path . $u_action : $phpbb_root_path . str_replace('&', '&', $user->page['page']); - $u_action = (strpos($use_page, 'sid=') === false) ? ((strpos($use_page, '?') !== false) ? str_replace('?', $SID . '&', $use_page) : $use_page . '?' . str_replace('?', '', $SID)) : $use_page; + $u_action = reapply_sid($use_page); $u_action .= ((strpos($u_action, '?') === false) ? '?' : '&') . 'confirm_key=' . $confirm_key; $template->assign_vars(array( @@ -1320,7 +1401,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo */ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true) { - global $SID, $db, $user, $template, $auth, $phpEx, $phpbb_root_path, $config; + global $db, $user, $template, $auth, $phpEx, $phpbb_root_path, $config; $err = ''; @@ -1353,13 +1434,12 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa add_log('admin', 'LOG_ADMIN_AUTH_FAIL'); trigger_error('NO_AUTH_ADMIN_USER_DIFFER'); } - + // If authentication is successful we redirect user to previous page $result = $auth->login($username, $password, $autologin, $viewonline, $admin); // If admin authentication and login, we will log if it was a success or not... - // We also break the operation on the first non-success login - it could be argued that the user already - // knows + // We also break the operation on the first non-success login - it could be argued that the user already knows if ($admin) { if ($result['status'] == LOGIN_SUCCESS) @@ -1375,9 +1455,9 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa // The result parameter is always an array, holding the relevant informations... if ($result['status'] == LOGIN_SUCCESS) { - $redirect = request_var('redirect', "index.$phpEx"); + $redirect = request_var('redirect', "{$phpbb_root_path}index.$phpEx"); $message = ($l_success) ? $l_success : $user->lang['LOGIN_REDIRECT']; - $l_redirect = ($admin) ? $user->lang['PROCEED_TO_ACP'] : (($redirect === "index.$phpEx") ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE']); + $l_redirect = ($admin) ? $user->lang['PROCEED_TO_ACP'] : (($redirect === "{$phpbb_root_path}index.$phpEx") ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE']); // append/replace SID (may change during the session for AOL users) $redirect = reapply_sid($redirect); @@ -1408,7 +1488,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa WHERE session_id = '" . $db->sql_escape($user->session_id) . "' AND confirm_type = " . CONFIRM_LOGIN; $db->sql_query($sql); - + // Generate code $code = gen_rand_string(mt_rand(5, 8)); $confirm_id = md5(unique_id($user->ip)); @@ -1424,7 +1504,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa $template->assign_vars(array( 'S_CONFIRM_CODE' => true, 'CONFIRM_ID' => $confirm_id, - 'CONFIRM_IMAGE' => '<img src="' . $phpbb_root_path . 'ucp.' . $phpEx . $SID . '&mode=confirm&id=' . $confirm_id . '&type=' . CONFIRM_LOGIN . '" alt="" title="" />', + '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>'), )); @@ -1457,13 +1537,13 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa 'LOGIN_ERROR' => $err, 'LOGIN_EXPLAIN' => $l_explain, - 'U_SEND_PASSWORD' => ($config['email_enable']) ? "{$phpbb_root_path}ucp.$phpEx$SID&mode=sendpassword" : '', - 'U_RESEND_ACTIVATION' => ($config['require_activation'] != USER_ACTIVATION_NONE && $config['email_enable']) ? "{$phpbb_root_path}ucp.$phpEx$SID&mode=resend_act" : '', - 'U_TERMS_USE' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=terms", - 'U_PRIVACY' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=privacy", + 'U_SEND_PASSWORD' => ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') : '', + 'U_RESEND_ACTIVATION' => ($config['require_activation'] != USER_ACTIVATION_NONE && $config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=resend_act') : '', + 'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'), + 'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'), 'S_DISPLAY_FULL_LOGIN' => ($s_display) ? true : false, - 'S_LOGIN_ACTION' => (!$admin) ? "{$phpbb_root_path}ucp.$phpEx$SID&mode=login" : "index.$phpEx$SID", + '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_HIDDEN_FIELDS' => $s_hidden_fields, 'S_ADMIN_AUTH' => $admin, @@ -1475,7 +1555,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa $template->set_filenames(array( 'body' => 'login_body.html') ); - make_jumpbox("{$phpbb_root_path}viewforum.$phpEx"); + make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); page_footer(); } @@ -2228,7 +2308,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) */ function page_header($page_title = '') { - global $db, $config, $template, $SID, $user, $auth, $phpEx, $phpbb_root_path; + global $db, $config, $template, $SID, $_SID, $user, $auth, $phpEx, $phpbb_root_path; if (defined('HEADER_INC')) { @@ -2249,12 +2329,12 @@ function page_header($page_title = '') // Generate logged in/logged out status if ($user->data['user_id'] != ANONYMOUS) { - $u_login_logout = "{$phpbb_root_path}ucp.$phpEx$SID&mode=logout"; + $u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout'); $l_login_logout = sprintf($user->lang['LOGOUT_USER'], $user->data['username']); } else { - $u_login_logout = "{$phpbb_root_path}ucp.$phpEx$SID&mode=login"; + $u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'); $l_login_logout = $user->lang['LOGIN']; } @@ -2279,10 +2359,11 @@ function page_header($page_title = '') // Get number of online guests if (!$config['load_online_guests']) { - $sql = 'SELECT COUNT(DISTINCT s.session_ip) as num_guests FROM ' . SESSIONS_TABLE . ' s + $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; + $reading_sql; $result = $db->sql_query($sql); $guests_online = (int) $db->sql_fetchfield('num_guests'); $db->sql_freeresult($result); @@ -2323,7 +2404,7 @@ function page_header($page_title = '') if (($row['user_allow_viewonline'] && $row['session_viewonline']) || $auth->acl_get('u_viewonline')) { - $user_online_link = ($row['user_type'] <> USER_IGNORE) ? "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'] . '">' . $user_online_link . '</a>' : $user_online_link; + $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; $online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link; } } @@ -2368,10 +2449,10 @@ function page_header($page_title = '') // Build online listing $vars_online = array( - 'ONLINE'=> array('total_online_users', 'l_t_user_s'), - 'REG' => array('logged_visible_online', 'l_r_user_s'), - 'HIDDEN'=> array('logged_hidden_online', 'l_h_user_s'), - 'GUEST' => array('guests_online', 'l_g_user_s') + 'ONLINE' => array('total_online_users', 'l_t_user_s'), + 'REG' => array('logged_visible_online', 'l_r_user_s'), + 'HIDDEN' => array('logged_hidden_online', 'l_h_user_s'), + 'GUEST' => array('guests_online', 'l_g_user_s') ); foreach ($vars_online as $l_prefix => $var_ary) @@ -2380,15 +2461,15 @@ function page_header($page_title = '') { case 0: ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_ZERO_TOTAL']; - break; + break; case 1: ${$var_ary[1]} = $user->lang[$l_prefix . '_USER_TOTAL']; - break; + break; default: ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_TOTAL']; - break; + break; } } unset($vars_online); @@ -2451,59 +2532,62 @@ function page_header($page_title = '') // Which timezone? $tz = ($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone'])); - // The following assigns all _common_ variables that may be used at any point - // in a template. + // The following assigns all _common_ variables that may be used at any point in a template. $template->assign_vars(array( - 'SITENAME' => $config['sitename'], - 'SITE_DESCRIPTION' => $config['site_desc'], - 'PAGE_TITLE' => $page_title, + 'SITENAME' => $config['sitename'], + 'SITE_DESCRIPTION' => $config['site_desc'], + 'PAGE_TITLE' => $page_title, 'SCRIPT_NAME' => str_replace('.' . $phpEx, '', $user->page['page_name']), - 'LAST_VISIT_DATE' => sprintf($user->lang['YOU_LAST_VISIT'], $s_last_visit), - 'CURRENT_TIME' => sprintf($user->lang['CURRENT_TIME'], $user->format_date(time(), false, true)), - 'TOTAL_USERS_ONLINE' => $l_online_users, - 'LOGGED_IN_USER_LIST' => $online_userlist, - 'RECORD_USERS' => $l_online_record, - 'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text, - 'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread, - 'SID' => $SID, - - 'L_LOGIN_LOGOUT' => $l_login_logout, - 'L_INDEX' => $user->lang['FORUM_INDEX'], + 'LAST_VISIT_DATE' => sprintf($user->lang['YOU_LAST_VISIT'], $s_last_visit), + 'CURRENT_TIME' => sprintf($user->lang['CURRENT_TIME'], $user->format_date(time(), false, true)), + 'TOTAL_USERS_ONLINE' => $l_online_users, + 'LOGGED_IN_USER_LIST' => $online_userlist, + 'RECORD_USERS' => $l_online_record, + 'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text, + 'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread, + + 'SID' => $SID, + '_SID' => $_SID, + 'SESSION_ID' => $user->session_id, + 'ROOT_PATH' => $phpbb_root_path, + + 'L_LOGIN_LOGOUT' => $l_login_logout, + 'L_INDEX' => $user->lang['FORUM_INDEX'], 'L_ONLINE_EXPLAIN' => $l_online_time, - 'U_PRIVATEMSGS' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox", - 'U_RETURN_INBOX' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox", - 'UA_RETURN_INBOX' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox", - 'U_POPUP_PM' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=popup", - 'UA_POPUP_PM' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=popup", - 'U_MEMBERLIST' => "{$phpbb_root_path}memberlist.$phpEx$SID", - 'U_MEMBERSLIST' => "{$phpbb_root_path}memberlist.$phpEx$SID", - 'U_VIEWONLINE' => "{$phpbb_root_path}viewonline.$phpEx$SID", + 'U_PRIVATEMSGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'), + 'U_RETURN_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'), + 'UA_RETURN_INBOX' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox', false), + 'U_POPUP_PM' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=popup'), + 'UA_POPUP_PM' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=popup', false), + 'U_MEMBERLIST' => append_sid("{$phpbb_root_path}memberlist.$phpEx"), + 'U_MEMBERSLIST' => append_sid("{$phpbb_root_path}memberlist.$phpEx"), + 'U_VIEWONLINE' => append_sid("{$phpbb_root_path}viewonline.$phpEx"), 'U_LOGIN_LOGOUT' => $u_login_logout, - 'U_INDEX' => "{$phpbb_root_path}index.$phpEx$SID", - 'U_SEARCH' => "{$phpbb_root_path}search.$phpEx$SID", - 'U_REGISTER' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=register", - 'U_PROFILE' => "{$phpbb_root_path}ucp.$phpEx$SID", - 'U_MODCP' => "{$phpbb_root_path}mcp.$phpEx$SID", - 'U_FAQ' => "{$phpbb_root_path}faq.$phpEx$SID", - 'U_SEARCH_SELF' => "{$phpbb_root_path}search.$phpEx$SID&search_id=egosearch", - 'U_SEARCH_NEW' => "{$phpbb_root_path}search.$phpEx$SID&search_id=newposts", - 'U_SEARCH_UNANSWERED' => "{$phpbb_root_path}search.$phpEx$SID&search_id=unanswered", - 'U_SEARCH_ACTIVE_TOPICS'=> "{$phpbb_root_path}search.$phpEx$SID&search_id=active_topics", - 'U_DELETE_COOKIES' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=delete_cookies", - 'U_TEAM' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=leaders", - 'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? "{$phpbb_root_path}ucp.$phpEx$SID&mode=restore_perm" : '', - - 'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false, + 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"), + 'U_SEARCH' => append_sid("{$phpbb_root_path}search.$phpEx"), + 'U_REGISTER' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'), + 'U_PROFILE' => append_sid("{$phpbb_root_path}ucp.$phpEx"), + 'U_MODCP' => append_sid("{$phpbb_root_path}mcp.$phpEx", false, true, $user->session_id), + 'U_FAQ' => append_sid("{$phpbb_root_path}faq.$phpEx"), + 'U_SEARCH_SELF' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=egosearch'), + 'U_SEARCH_NEW' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=newposts'), + 'U_SEARCH_UNANSWERED' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unanswered'), + 'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics'), + 'U_DELETE_COOKIES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=delete_cookies'), + 'U_TEAM' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=leaders'), + '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_REGISTERED_USER' => $user->data['is_registered'], - 'S_USER_PM_POPUP' => $user->optionget('popuppm'), + 'S_USER_PM_POPUP' => $user->optionget('popuppm'), 'S_USER_LANG' => $user->data['user_lang'], - 'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'], - 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], - 'S_CONTENT_ENCODING' => $user->lang['ENCODING'], - '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_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'], + 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], + 'S_CONTENT_ENCODING' => $user->lang['ENCODING'], + '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_SEARCH' => ($config['load_search']) ? 1 : 0, 'S_DISPLAY_PM' => ($config['allow_privmsg'] && $user->data['is_registered']) ? 1 : 0, @@ -2543,7 +2627,7 @@ function page_header($page_title = '') */ function page_footer() { - global $db, $config, $template, $SID, $user, $auth, $cache, $messenger, $starttime, $phpbb_root_path, $phpEx; + global $db, $config, $template, $user, $auth, $cache, $messenger, $starttime, $phpbb_root_path, $phpEx; // Output page creation time if (defined('DEBUG')) diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index ada8809b74..91cd9cd05c 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -89,7 +89,6 @@ function recalc_btree($sql_id, $sql_table, $module_class = '') FROM $sql_table $sql_where"; $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -185,7 +184,7 @@ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl = } /** -* Generate size select form +* Generate size select options */ function size_select_options($size_compare) { @@ -195,13 +194,13 @@ function size_select_options($size_compare) $size_types = array('b', 'kb', 'mb'); $s_size_options = ''; - + for ($i = 0, $size = sizeof($size_types_text); $i < $size; $i++) { $selected = ($size_compare == $size_types[$i]) ? ' selected="selected"' : ''; $s_size_options .= '<option value="' . $size_types[$i] . '"' . $selected . '>' . $size_types_text[$i] . '</option>'; } - + return $s_size_options; } @@ -229,7 +228,7 @@ function group_select_options($group_id, $exclude_ids = false) $s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '"' . $selected . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>'; } $db->sql_freeresult($result); - + return $s_group_options; } @@ -245,6 +244,7 @@ function get_forum_list($acl_list = 'f_list', $id_only = true, $postable_only = { // This query is identical to the jumpbox one $expire_time = ($no_cache) ? 0 : 120; + $sql = 'SELECT forum_id, parent_id, forum_name, forum_type, left_id, right_id FROM ' . FORUMS_TABLE . ' ORDER BY left_id ASC'; @@ -285,14 +285,15 @@ function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $incl { case 'parents': $condition = 'f1.left_id BETWEEN f2.left_id AND f2.right_id'; - break; + break; case 'children': $condition = 'f2.left_id BETWEEN f1.left_id AND f1.right_id'; - break; + break; default: $condition = 'f2.left_id BETWEEN f1.left_id AND f1.right_id OR f1.left_id BETWEEN f2.left_id AND f2.right_id'; + break; } $rows = array(); @@ -327,12 +328,12 @@ function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png') // Remove initial / if present $rootdir = (substr($rootdir, 0, 1) == '/') ? substr($rootdir, 1) : $rootdir; - // Add closing / if present + // Add closing / if not present $rootdir = ($rootdir && substr($rootdir, -1) != '/') ? $rootdir . '/' : $rootdir; // Remove initial / if present $dir = (substr($dir, 0, 1) == '/') ? substr($dir, 1) : $dir; - // Add closing / if present + // Add closing / if not present $dir = ($dir && substr($dir, -1) != '/') ? $dir . '/' : $dir; if (!is_dir($rootdir . $dir)) @@ -373,7 +374,7 @@ function move_topics($topic_ids, $forum_id, $auto_sync = true) } $forum_ids = array($forum_id); - + if (!is_array($topic_ids)) { $topic_ids = array($topic_ids); @@ -398,9 +399,6 @@ function move_topics($topic_ids, $forum_id, $auto_sync = true) $db->sql_freeresult($result); } - /** - * @todo watch for undesired results on marked topics for moving topics, maybe handle it seperatly to cover cookie tracking - */ $table_ary = array(TOPICS_TABLE, POSTS_TABLE, LOG_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE); foreach ($table_ary as $table) { @@ -486,6 +484,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true) function delete_topics($where_type, $where_ids, $auto_sync = true) { global $db; + $forum_ids = $topic_ids = array(); if (is_array($where_ids)) @@ -521,8 +520,6 @@ function delete_topics($where_type, $where_ids, $auto_sync = true) return $return; } - // TODO: probably some other stuff too - $sql_where = ' IN (' . implode(', ', $topic_ids) . ')'; $db->sql_transaction('begin'); @@ -563,15 +560,17 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = { $where_ids = array_unique($where_ids); } + if (empty($where_ids)) { return false; } + $post_ids = $topic_ids = $forum_ids = array(); $sql = 'SELECT post_id, poster_id, topic_id, forum_id FROM ' . POSTS_TABLE . " - WHERE $where_type " . ((!is_array($where_ids)) ? "= $where_ids" : 'IN (' . implode(', ', $where_ids) . ')'); + WHERE $where_type " . ((!is_array($where_ids)) ? '= ' . (int) $where_ids : 'IN (' . implode(', ', array_map('intval', $where_ids)) . ')'); $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) @@ -581,6 +580,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = $topic_ids[] = $row['topic_id']; $forum_ids[] = $row['forum_id']; } + $db->sql_freeresult($result); if (!sizeof($post_ids)) { @@ -602,7 +602,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = unset($table_ary); // Remove the message from the search index - $search_type = $config['search_type']; + $search_type = basename($config['search_type']); if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) { @@ -643,9 +643,10 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = /** * Delete Attachments -* mode => (post, topic, attach, user) -* ids => (post_ids, topic_ids, attach_ids, user_ids) -* resync => set this to false if you are deleting posts or topics... +* +* @param string $mode can be: post|topic|attach|user +* @param mixed $ids can be: post_ids, topic_ids, attach_ids, user_ids +* @param bool $resync set this to false if you are deleting posts or topics */ function delete_attachments($mode, $ids, $resync = true) { @@ -654,8 +655,13 @@ function delete_attachments($mode, $ids, $resync = true) if (is_array($ids)) { $ids = array_unique($ids); + $ids = array_map('intval', $ids); } - + else + { + $ids = array((int) $ids); + } + if (!sizeof($ids)) { return false; @@ -672,7 +678,7 @@ function delete_attachments($mode, $ids, $resync = true) FROM ' . ATTACHMENTS_TABLE . ' WHERE ' . $sql_id . ' IN (' . implode(', ', $ids) . ')'; $result = $db->sql_query($sql); - + while ($row = $db->sql_fetchrow($result)) { $post_ids[] = $row['post_id']; @@ -689,7 +695,7 @@ function delete_attachments($mode, $ids, $resync = true) WHERE post_msg_id IN (' . implode(', ', $ids) . ') AND in_message = 0'; $result = $db->sql_query($sql); - + while ($row = $db->sql_fetchrow($result)) { $topic_ids[] = $row['topic_id']; @@ -699,14 +705,16 @@ function delete_attachments($mode, $ids, $resync = true) } // Delete attachments - $db->sql_query('DELETE FROM ' . ATTACHMENTS_TABLE . ' WHERE ' . $sql_id . ' IN (' . implode(', ', $ids) . ')'); + $sql = 'DELETE FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $sql_id . ' IN (' . implode(', ', $ids) . ')'; + $db->sql_query($sql); $num_deleted = $db->sql_affectedrows(); if (!$num_deleted) { return 0; } - + // Delete attachments from filesystem $space_removed = $files_removed = 0; foreach ($physical as $file_ary) @@ -744,9 +752,10 @@ function delete_attachments($mode, $ids, $resync = true) { if ($mode == 'post' || $mode == 'topic') { - $db->sql_query('UPDATE ' . POSTS_TABLE . ' + $sql = 'UPDATE ' . POSTS_TABLE . ' SET post_attachment = 0 - WHERE post_id IN (' . implode(', ', $post_ids) . ')'); + WHERE post_id IN (' . implode(', ', $post_ids) . ')'; + $db->sql_query($sql); } if ($mode == 'user' || $mode == 'attach') @@ -754,11 +763,11 @@ function delete_attachments($mode, $ids, $resync = true) $remaining = array(); $sql = 'SELECT post_msg_id - FROM ' . ATTACHMENTS_TABLE . ' - WHERE post_msg_id IN (' . implode(', ', $post_ids) . ') - AND in_message = 0'; + FROM ' . ATTACHMENTS_TABLE . ' + WHERE post_msg_id IN (' . implode(', ', $post_ids) . ') + AND in_message = 0'; $result = $db->sql_query($sql); - + while ($row = $db->sql_fetchrow($result)) { $remaining[] = $row['post_msg_id']; @@ -766,21 +775,23 @@ function delete_attachments($mode, $ids, $resync = true) $db->sql_freeresult($result); $unset_ids = array_diff($post_ids, $remaining); + if (sizeof($unset_ids)) { - $db->sql_query('UPDATE ' . POSTS_TABLE . ' + $sql = 'UPDATE ' . POSTS_TABLE . ' SET post_attachment = 0 - WHERE post_id IN (' . implode(', ', $unset_ids) . ')'); + WHERE post_id IN (' . implode(', ', $unset_ids) . ')'; + $db->sql_query($sql); } $remaining = array(); $sql = 'SELECT post_msg_id - FROM ' . ATTACHMENTS_TABLE . ' - WHERE post_msg_id IN (' . implode(', ', $post_ids) . ') - AND in_message = 1'; + FROM ' . ATTACHMENTS_TABLE . ' + WHERE post_msg_id IN (' . implode(', ', $post_ids) . ') + AND in_message = 1'; $result = $db->sql_query($sql); - + while ($row = $db->sql_fetchrow($result)) { $remaining[] = $row['post_msg_id']; @@ -788,11 +799,13 @@ function delete_attachments($mode, $ids, $resync = true) $db->sql_freeresult($result); $unset_ids = array_diff($post_ids, $remaining); + if (sizeof($unset_ids)) { - $db->sql_query('UPDATE ' . PRIVMSGS_TABLE . ' + $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' SET message_attachment = 0 - WHERE msg_id IN (' . implode(', ', $unset_ids) . ')'); + WHERE msg_id IN (' . implode(', ', $unset_ids) . ')'; + $db->sql_query($sql); } } } @@ -802,9 +815,10 @@ function delete_attachments($mode, $ids, $resync = true) // Update topic indicator if ($mode == 'topic') { - $db->sql_query('UPDATE ' . TOPICS_TABLE . ' + $sql = 'UPDATE ' . TOPICS_TABLE . ' SET topic_attachment = 0 - WHERE topic_id IN (' . implode(', ', $topic_ids) . ')'); + WHERE topic_id IN (' . implode(', ', $topic_ids) . ')'; + $db->sql_query($sql); } if ($mode == 'post' || $mode == 'user' || $mode == 'attach') @@ -812,8 +826,8 @@ function delete_attachments($mode, $ids, $resync = true) $remaining = array(); $sql = 'SELECT topic_id - FROM ' . ATTACHMENTS_TABLE . ' - WHERE topic_id IN (' . implode(', ', $topic_ids) . ')'; + FROM ' . ATTACHMENTS_TABLE . ' + WHERE topic_id IN (' . implode(', ', $topic_ids) . ')'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) @@ -823,11 +837,13 @@ function delete_attachments($mode, $ids, $resync = true) $db->sql_freeresult($result); $unset_ids = array_diff($topic_ids, $remaining); + if (sizeof($unset_ids)) { - $db->sql_query('UPDATE ' . TOPICS_TABLE . ' + $sql = 'UPDATE ' . TOPICS_TABLE . ' SET topic_attachment = 0 - WHERE topic_id IN (' . implode(', ', $unset_ids) . ')'); + WHERE topic_id IN (' . implode(', ', $unset_ids) . ')'; + $db->sql_query($sql); } } } @@ -840,7 +856,7 @@ function delete_attachments($mode, $ids, $resync = true) */ function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = true) { - $where = (is_array($forum_id)) ? 'AND t.forum_id IN (' . implode(', ', $forum_id) . ')' : (($forum_id) ? "AND t.forum_id = $forum_id" : ''); + $where = (is_array($forum_id)) ? 'AND t.forum_id IN (' . implode(', ', array_map('intval', $forum_id)) . ')' : (($forum_id) ? 'AND t.forum_id = ' . (int) $forum_id : ''); switch (SQL_LAYER) { @@ -861,12 +877,13 @@ function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = true) AND t.topic_time < ' . (time() - $max_age) . $where; $result = $db->sql_query($sql); - + $topic_ids = array(); while ($row = $db->sql_fetchrow($result)) { $topic_ids[] = $row['topic_id']; } + $db->sql_freeresult($result); if (sizeof($topic_ids)) { @@ -874,6 +891,7 @@ function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = true) WHERE topic_id IN (' . implode(',', $topic_ids) . ')'; $db->sql_query($sql); } + break; } if ($auto_sync) @@ -965,19 +983,23 @@ function phpbb_unlink($filename, $mode = 'file') /** * All-encompasing sync function * -* Usage: -* sync('topic', 'topic_id', 123); <= resync topic #123 -* sync('topic', 'forum_id', array(2, 3)); <= resync topics from forum #2 and #3 -* sync('topic'); <= resync all topics -* sync('topic', 'range', 'topic_id BETWEEN 1 AND 60'); <= resync a range of topics/forums (only available for 'topic' and 'forum' modes) +* Exaples: +* <code> +* sync('topic', 'topic_id', 123); // resync topic #123 +* sync('topic', 'forum_id', array(2, 3)); // resync topics from forum #2 and #3 +* sync('topic'); // resync all topics +* sync('topic', 'range', 'topic_id BETWEEN 1 AND 60'); // resync a range of topics/forums (only available for 'topic' and 'forum' modes) +* </code> * * Modes: -* - topic_moved Removes topic shadows that would be in the same forum as the topic they link to +* - forum Resync complete forum +* - topic Resync topics +* - topic_moved Removes topic shadows that would be in the same forum as the topic they link to * - topic_approved Resyncs the topic_approved flag according to the status of the first post * - post_reported Resyncs the post_reported flag, relying on actual reports * - topic_reported Resyncs the topic_reported flag, relying on post_reported flags -* - post_attachement Same as post_reported, thanks to a quick Search/Replace -* - topic_attachement Same as topic_reported, thanks to a quick Search/Replace +* - post_attachement Same as post_reported, but with attachment flags +* - topic_attachement Same as topic_reported, but with attachment flags */ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $sync_extra = false) { @@ -986,10 +1008,11 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, if (is_array($where_ids)) { $where_ids = array_unique($where_ids); + $where_ids = array_map('intval', $where_ids); } else if ($where_type != 'range') { - $where_ids = ($where_ids) ? array($where_ids) : array(); + $where_ids = ($where_ids) ? array((int) $where_ids) : array(); } if ($mode == 'forum' || $mode == 'topic') @@ -1028,7 +1051,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, { return; } - + // $where_type contains the field for the where clause (forum_id, topic_id) $where_sql = 'WHERE ' . $mode{0} . ".$where_type IN (" . implode(', ', $where_ids) . ')'; $where_sql_and = $where_sql . "\n\tAND"; @@ -1055,23 +1078,25 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, AND t1.forum_id = t2.forum_id"; $result = $db->sql_query($sql); - if ($row = $db->sql_fetchrow($result)) + $topic_id_ary = array(); + while ($row = $db->sql_fetchrow($result)) { - $topic_id_ary = array(); - do - { - $topic_id_ary[] = $row['topic_id']; - } - while ($row = $db->sql_fetchrow($result)); - - $sql = 'DELETE FROM ' . TOPICS_TABLE . ' - WHERE topic_id IN (' . implode(', ', $topic_id_ary) . ')'; - $db->sql_query($sql); - unset($topic_id_ary); + $topic_id_ary[] = $row['topic_id']; } $db->sql_freeresult($result); + + if (!sizeof($topic_id_ary)) + { + return; + } + + $sql = 'DELETE FROM ' . TOPICS_TABLE . ' + WHERE topic_id IN (' . implode(', ', $topic_id_ary) . ')'; + $db->sql_query($sql); + + break; } - break; + break; case 'topic_approved': switch (SQL_LAYER) @@ -1107,8 +1132,9 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, SET topic_approved = 1 - topic_approved WHERE topic_id IN (' . implode(', ', $topic_ids) . ')'; $db->sql_query($sql); + break; } - break; + break; case 'post_reported': $post_ids = $post_reported = array(); @@ -1118,6 +1144,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $where_sql GROUP BY p.post_id, p.post_reported"; $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) { $post_ids[$row['post_id']] = $row['post_id']; @@ -1126,6 +1153,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $post_reported[$row['post_id']] = 1; } } + $db->sql_freeresult($result); $sql = 'SELECT DISTINCT(post_id) FROM ' . REPORTS_TABLE . ' @@ -1144,6 +1172,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, unset($post_reported[$row['post_id']]); } } + $db->sql_freeresult($result); // $post_reported should be empty by now, if it's not it contains // posts that are falsely flagged as reported @@ -1159,7 +1188,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, WHERE post_id IN (' . implode(', ', $post_ids) . ')'; $db->sql_query($sql); } - break; + break; case 'topic_reported': if ($sync_extra) @@ -1173,15 +1202,18 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, FROM ' . POSTS_TABLE . " t $where_sql_and t.post_reported = 1"; $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) { $topic_reported[$row['topic_id']] = 1; } + $db->sql_freeresult($result); $sql = 'SELECT t.topic_id, t.topic_reported FROM ' . TOPICS_TABLE . " t $where_sql"; $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) { if ($row['topic_reported'] ^ isset($topic_reported[$row['topic_id']])) @@ -1189,6 +1221,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $topic_ids[] = $row['topic_id']; } } + $db->sql_freeresult($result); if (sizeof($topic_ids)) { @@ -1197,7 +1230,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, WHERE topic_id IN (' . implode(', ', $topic_ids) . ')'; $db->sql_query($sql); } - break; + break; case 'post_attachment': $post_ids = $post_attachment = array(); @@ -1207,6 +1240,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $where_sql GROUP BY p.post_id, p.post_attachment"; $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) { $post_ids[$row['post_id']] = $row['post_id']; @@ -1215,14 +1249,15 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $post_attachment[$row['post_id']] = 1; } } + $db->sql_freeresult($result); $sql = 'SELECT DISTINCT(post_msg_id) FROM ' . ATTACHMENTS_TABLE . ' WHERE post_msg_id IN (' . implode(', ', $post_ids) . ') AND in_message = 0'; + $result = $db->sql_query($sql); $post_ids = array(); - $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { if (!isset($post_attachment[$row['post_id']])) @@ -1234,6 +1269,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, unset($post_attachment[$row['post_id']]); } } + $db->sql_freeresult($result); // $post_attachment should be empty by now, if it's not it contains // posts that are falsely flagged as having attachments @@ -1249,7 +1285,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, WHERE post_id IN (' . implode(', ', $post_ids) . ')'; $db->sql_query($sql); } - break; + break; case 'topic_attachment': if ($sync_extra) @@ -1263,15 +1299,18 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, FROM ' . POSTS_TABLE . " t $where_sql_and t.post_attachment = 1"; $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) { $topic_attachment[$row['topic_id']] = 1; } + $db->sql_freeresult($result); $sql = 'SELECT t.topic_id, t.topic_attachment FROM ' . TOPICS_TABLE . " t $where_sql"; $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) { if ($row['topic_attachment'] ^ isset($topic_attachment[$row['topic_id']])) @@ -1279,6 +1318,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $topic_ids[] = $row['topic_id']; } } + $db->sql_freeresult($result); if (sizeof($topic_ids)) { @@ -1287,9 +1327,10 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, WHERE topic_id IN (' . implode(', ', $topic_ids) . ')'; $db->sql_query($sql); } - break; + break; case 'forum': + // 1: Get the list of all forums $sql = 'SELECT f.* FROM ' . FORUMS_TABLE . " f @@ -1316,6 +1357,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $forum_data[$forum_id]['last_poster_id'] = 0; $forum_data[$forum_id]['last_poster_name'] = ''; } + $db->sql_freeresult($result); // 2: Get topic counts for each forum $sql = 'SELECT forum_id, topic_approved, COUNT(topic_id) AS forum_topics @@ -1323,6 +1365,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, WHERE forum_id IN (' . implode(', ', $forum_ids) . ') GROUP BY forum_id, topic_approved'; $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) { $forum_id = (int) $row['forum_id']; @@ -1333,6 +1376,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $forum_data[$forum_id]['topics'] = $row['forum_topics']; } } + $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 @@ -1341,15 +1385,17 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, 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_data[$forum_id]['posts'] = intval($row['forum_posts']); - $forum_data[$forum_id]['last_post_id'] = intval($row['last_post_id']); + $forum_data[$forum_id]['posts'] = (int) $row['forum_posts']; + $forum_data[$forum_id]['last_post_id'] = (int) $row['last_post_id']; $post_ids[] = $row['last_post_id']; } + $db->sql_freeresult($result); // 4: Retrieve last_post infos if (sizeof($post_ids)) @@ -1359,9 +1405,10 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, WHERE p.post_id IN (' . implode(', ', $post_ids) . ') AND p.poster_id = u.user_id'; $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) { - $post_info[intval($row['post_id'])] = $row; + $post_info[$row['post_id']] = $row; } $db->sql_freeresult($result); @@ -1393,7 +1440,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, foreach ($forum_data as $forum_id => $row) { - $sql = array(); + $sql_ary = array(); foreach ($fieldnames as $fieldname) { @@ -1401,24 +1448,24 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, { if (preg_match('#name$#', $fieldname)) { - $sql['forum_' . $fieldname] = (string) $row[$fieldname]; + $sql_ary['forum_' . $fieldname] = (string) $row[$fieldname]; } else { - $sql['forum_' . $fieldname] = (int) $row[$fieldname]; + $sql_ary['forum_' . $fieldname] = (int) $row[$fieldname]; } } } - if (sizeof($sql)) + if (sizeof($sql_ary)) { $sql = 'UPDATE ' . FORUMS_TABLE . ' - SET ' . $db->sql_build_array('UPDATE', $sql) . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE forum_id = ' . $forum_id; $db->sql_query($sql); } } - break; + break; case 'topic': $topic_data = $post_ids = $approved_unapproved_ids = $resync_forums = $delete_topics = $delete_posts = array(); @@ -1519,6 +1566,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, delete_topics($where_type, $where_ids, true); return; } + if (sizeof($delete_topics)) { $delete_topic_ids = array(); @@ -1553,6 +1601,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $topic_data[$topic_id]['poster'] = $row['poster_id']; $topic_data[$topic_id]['first_poster_name'] = ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']; } + if ($row['post_id'] == $topic_data[$topic_id]['last_post_id']) { $topic_data[$topic_id]['last_poster_id'] = $row['poster_id']; @@ -1612,20 +1661,20 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, foreach ($topic_data as $topic_id => $row) { - $sql = array(); + $sql_ary = array(); foreach ($fieldnames as $fieldname) { if ($row['topic_' . $fieldname] != $row[$fieldname]) { - $sql['topic_' . $fieldname] = $row[$fieldname]; + $sql_ary['topic_' . $fieldname] = $row[$fieldname]; } } - if (sizeof($sql)) + if (sizeof($sql_ary)) { $sql = 'UPDATE ' . TOPICS_TABLE . ' - SET ' . $db->sql_build_array('UPDATE', $sql) . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE topic_id = ' . $topic_id; $db->sql_query($sql); @@ -1641,8 +1690,10 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, { sync('forum', 'forum_id', $resync_forums, true); } - break; + break; } + + return; } /** @@ -1652,7 +1703,7 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync { global $db; - $sql_forum = (is_array($forum_id)) ? ' IN (' . implode(',', $forum_id) . ')' : " = $forum_id"; + $sql_forum = (is_array($forum_id)) ? ' IN (' . implode(', ', array_map('intval', $forum_id)) . ')' : ' = ' . (int) $forum_id; $sql_and = ''; if (!($prune_flags & 4)) @@ -1722,8 +1773,10 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr FROM ' . FORUMS_TABLE . " WHERE forum_id = $forum_id"; $result = $db->sql_query($sql, 3600); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if ($row = $db->sql_fetchrow($result)) + if ($row) { $prune_date = time() - ($prune_days * 86400); $next_prune = time() + ($prune_freq * 86400); @@ -1737,7 +1790,6 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr add_log('admin', 'LOG_AUTO_PRUNE', $row['forum_name']); } - $db->sql_freeresult($result); return; } @@ -1806,6 +1858,7 @@ function split_sql_file($sql, $delimiter) { unset($data[key($data)]); } + return $data; } @@ -1852,11 +1905,11 @@ function cache_moderators() ), 'WHERE' => '(o.auth_option_id = a.auth_option_id OR o.auth_option_id = r.auth_option_id) - AND ((a.auth_setting = ' . ACL_NO . ' AND r.auth_setting IS NULL) - OR r.auth_setting = ' . ACL_NO . ') - AND a.group_id = ug.group_id - AND ug.user_id IN (' . implode(', ', $ug_id_ary) . ") - AND o.auth_option LIKE 'm\_%'", + AND ((a.auth_setting = ' . ACL_NO . ' AND r.auth_setting IS NULL) + OR r.auth_setting = ' . ACL_NO . ') + AND a.group_id = ug.group_id + AND ug.user_id IN (' . implode(', ', $ug_id_ary) . ") + AND o.auth_option LIKE 'm\_%'", )); $result = $db->sql_query($sql); @@ -1980,11 +2033,11 @@ function cache_moderators() */ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC') { - global $db, $user, $auth, $phpEx, $SID, $phpbb_root_path, $phpbb_admin_path; + global $db, $user, $auth, $phpEx, $phpbb_root_path, $phpbb_admin_path; $topic_id_list = $reportee_id_list = $is_auth = $is_mod = array(); - $profile_url = (defined('IN_ADMIN')) ? "{$phpbb_admin_path}index.$phpEx$SID&i=users&mode=overview" : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile"; + $profile_url = (defined('IN_ADMIN')) ? append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=overview') : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile'); switch ($mode) { @@ -1992,7 +2045,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id $log_type = LOG_ADMIN; $sql_forum = ''; break; - + case 'mod': $log_type = LOG_MOD; @@ -2053,25 +2106,23 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id } $log[$i] = array( - 'id' => $row['log_id'], - + 'id' => $row['log_id'], 'reportee_id' => $row['reportee_id'], 'reportee_username' => '', - 'user_id' => $row['user_id'], 'username' => '<a href="' . $profile_url . '&u=' . $row['user_id'] . '">' . $row['username'] . '</a>', 'ip' => $row['log_ip'], 'time' => $row['log_time'], 'forum_id' => $row['forum_id'], 'topic_id' => $row['topic_id'], - - 'viewforum' => ($row['forum_id'] && $auth->acl_get('f_read', $row['forum_id'])) ? "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $row['forum_id'] : '', + + 'viewforum' => ($row['forum_id'] && $auth->acl_get('f_read', $row['forum_id'])) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', 'action' => (isset($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}', ); if (!empty($row['log_data'])) { - $log_data_ary = unserialize(stripslashes($row['log_data'])); + $log_data_ary = unserialize($row['log_data']); if (isset($user->lang[$row['log_operation']])) { @@ -2097,19 +2148,39 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id $topic_id_list = array_unique($topic_id_list); // This query is not really needed if move_topics() updates the forum_id field, - // altough it's also used to determine if the topic still exists in the database + // although it's also used to determine if the topic still exists in the database $sql = 'SELECT topic_id, forum_id FROM ' . TOPICS_TABLE . ' WHERE topic_id IN (' . implode(', ', array_map('intval', $topic_id_list)) . ')'; $result = $db->sql_query($sql); + $default_forum_id = 0; + while ($row = $db->sql_fetchrow($result)) { - if ($auth->acl_get('f_read', $row['forum_id'])) + if (!$row['forum_id']) + { + if ($auth->acl_getf_global('f_read')) + { + if (!$default_forum_id) + { + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE . ' + WHERE forum_type = ' . FORUM_POST; + $f_result = $db->sql_query_limit($sql, 1); + $default_forum_id = (int) $db->sql_fetchfield('forum_id', false, $f_result); + $db->sql_freeresult($f_result); + } + + $is_auth[$row['topic_id']] = $default_forum_id; + } + } + else { - // DEBUG!! - global topic - $config['default_forum_id'] = 2; - $is_auth[$row['topic_id']] = ($row['forum_id']) ? $row['forum_id'] : $config['default_forum_id']; + if ($auth->acl_get('f_read', $row['forum_id'])) + { + $is_auth[$row['topic_id']] = $row['forum_id']; + } } if ($auth->acl_gets('a_', 'm_', $row['forum_id'])) @@ -2117,11 +2188,12 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id $is_mod[$row['topic_id']] = $row['forum_id']; } } + $db->sql_freeresult($result); foreach ($log as $key => $row) { - $log[$key]['viewtopic'] = (isset($is_auth[$row['topic_id']])) ? "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $is_auth[$row['topic_id']] . '&t=' . $row['topic_id'] : ''; - $log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=logs&mode=topic_logs&t=" . $row['topic_id'] : ''; + $log[$key]['viewtopic'] = (isset($is_auth[$row['topic_id']])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $is_auth[$row['topic_id']] . '&t=' . $row['topic_id']) : ''; + $log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&mode=topic_logs&t=' . $row['topic_id'], true, $user->session_id) : ''; } } @@ -2149,12 +2221,9 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id AND l.log_time >= $limit_days $sql_forum"; $result = $db->sql_query($sql); - - $row = $db->sql_fetchrow($result); + $log_count = (int) $db->sql_fetchfield('total_entries'); $db->sql_freeresult($result); - $log_count = $row['total_entries']; - return; } @@ -2171,7 +2240,6 @@ function view_warned_users(&$users, &$user_count, $limit = 0, $offset = 0, $limi ' . (($limit_days) ? "AND user_last_warning >= $limit_days" : '') . " ORDER BY $sort_by"; $result = $db->sql_query_limit($sql, $limit, $offset); - $users = $db->sql_fetchrowset($result); $db->sql_freeresult($result); @@ -2179,14 +2247,10 @@ function view_warned_users(&$users, &$user_count, $limit = 0, $offset = 0, $limi FROM ' . USERS_TABLE . ' WHERE user_warnings > 0 ' . (($limit_days) ? "AND user_last_warning >= $limit_days" : ''); - $result = $db->sql_query($sql); - - $row = $db->sql_fetchrow($result); + $user_count = (int) $db->sql_fetchfield('user_count'); $db->sql_freeresult($result); - $user_count = $row['user_count']; - return; } @@ -2198,13 +2262,15 @@ function get_database_size() { global $db, $user, $table_prefix; - // This code is heavily influenced by a similar routine - // in phpMyAdmin 2.2.0 + // This code is heavily influenced by a similar routine in phpMyAdmin 2.2.0 if (preg_match('#^mysql#', SQL_LAYER)) { - $result = $db->sql_query('SELECT VERSION() AS mysql_version'); + $sql = 'SELECT VERSION() AS mysql_version'; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if ($row = $db->sql_fetchrow($result)) + if ($row) { $version = $row['mysql_version']; @@ -2251,7 +2317,6 @@ function get_database_size() $sql = 'SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize FROM sysfiles'; $result = $db->sql_query($sql); - $dbsize = ($row = $db->sql_fetchrow($result)) ? intval($row['dbsize']) : $user->lang['NOT_AVAILABLE']; $db->sql_freeresult($result); } diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index 51fbdab6ae..3be750e9bc 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -16,6 +16,9 @@ class compress { var $fp = 0; + /** + * Add file to archive + */ function add_file($src, $src_rm_prefix = '', $src_add_prefix = '', $skip_files = '') { global $phpbb_root_path; @@ -68,17 +71,23 @@ class compress $this->data("$src_path$path$file", file_get_contents("$phpbb_root_path$src$path$file"), false, stat("$phpbb_root_path$src$path$file")); } } - } + return true; } + /** + * Add custom file (the filepath will not be adjusted) + */ function add_custom_file($src, $filename) { $this->data($filename, file_get_contents($src), false, stat($src)); return true; } - + + /** + * Add file data + */ function add_data($src, $name) { $stat = array(); @@ -90,6 +99,9 @@ class compress return true; } + /** + * Return available methods + */ function methods() { $methods = array('.tar'); @@ -111,7 +123,7 @@ class compress /** * @package phpBB3 * -* Zip creation class from phpMyAdmin 2.3.0 © Tobias Ratschiller, Olivier Müller, Loïc Chapeaux, +* Zip creation class from phpMyAdmin 2.3.0 (c) Tobias Ratschiller, Olivier Müller, Loïc Chapeaux, * Marc Delisle, http://www.phpmyadmin.net/ * * Zip extraction function by Alexandre Tedeschi, alexandrebr at gmail dot com @@ -130,11 +142,17 @@ class compress_zip extends compress var $old_offset = 0; var $datasec_len = 0; + /** + * Constructor + */ function compress_zip($mode, $file) { return $this->fp = @fopen($file, $mode . 'b'); } + /** + * Convert unix to dos time + */ function unix_to_dos_time($time) { $timearray = (!$time) ? getdate() : getdate($time); @@ -149,6 +167,9 @@ class compress_zip extends compress return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) | ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1); } + /** + * Extract archive + */ function extract($dst) { // Loop the file, looking for files and folders @@ -276,10 +297,14 @@ class compress_zip extends compress trigger_error("Unexpected header, ending loop"); break 2; } + $dd_try = false; } } + /** + * Close archive + */ function close() { // Write out central file directory and footer ... if it exists @@ -290,7 +315,9 @@ class compress_zip extends compress fclose($this->fp); } - // Create the structures ... note we assume version made by is MSDOS + /** + * Create the structures ... note we assume version made by is MSDOS + */ function data($name, $data, $is_dir = false, $stat) { $name = str_replace('\\', '/', $name); @@ -327,6 +354,7 @@ class compress_zip extends compress // Are we a file or a directory? Set archive for file $attrib = ($is_dir) ? 16 : 32; + // File Record Header $fr = "\x50\x4b\x03\x04"; // Local file header 4bytes $fr .= pack('v', $var_ext); // ver needed to extract 2bytes @@ -351,21 +379,21 @@ class compress_zip extends compress // Central Directory Header $cdrec = "\x50\x4b\x01\x02"; // header 4bytes - $cdrec .= "\x00\x00"; // version made by + $cdrec .= "\x00\x00"; // version made by $cdrec .= pack('v', $var_ext); // version needed to extract - $cdrec .= "\x00\x00"; // gen purpose bit flag + $cdrec .= "\x00\x00"; // gen purpose bit flag $cdrec .= $c_method; // compression method - $cdrec .= $hexdtime; // last mod time & date - $cdrec .= pack('V', $crc); // crc32 - $cdrec .= pack('V', $c_len); // compressed filesize - $cdrec .= pack('V', $unc_len); // uncompressed filesize - $cdrec .= pack('v', strlen($name)); // length of filename - $cdrec .= pack('v', 0); // extra field length - $cdrec .= pack('v', 0); // file comment length - $cdrec .= pack('v', 0); // disk number start - $cdrec .= pack('v', 0); // internal file attributes + $cdrec .= $hexdtime; // last mod time & date + $cdrec .= pack('V', $crc); // crc32 + $cdrec .= pack('V', $c_len); // compressed filesize + $cdrec .= pack('V', $unc_len); // uncompressed filesize + $cdrec .= pack('v', strlen($name)); // length of filename + $cdrec .= pack('v', 0); // extra field length + $cdrec .= pack('v', 0); // file comment length + $cdrec .= pack('v', 0); // disk number start + $cdrec .= pack('v', 0); // internal file attributes $cdrec .= pack('V', $attrib); // external file attributes - $cdrec .= pack('V', $this->old_offset); // relative offset of local header + $cdrec .= pack('V', $this->old_offset); // relative offset of local header $cdrec .= $name; // Save to central directory @@ -374,6 +402,9 @@ class compress_zip extends compress $this->old_offset = $this->datasec_len; } + /** + * file + */ function file() { $ctrldir = implode('', $this->ctrl_dir); @@ -386,6 +417,9 @@ class compress_zip extends compress "\x00\x00"; // .zip file comment length } + /** + * Download archive + */ function download($filename) { global $phpbb_root_path; @@ -409,7 +443,7 @@ class compress_zip extends compress * @package phpBB3 * * Tar/tar.gz compression routine -* Header/checksum creation derived from tarfile.pl, © Tom Horsley, 1994 +* Header/checksum creation derived from tarfile.pl, (c) Tom Horsley, 1994 */ class compress_tar extends compress { @@ -420,6 +454,9 @@ class compress_tar extends compress var $type = ''; var $wrote = false; + /** + * Constructor + */ function compress_tar($mode, $file, $type = '') { $type = (!$type) ? $file : $type; @@ -432,6 +469,9 @@ class compress_tar extends compress $this->open(); } + /** + * Extract archive + */ function extract($dst) { $fzread = ($this->isbz && function_exists('bzread')) ? 'bzread' : (($this->isgz && extension_loaded('zlib')) ? 'gzread' : 'fread'); @@ -491,6 +531,9 @@ class compress_tar extends compress } } + /** + * Close archive + */ function close() { $fzclose = ($this->isbz && function_exists('bzclose')) ? 'bzclose' : (($this->isgz && extension_loaded('zlib')) ? 'gzclose' : 'fclose'); @@ -498,12 +541,17 @@ class compress_tar extends compress if ($this->wrote) { $fzwrite = ($this->isbz && function_exists('bzwrite')) ? 'bzwrite' : (($this->isgz && extension_loaded('zlib')) ? 'gzwrite' : 'fwrite'); - $fzwrite($this->fp, pack("a512", "")); // Symbolizes that there are no more files + + // Symbolizes that there are no more files + $fzwrite($this->fp, pack("a512", "")); } $fzclose($this->fp); } + /** + * Create the structures + */ function data($name, $data, $is_dir = false, $stat) { $this->wrote = true; @@ -513,12 +561,12 @@ 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; @@ -530,23 +578,26 @@ class compress_tar extends compress // 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) : '') : '')); unset($data); } + /** + * Open archive + */ function open() { $fzopen = ($this->isbz && function_exists('bzopen')) ? 'bzopen' : (($this->isgz && extension_loaded('zlib')) ? 'gzopen' : 'fopen'); @@ -558,6 +609,9 @@ class compress_tar extends compress } } + /** + * Download archive + */ function download($filename) { global $phpbb_root_path; diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 1f59fdf6de..aa91e4d761 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -14,7 +14,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_moderators = false) { global $db, $auth, $user, $template; - global $phpbb_root_path, $phpEx, $SID, $config; + global $phpbb_root_path, $phpEx, $config; $forum_rows = $subforums = $forum_ids = $forum_ids_moderator = $forum_moderators = $active_forum_ary = array(); $parent_id = $visible_forums = 0; @@ -56,11 +56,12 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $sql_from = FORUMS_TABLE . ' f '; $lastread_select = $sql_lastread = ''; - $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array(); + $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : ''; + $tracking_topics = ($tracking_topics) ? unserialize($tracking_topics) : array(); if (!$user->data['is_registered']) { - $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate'] : 0; + $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0; } } @@ -108,7 +109,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $right_id = $row['right_id']; continue; } - + $forum_ids[] = $forum_id; if ($config['load_db_lastread'] && $user->data['is_registered']) @@ -119,9 +120,9 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod { if (!$user->data['is_registered']) { - $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate'] : 0; + $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0; } - $forum_tracking_info[$forum_id] = (isset($tracking_topics['f'][$forum_id])) ? base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate'] : $user->data['user_lastmark']; + $forum_tracking_info[$forum_id] = (isset($tracking_topics['f'][$forum_id])) ? (int) (base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate']) : $user->data['user_lastmark']; } // Display active topics from this forum? @@ -138,7 +139,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod } $active_forum_ary['forum_id'][] = $forum_id; - $active_forum_ary['enable_icons'][] = $row['enable_icons']; + $active_forum_ary['enable_icons'][] = $row['enable_icons']; $active_forum_ary['forum_topics'] += ($auth->acl_get('m_approve', $forum_id)) ? $row['forum_topics_real'] : $row['forum_topics']; $active_forum_ary['forum_posts'] += $row['forum_posts']; } @@ -162,7 +163,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $subforums[$parent_id][$forum_id]['display'] = ($row['display_on_index']) ? true : false; $subforums[$parent_id][$forum_id]['name'] = $row['forum_name']; $subforums[$parent_id][$forum_id]['orig_forum_last_post_time'] = $row['forum_last_post_time']; - + $forum_rows[$parent_id]['forum_topics'] += ($auth->acl_get('m_approve', $forum_id)) ? $row['forum_topics_real'] : $row['forum_topics']; // Do not list redirects in LINK Forums as Posts. @@ -186,7 +187,6 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod } $forum_ids_moderator[$parent_id] = $forum_rows[$parent_id]['forum_id_last_post']; - } $db->sql_freeresult($result); @@ -207,11 +207,9 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>'); } - + meta_refresh(3, $redirect); - - $message = $user->lang['FORUMS_MARKED'] . '<br /><br />' . $message; - trigger_error($message); + trigger_error($user->lang['FORUMS_MARKED'] . '<br /><br />' . $message); } // Grab moderators ... if necessary @@ -230,13 +228,13 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod if (!$row['parent_id'] && $row['forum_type'] == FORUM_CAT) { $template->assign_block_vars('forumrow', array( - 'S_IS_CAT' => true, - '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']), + 'S_IS_CAT' => true, + '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']), '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'] : '', - 'U_VIEWFORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $row['forum_id']) + 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id'])) ); continue; @@ -263,14 +261,14 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod if ($subforum_row['display'] && $subforum_row['name']) { $subforums_list .= ($subforums_list == '') ? '' : ', '; - $subforums_list .= '<a href="' . $phpbb_root_path . "viewforum.$phpEx$SID&f=$subforum_id\">{$subforum_row['name']}</a>"; + $subforums_list .= '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $subforum_id) . '">' . $subforum_row['name'] . '</a>'; } else { unset($subforums[$forum_id][$subforum_id]); } } - + $l_subforums = (sizeof($subforums[$forum_id]) == 1) ? $user->lang['SUBFORUM'] . ': ' : $user->lang['SUBFORUMS'] . ': '; $folder_image = ($forum_unread) ? 'sub_forum_new' : 'sub_forum'; } @@ -305,9 +303,9 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $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_url = ($row['forum_last_poster_id'] == ANONYMOUS) ? '' : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['forum_last_poster_id']}"; + $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 = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id'] . '#p' . $row['forum_last_post_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 { @@ -328,6 +326,8 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $template->assign_block_vars('forumrow', array( 'S_IS_CAT' => false, 'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false, + 'S_UNREAD_FORUM' => $forum_unread, + 'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false, 'FORUM_ID' => $row['forum_id'], 'FORUM_NAME' => $row['forum_name'], @@ -341,23 +341,21 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'LAST_POSTER' => $last_poster, 'MODERATORS' => $moderators_list, - 'L_SUBFORUM_STR' => $l_subforums, - 'L_FORUM_FOLDER_ALT'=> $folder_alt, - 'L_MODERATOR_STR' => $l_moderator, + '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) ? "{$phpbb_root_path}viewforum.$phpEx$SID&f={$row['forum_id']}" : $row['forum_link'], + '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_LAST_POSTER' => $last_poster_url, - 'U_LAST_POST' => $last_post_url, - ) + 'U_LAST_POST' => $last_post_url) ); } $template->assign_vars(array( - 'U_MARK_FORUMS' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $root_data['forum_id'] . '&mark=forums', + 'U_MARK_FORUMS' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $root_data['forum_id'] . '&mark=forums'), 'S_HAS_SUBFORUM' => ($visible_forums) ? true : false, 'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'], - 'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'), - ) + 'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST')) ); if ($return_moderators) @@ -399,7 +397,7 @@ function generate_forum_rules(&$forum_data) function generate_forum_nav(&$forum_data) { global $db, $user, $template, $auth; - global $phpEx, $SID, $phpbb_root_path; + global $phpEx, $phpbb_root_path; if (!$auth->acl_get('f_list', $forum_data['forum_id'])) { @@ -426,7 +424,7 @@ function generate_forum_nav(&$forum_data) 'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false, 'FORUM_NAME' => $parent_name, 'FORUM_ID' => $parent_forum_id, - 'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=$parent_forum_id") + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id)) ); } @@ -436,7 +434,7 @@ function generate_forum_nav(&$forum_data) 'S_IS_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false, 'FORUM_NAME' => $forum_data['forum_name'], 'FORUM_ID' => $forum_data['forum_id'], - 'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $forum_data['forum_id']) + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data['forum_id'])) ); $template->assign_vars(array( @@ -495,9 +493,9 @@ function get_forum_parents(&$forum_data) */ function topic_topic_author(&$topic_row) { - global $phpEx, $SID, $phpbb_root_path, $user; + global $phpEx, $phpbb_root_path, $user; - $topic_author = ($topic_row['topic_poster'] != ANONYMOUS) ? "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $topic_row['topic_poster'] . '">' : ''; + $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>' : ''; @@ -519,7 +517,7 @@ function topic_generate_pagination($replies, $url) $times = 1; for ($j = 0; $j < $replies + 1; $j += $config['posts_per_page']) { - $pagination .= "<a href=\"$url&start=$j\">$times</a>"; + $pagination .= '<a href="' . $url . '&start=' . $j . '">' . $times . '</a>'; if ($times == 1 && $total_pages > 4) { $pagination .= ' ... '; @@ -546,7 +544,7 @@ function topic_generate_pagination($replies, $url) */ function get_moderators(&$forum_moderators, $forum_id = false) { - global $config, $template, $db, $phpbb_root_path, $phpEx, $SID; + global $config, $template, $db, $phpbb_root_path, $phpEx; // Have we disabled the display of moderators? If so, then return // from whence we came ... @@ -577,7 +575,7 @@ function get_moderators(&$forum_moderators, $forum_id = false) while ($row = $db->sql_fetchrow($result)) { - $forum_moderators[$row['forum_id']][] = (!empty($row['user_id'])) ? '<a href="' . $phpbb_root_path . "memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'] . '">' . $row['username'] . '</a>' : '<a href="' . $phpbb_root_path . "memberlist.$phpEx$SID&mode=group&g=" . $row['group_id'] . '">' . $row['group_name'] . '</a>'; + $forum_moderators[$row['forum_id']][] = (!empty($row['user_id'])) ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']) . '">' . $row['username'] . '</a>' : '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . $row['group_name'] . '</a>'; } $db->sql_freeresult($result); @@ -589,7 +587,7 @@ function get_moderators(&$forum_moderators, $forum_id = false) */ function gen_forum_auth_level($mode, $forum_id, $forum_status) { - global $SID, $template, $auth, $user, $config; + global $template, $auth, $user, $config; $locked = ($forum_status == ITEM_LOCKED && !$auth->acl_get('m_edit', $forum_id)) ? true : false; @@ -637,13 +635,13 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold $topic_type = $user->lang['VIEW_TOPIC_ANNOUNCEMENT']; $folder = 'folder_announce'; $folder_new = 'folder_announce_new'; - break; + break; case POST_STICKY: $topic_type = $user->lang['VIEW_TOPIC_STICKY']; $folder = 'folder_sticky'; $folder_new = 'folder_sticky_new'; - break; + break; default: if ($replies >= $config['hot_threshold']) @@ -656,7 +654,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold $folder = 'folder'; $folder_new = 'folder_new'; } - break; + break; } if ($topic_row['topic_status'] == ITEM_LOCKED) @@ -688,7 +686,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold function display_attachments($forum_id, $blockname, &$attachment_data, &$update_count, $force_physical = false, $return = false) { global $template, $cache, $user; - global $extensions, $config, $phpbb_root_path, $phpEx, $SID; + global $extensions, $config, $phpbb_root_path, $phpEx; $return_tpl = array(); @@ -715,13 +713,17 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ $thumbnail_filename = $phpbb_root_path . $config['upload_path'] . '/thumb_' . basename($attachment['physical_filename']); $upload_icon = ''; - if ($user->img('icon_attach', '') && !$extensions[$attachment['extension']]['upload_icon']) - { - $upload_icon = $user->img('icon_attach', ''); - } - else if ($extensions[$attachment['extension']]['upload_icon']) + + if (isset($extensions[$attachment['extension']])) { - $upload_icon = '<img src="' . $phpbb_root_path . $config['upload_icons_path'] . '/' . trim($extensions[$attachment['extension']]['upload_icon']) . '" alt="" />'; + if ($user->img('icon_attach', '') && !$extensions[$attachment['extension']]['upload_icon']) + { + $upload_icon = $user->img('icon_attach', ''); + } + else if ($extensions[$attachment['extension']]['upload_icon']) + { + $upload_icon = '<img src="' . $phpbb_root_path . $config['upload_icons_path'] . '/' . trim($extensions[$attachment['extension']]['upload_icon']) . '" alt="" />'; + } } $filesize = $attachment['filesize']; @@ -796,7 +798,7 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ // Images, but display Thumbnail case ATTACHMENT_CATEGORY_THUMB: $l_downloaded_viewed = $user->lang['VIEWED']; - $download_link = (!$force_physical && $attachment['attach_id']) ? $phpbb_root_path . "download.$phpEx$SID&id=" . $attachment['attach_id'] : $filename; + $download_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id']) : $filename; $block_array += array( 'S_THUMBNAIL' => true, @@ -830,7 +832,7 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ // Viewed/Heared File ... update the download count (download.php is not called here) $update_count[] = $attachment['attach_id']; - break; + break; /* // Macromedia Flash Files case SWF_CAT: @@ -851,7 +853,7 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ */ default: $l_downloaded_viewed = $user->lang['DOWNLOADED']; - $download_link = (!$force_physical && $attachment['attach_id']) ? $phpbb_root_path . "download.$phpEx$SID&id=" . $attachment['attach_id'] : $filename; + $download_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id']) : $filename; $block_array += array( 'S_FILE' => true, @@ -924,7 +926,7 @@ function display_reasons($reason_id = 0) function display_user_activity(&$userdata) { global $auth, $template, $db, $user; - global $phpbb_root_path, $SID, $phpEx; + global $phpbb_root_path, $phpEx; // Init new auth class if user is different if ($user->data['user_id'] != $userdata['user_id']) @@ -976,7 +978,7 @@ function display_user_activity(&$userdata) $post_count_sql GROUP BY f.forum_id ORDER BY COUNT(p.post_id) DESC"; - break; + break; default: $sql = 'SELECT f.forum_id, COUNT(p.post_id) AS num_posts @@ -1072,8 +1074,8 @@ function display_user_activity(&$userdata) 'ACTIVE_TOPIC' => censor_text($active_t_name), '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_t_pct), - 'U_ACTIVE_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=$active_f_id", - 'U_ACTIVE_TOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&t=$active_t_id") + '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)) ); } @@ -1082,7 +1084,7 @@ function display_user_activity(&$userdata) */ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0) { - global $template, $db, $user, $phpEx, $SID, $start, $phpbb_root_path; + global $template, $db, $user, $phpEx, $start, $phpbb_root_path; $table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE; $where_sql = ($mode == 'forum') ? 'forum_id' : 'topic_id'; @@ -1121,9 +1123,11 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $for $db->sql_query($sql); } - meta_refresh(3, "view$mode.$phpEx$SID&$u_url=$match_id&start=$start"); + $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); + + meta_refresh(3, $redirect_url); - $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . "view$mode.$phpEx$SID&" . $u_url . "=$match_id&start=$start" . '">', '</a>'); + $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>'); trigger_error($message); } else @@ -1153,9 +1157,10 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $for $db->sql_query($sql); } - meta_refresh(3, "view$mode.$phpEx$SID&$u_url=$match_id&start=$start"); + $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); + meta_refresh(3, $redirect_url); - $message = $user->lang['ARE_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . "view$mode.$phpEx$SID&" . $u_url . "=$match_id&start=$start" . '">', '</a>'); + $message = $user->lang['ARE_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>'); trigger_error($message); } else @@ -1179,7 +1184,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $for if ($can_watch) { - $s_watching['link'] = "{$phpbb_root_path}view$mode.$phpEx$SID&$u_url=$match_id&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start"; + $s_watching['link'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start"); $s_watching['title'] = $user->lang[(($is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)]; } diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php index 9fd0386511..0f1a5df881 100644 --- a/phpBB/includes/functions_jabber.php +++ b/phpBB/includes/functions_jabber.php @@ -59,6 +59,9 @@ class jabber var $connector; + /** + * Constructor + */ function jabber() { $this->port = '5222'; @@ -93,6 +96,9 @@ class jabber ); } + /** + * Connect + */ function connect() { $this->connector = new cjp_standard_connector; @@ -120,6 +126,9 @@ class jabber } } + /** + * Disconnect + */ function disconnect() { if (is_int($this->delay_disconnect)) @@ -131,6 +140,9 @@ class jabber $this->connector->close_socket(); } + /** + * Cruise Control + */ function cruise_control($seconds = -1) { $count = 0; @@ -147,13 +159,12 @@ class jabber { $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 @@ -173,6 +184,9 @@ class jabber return true; } + /** + * Send authentication request + */ function send_auth() { $this->auth_id = 'auth_' . md5(time() . $_SERVER['REMOTE_ADDR']); @@ -208,13 +222,17 @@ class jabber } } + /** + * Register account + */ function account_registration($reg_email = NULL, $reg_name = NULL) { $packet = $this->send_iq($this->server, 'get', 'reg_01', 'jabber:iq:register'); if ($packet) { - $key = $this->get_info_from_iq_key($packet); // just in case a key was passed back from the server + // just in case a key was passed back from the server + $key = $this->get_info_from_iq_key($packet); unset($packet); $payload = "<username>{$this->username}</username> @@ -252,13 +270,17 @@ class jabber } } + /** + * Change password + */ function change_password($new_password) { $packet = $this->send_iq($this->server, 'get', 'A0', 'jabber:iq:register'); if ($packet) { - $key = $this->get_info_from_iq_key($packet); // just in case a key was passed back from the server + // just in case a key was passed back from the server + $key = $this->get_info_from_iq_key($packet); unset($packet); $payload = "<username>{$this->username}</username> @@ -292,6 +314,9 @@ class jabber } } + /** + * Send packet + */ function send_packet($xml) { $xml = trim($xml); @@ -299,8 +324,10 @@ class jabber return ($this->connector->write_to_socket($xml)) ? true : false; } - // get the transport registration fields - // method written by Steve Blinch, http://www.blitzaffe.com + /** + * get the transport registration fields + * method written by Steve Blinch, http://www.blitzaffe.com + */ function transport_registration_details($transport) { $this->txnid++; @@ -326,8 +353,10 @@ class jabber } } - // register with the transport - // method written by Steve Blinch, http://www.blitzaffe.com + /** + * register with the transport + * method written by Steve Blinch, http://www.blitzaffe.com + */ function transport_registration($transport, $details) { $this->txnid++; @@ -335,17 +364,18 @@ class jabber if ($packet) { - $key = $this->get_info_from_iq_key($packet); // just in case a key was passed back from the server + // 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]['#'])) @@ -374,6 +404,9 @@ class jabber } } + /** + * Listen to socket + */ function listen() { $incoming = ''; @@ -398,12 +431,18 @@ class jabber return true; } + /** + * Strip jid + */ function strip_jid($jid = NULL) { preg_match('#(.*)\/(.*)#Ui', $jid, $temp); return ($temp[1] != '') ? $temp[1] : $jid; } + /** + * Send a message + */ function send_message($to, $type = 'normal', $id = NULL, $content = NULL, $payload = NULL) { if ($to && is_array($content)) @@ -431,14 +470,7 @@ class jabber $xml .= $payload; $xml .= "</message>\n"; - if ($this->send_packet($xml)) - { - return true; - } - else - { - return false; - } + return ($this->send_packet($xml)) ? true : false; } else { @@ -446,6 +478,9 @@ class jabber } } + /** + * Send presence + */ function send_presence($type = NULL, $to = NULL, $status = NULL, $show = NULL, $priority = NULL) { $xml = '<presence'; @@ -462,6 +497,9 @@ class jabber return ($this->send_packet($xml)) ? true : false; } + /** + * Send error + */ function send_error($to, $id = NULL, $error_number, $error_message = NULL) { $xml = "<iq type='error' to='$to'"; @@ -475,11 +513,17 @@ class jabber $this->send_packet($xml); } + /** + * Get first from queue + */ function get_first_from_queue() { return array_shift($this->packet_queue); } + /** + * Get from queue by id + */ function get_from_queue_by_id($packet_type, $id) { $found_message = false; @@ -498,6 +542,9 @@ class jabber return (is_array($found_message)) ? $found_message : false; } + /** + * Call handler + */ function call_handler($packet = NULL) { $packet_type = $this->_get_packet_type($packet); @@ -538,6 +585,9 @@ class jabber } } + /** + * Send iq + */ function send_iq($to = NULL, $type = 'get', $id = NULL, $xmlns = NULL, $payload = NULL, $from = NULL) { if (!preg_match('#^(get|set|result|error)$#', $type)) @@ -569,11 +619,14 @@ class jabber } } - // ====================================================================== // private methods // ====================================================================== + /** + * Send auth + * @private + */ function _sendauth_ok($zerok_token, $zerok_sequence) { // initial hash of password @@ -598,6 +651,10 @@ class jabber return ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id) ? true : false; } + /** + * Send auth digest + * @private + */ function _sendauth_digest() { $payload = "<username>{$this->username}</username> @@ -610,6 +667,10 @@ class jabber return ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id) ? true : false; } + /** + * Send auth plain + * @private + */ function _sendauth_plaintext() { $payload = "<username>{$this->username}</username> @@ -622,6 +683,10 @@ class jabber return ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id) ? true : false; } + /** + * Listen on socket + * @private + */ function _listen_incoming() { $incoming = ''; @@ -635,6 +700,10 @@ class jabber return $this->xmlize($incoming); } + /** + * Check if connected + * @private + */ function _check_connected() { $incoming_array = $this->_listen_incoming(); @@ -660,6 +729,10 @@ class jabber } } + /** + * Split incoming packet + * @private + */ function _split_incoming($incoming) { $temp = preg_split('#<(message|iq|presence|stream)#', $incoming, -1, PREG_SPLIT_DELIM_CAPTURE); @@ -673,6 +746,10 @@ class jabber return $array; } + /** + * Get packet type + * @private + */ function _get_packet_type($packet = NULL) { if (is_array($packet)) @@ -684,8 +761,10 @@ class jabber return ($packet_type) ? $packet_type : false; } - // _array_htmlspecialchars() - // applies htmlspecialchars() to all values in an array + /** + * _array_htmlspecialchars() + * applies htmlspecialchars() to all values in an array + */ function _array_htmlspecialchars(&$array) { if (is_array($array)) @@ -703,36 +782,57 @@ class jabber // <message/> parsers // ====================================================================== + /** + * Get info from message (from) + */ function get_info_from_message_from($packet = NULL) { return (is_array($packet)) ? $packet['message']['@']['from'] : false; } + /** + * Get info from message (type) + */ function get_info_from_message_type($packet = NULL) { return (is_array($packet)) ? $packet['message']['@']['type'] : false; } + /** + * Get info from message (id) + */ function get_info_from_message_id($packet = NULL) { return (is_array($packet)) ? $packet['message']['@']['id'] : false; } + /** + * Get info from message (thread) + */ function get_info_from_message_thread($packet = NULL) { return (is_array($packet)) ? $packet['message']['#']['thread'][0]['#'] : false; } + /** + * Get info from message (subject) + */ function get_info_from_message_subject($packet = NULL) { return (is_array($packet)) ? $packet['message']['#']['subject'][0]['#'] : false; } + /** + * Get info from message (body) + */ function get_info_from_message_body($packet = NULL) { return (is_array($packet)) ? $packet['message']['#']['body'][0]['#'] : false; } + /** + * Get info from message (error) + */ function get_info_from_message_error($packet = NULL) { $error = preg_replace('#^\/$#', '', ($packet['message']['#']['error'][0]['@']['code'] . '/' . $packet['message']['#']['error'][0]['#'])); @@ -743,26 +843,41 @@ class jabber // <iq/> parsers // ====================================================================== + /** + * Get info from iq (from) + */ function get_info_from_iq_from($packet = NULL) { return (is_array($packet)) ? $packet['iq']['@']['from'] : false; } + /** + * Get info from iq (type) + */ function get_info_from_iq_type($packet = NULL) { return (is_array($packet)) ? $packet['iq']['@']['type'] : false; } + /** + * Get info from iq (id) + */ function get_info_from_iq_id($packet = NULL) { return (is_array($packet)) ? $packet['iq']['@']['id'] : false; } + /** + * Get info from iq (key) + */ function get_info_from_iq_key($packet = NULL) { return (is_array($packet) && isset($packet['iq']['#']['query'][0]['#']['key'][0]['#'])) ? $packet['iq']['#']['query'][0]['#']['key'][0]['#'] : false; } + /** + * Get info from iq (error) + */ function get_info_from_iq_error($packet = NULL) { $error = preg_replace('#^\/$#', '', ($packet['iq']['#']['error'][0]['@']['code'] . '/' . $packet['iq']['#']['error'][0]['#'])); @@ -773,11 +888,17 @@ class jabber // <message/> handlers // ====================================================================== + /** + * return message (from) + */ function handler_message_normal($packet) { $from = $packet['message']['@']['from']; } + /** + * return error (from) + */ function handler_message_error($packet) { $from = $packet['message']['@']['from']; @@ -787,7 +908,9 @@ class jabber // <iq/> handlers // ====================================================================== - // simple client authentication + /** + * simple client authentication + */ function handler_iq_jabber_iq_auth($packet) { $from = $this->get_info_from_iq_from($packet); @@ -796,7 +919,9 @@ class jabber $this->send_error($from, $id, 501); } - // method for interactive registration + /** + * method for interactive registration + */ function handler_iq_jabber_iq_register($packet) { $from = $this->get_info_from_iq_from($packet); @@ -805,7 +930,9 @@ class jabber $this->send_error($from, $id, 501); } - // keepalive method, added by Nathan Fritz + /** + * keepalive method, added by Nathan Fritz + */ function handler_iq_($packet) { if ($this->keep_alive_id == $this->get_info_from_iq_id($packet)) @@ -818,7 +945,9 @@ class jabber // Generic handlers // ====================================================================== - // Generic handler for unsupported requests + /** + * Generic handler for unsupported requests + */ function handler_not_implemented($packet) { $packet_type = $this->_get_packet_type($packet); @@ -831,8 +960,10 @@ class jabber // Third party code // m@d pr0ps to the coders ;) - // xmlize() - // (c) Hans Anderson / http://www.hansanderson.com/php/xml/ + /** + * xmlize() + * (c) Hans Anderson / http://www.hansanderson.com/php/xml/ + */ function xmlize($data) { $vals = $index = $array = array(); @@ -851,8 +982,10 @@ class jabber return $array; } - // _xml_depth() - // (c) Hans Anderson / http://www.hansanderson.com/php/xml/ + /** + * _xml_depth() + * (c) Hans Anderson / http://www.hansanderson.com/php/xml/ + */ function _xml_depth($vals, &$i) { $children = array(); @@ -868,7 +1001,7 @@ class jabber { case 'cdata': array_push($children, trim($vals[$i]['value'])); - break; + break; case 'complete': $tagname = $vals[$i]['tag']; @@ -878,7 +1011,7 @@ class jabber { $children[$tagname][$size]['@'] = $vals[$i]['attributes']; } - break; + break; case 'open': $tagname = $vals[$i]['tag']; @@ -892,19 +1025,21 @@ class jabber { $children[$tagname][$size]['#'] = $this->_xml_depth($vals, $i); } - break; + break; case 'close': return $children; - break; + break; } } return $children; } - // traverse_xmlize() - // (c) acebone@f2s.com, a HUGE help! + /** + * traverse_xmlize() + * (c) acebone@f2s.com, a HUGE help! + */ function traverse_xmlize($array, $arr_name = 'array', $level = 0) { if ($level == 0) @@ -935,7 +1070,6 @@ class jabber * @package phpBB3 * make_xml * Currently not in use -*/ class make_xml extends jabber { var $nodes; @@ -1036,6 +1170,7 @@ class make_xml extends jabber return (is_array($newarray)) ? $newarray : false; } } +*/ /** * @package phpBB3 @@ -1045,6 +1180,9 @@ class cjp_standard_connector { var $active_socket; + /** + * Open socket + */ function open_socket($server, $port) { if ($this->active_socket = @fsockopen($server, $port, $err, $err2, 5)) @@ -1060,19 +1198,30 @@ class cjp_standard_connector } } + /** + * Close socket + */ function close_socket() { return @fclose($this->active_socket); } + /** + * Write to socket + */ function write_to_socket($data) { return @fwrite($this->active_socket, $data); } + /** + * Read from socket + */ function read_from_socket($chunksize) { - $buffer = stripslashes(@fread($this->active_socket, $chunksize)); + $buffer = @fread($this->active_socket, $chunksize); + + //$buffer = (STRIP) ? stripslashes($buffer) : $buffer; //@set_magic_quotes_runtime(get_magic_quotes_gpc()); return $buffer; diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index b0ccc3b9b1..e4e035a9a4 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -21,6 +21,9 @@ class messenger var $use_queue = true; var $tpl_msg = array(); + /** + * Constructor + */ function messenger($use_queue = true) { global $config; @@ -36,7 +39,9 @@ class messenger $this->subject = ''; } - // Resets all the data (address, template file, etc etc) to default + /** + * Resets all the data (address, template file, etc etc) to default + */ function reset() { $this->addresses = array(); @@ -44,7 +49,9 @@ class messenger $this->mail_priority = MAIL_NORMAL_PRIORITY; } - // Sets an email address to send to + /** + * Sets an email address to send to + */ function to($address, $realname = '') { $pos = isset($this->addresses['to']) ? sizeof($this->addresses['to']) : 0; @@ -52,6 +59,9 @@ class messenger $this->addresses['to'][$pos]['name'] = trim($realname); } + /** + * Sets an cc address to send to + */ function cc($address, $realname = '') { $pos = isset($this->addresses['cc']) ? sizeof($this->addresses['cc']) : 0; @@ -59,6 +69,9 @@ class messenger $this->addresses['cc'][$pos]['name'] = trim($realname); } + /** + * Sets an bcc address to send to + */ function bcc($address, $realname = '') { $pos = isset($this->addresses['bcc']) ? sizeof($this->addresses['bcc']) : 0; @@ -66,6 +79,9 @@ class messenger $this->addresses['bcc'][$pos]['name'] = trim($realname); } + /** + * Sets a im contact to send to + */ function im($address, $realname = '') { $pos = isset($this->addresses['im']) ? sizeof($this->addresses['im']) : 0; @@ -73,33 +89,49 @@ class messenger $this->addresses['im'][$pos]['name'] = trim($realname); } + /** + * Set the reply to address + */ function replyto($address) { $this->replyto = trim($address); } + /** + * Set the from address + */ function from($address) { $this->from = trim($address); } - // set up subject for mail + /** + * set up subject for mail + */ function subject($subject = '') { $this->subject = trim($subject); } - // set up extra mail headers + /** + * set up extra mail headers + */ function headers($headers) { $this->extra_headers .= trim($headers) . "\n"; } + /** + * Set the email priority + */ function set_mail_priority($priority = MAIL_NORMAL_PRIORITY) { $this->mail_priority = $priority; } + /** + * Set email template to use + */ function template($template_file, $template_lang = '') { global $config, $phpbb_root_path; @@ -111,7 +143,7 @@ class messenger if (!trim($template_lang)) { - $template_lang = $config['default_lang']; + $template_lang = basename($config['default_lang']); } if (empty($this->tpl_msg[$template_lang . $template_file])) @@ -142,13 +174,17 @@ class messenger return true; } - // assign variables + /** + * assign variables to email template + */ function assign_vars($vars) { $this->vars = (empty($this->vars)) ? $vars : $this->vars + $vars; } - // Send the mail out to the recipients set previously in var $this->address + /** + * Send the mail out to the recipients set previously in var $this->addresses + */ function send($method = NOTIFY_EMAIL, $break = false) { global $config, $user; @@ -214,7 +250,7 @@ class messenger case NOTIFY_IM: $result = $this->msg_jabber(); break; - + case NOTIFY_BOTH: $result = $this->msg_email(); $this->msg_jabber(); @@ -225,6 +261,9 @@ class messenger return $result; } + /** + * Add error message to log + */ function error($type, $msg) { global $user, $phpEx, $phpbb_root_path; @@ -235,9 +274,9 @@ class messenger add_log('critical', 'LOG_ERROR_' . $type, $msg); } - // - // Messenger methods - // + /** + * Save to queue + */ function save_queue() { global $config; @@ -248,6 +287,9 @@ class messenger } } + /** + * Send out emails + */ function msg_email() { global $config, $user; @@ -343,6 +385,9 @@ class messenger return true; } + /** + * Send jabber message out + */ function msg_jabber() { global $config, $db, $user, $phpbb_root_path, $phpEx; @@ -406,8 +451,8 @@ class messenger { $this->queue->put('jabber', array( 'addresses' => $addresses, - 'subject' => htmlentities($this->subject), - 'msg' => htmlentities($this->msg)) + 'subject' => $this->subject, + 'msg' => $this->msg) ); } unset($addresses); @@ -417,8 +462,7 @@ class messenger /** * @package phpBB3 -* Queue -* At the moment it is only handling the email queue +* handling email and jabber queue */ class queue { @@ -427,6 +471,9 @@ class queue var $package_size = 0; var $cache_file = ''; + /** + * constructor + */ function queue() { global $phpEx, $phpbb_root_path; @@ -434,7 +481,10 @@ class queue $this->data = array(); $this->cache_file = "{$phpbb_root_path}cache/queue.$phpEx"; } - + + /** + * Init a queue object + */ function init($object, $package_size) { $this->data[$object] = array(); @@ -442,12 +492,18 @@ class queue $this->data[$object]['data'] = array(); } + /** + * Put object in queue + */ function put($object, $scope) { $this->data[$object]['data'][] = $scope; } - // Using lock file... + /** + * Process queue + * Using lock file + */ function process() { global $db, $config, $phpEx, $phpbb_root_path; @@ -599,6 +655,9 @@ class queue @unlink($this->cache_file . '.lock'); } + /** + * Save queue + */ function save() { if (!sizeof($this->data)) @@ -634,6 +693,10 @@ class queue } } + /** + * Format array + * @private + */ function format_array($array) { $lines = array(); @@ -703,13 +766,13 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers if (trim($subject) == '') { - $err_msg = 'No email Subject specified'; + $err_msg = (isset($user->lang['NO_EMAIL_SUBJECT'])) ? $user->lang['NO_EMAIL_SUBJECT'] : 'No email subject specified'; return false; } if (trim($message) == '') { - $err_msg = 'Email message was blank'; + $err_msg = (isset($user->lang['NO_EMAIL_MESSAGE'])) ? $user->lang['NO_EMAIL_MESSAGE'] : 'Email message was blank'; return false; } @@ -741,11 +804,10 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers $smtp = new smtp_class; - // Ok we have error checked as much as we can to this point let's get on - // it already. + // 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)) { - $err_msg = "Could not connect to smtp host : $errno : $errstr"; + $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 false; } @@ -807,7 +869,8 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers if (!$rcpt) { $user->session_begin(); - $err_msg .= '<br /><br />' . sprintf($user->lang['INVALID_EMAIL_LOG'], htmlspecialchars($mail_to_address)); + $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(); return false; } @@ -870,7 +933,9 @@ class smtp_class var $commands = array(); var $numeric_response_code = 0; - // Send command to smtp server + /** + * Send command to smtp server + */ function server_send($command) { fputs($this->socket, $command . "\r\n"); @@ -878,9 +943,13 @@ class smtp_class // We could put additional code here } - // We use the line to give the support people an indication at which command the error occurred + /** + * We use the line to give the support people an indication at which command the error occurred + */ function server_parse($response, $line) { + global $user; + $this->server_response = ''; $this->responses = array(); $this->numeric_response_code = 0; @@ -889,7 +958,7 @@ class smtp_class { if (!($this->server_response = fgets($this->socket, 256))) { - return 'Could not get mail server response codes'; + return (isset($user->lang['NO_EMAIL_RESPONSE_CODE'])) ? $user->lang['NO_EMAIL_RESPONSE_CODE'] : 'Could not get mail server response codes'; } $this->responses[] = substr(rtrim($this->server_response), 4); $this->numeric_response_code = (int) substr($this->server_response, 0, 3); @@ -898,18 +967,23 @@ class smtp_class if (!(substr($this->server_response, 0, 3) == $response)) { $this->numeric_response_code = (int) substr($this->server_response, 0, 3); - return "Ran into problems sending Mail at <b>Line $line</b>. Response: $this->server_response"; + return (isset($user->lang['EMAIL_SMTP_ERROR_RESPONSE'])) ? sprintf($user->lang['EMAIL_SMTP_ERROR_RESPONSE'], $line, $this->server_response) : "Ran into problems sending Mail at <strong>Line $line</strong>. Response: $this->server_response"; } return 0; } + /** + * Close session + */ function close_session() { fclose($this->socket); } - // Log into server and get possible auth codes if neccessary + /** + * Log into server and get possible auth codes if neccessary + */ function log_into_server($hostname, $username, $password, $default_auth_method) { global $user; @@ -960,7 +1034,7 @@ class smtp_class if (!isset($this->commands['AUTH'])) { - return 'SMTP server does not support authentication'; + return (isset($user->lang['SMTP_NO_AUTH_SUPPORT'])) ? $user->lang['SMTP_NO_AUTH_SUPPORT'] : 'SMTP server does not support authentication'; } // Get best authentication method @@ -988,23 +1062,28 @@ class smtp_class if (!$method) { - return 'No supported authentication methods'; + return (isset($user->lang['NO_SUPPORTED_AUTH_METHODS'])) ? $user->lang['NO_SUPPORTED_AUTH_METHODS'] : 'No supported authentication methods'; } $method = strtolower(str_replace('-', '_', $method)); return $this->$method($username, $password); } + /** + * Pop before smtp authentication + */ function pop_before_smtp($hostname, $username, $password) { + global $user; + $old_socket = $this->socket; - + if (!$this->socket = fsockopen($hostname, 110, $errno, $errstr, 20)) { $this->socket = $old_socket; - return "Could not connect to smtp host : $errno : $errstr"; + 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') { @@ -1025,7 +1104,10 @@ class smtp_class return false; } - + + /** + * Plain authentication method + */ function plain($username, $password) { $this->server_send('AUTH PLAIN'); @@ -1044,6 +1126,9 @@ class smtp_class return false; } + /** + * Login authentication method + */ function login($username, $password) { $this->server_send('AUTH LOGIN'); @@ -1067,7 +1152,9 @@ class smtp_class return false; } - // The last two authentication mechanisms are a little bit tricky... + /** + * cram_md5 authentication method + */ function cram_md5($username, $password) { $this->server_send('AUTH CRAM-MD5'); @@ -1091,10 +1178,13 @@ class smtp_class return false; } - // A real pain in the *** + /** + * digest_md5 authentication method + * A real pain in the *** + */ function digest_md5($username, $password) { - global $config; + global $config, $user; $this->server_send('AUTH DIGEST-MD5'); if ($err_msg = $this->server_parse('334', __LINE__)) @@ -1179,9 +1269,9 @@ class smtp_class } else { - return 'Invalid digest challenge'; + return (isset($user->lang['INVALID_DIGEST_CHALLENGE'])) ? $user->lang['INVALID_DIGEST_CHALLENGE'] : 'Invalid digest challenge'; } - + $base64_method_digest_md5 = base64_encode($input_string); $this->server_send($base64_method_digest_md5); if ($err_msg = $this->server_parse('334', __LINE__)) @@ -1194,7 +1284,7 @@ class smtp_class { return $err_msg; } - + return false; } } diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index e1a629ca7c..6f45db1538 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -14,23 +14,15 @@ */ class p_master { - /**#@+ - * @access private - */ var $p_id; var $p_class; var $p_name; var $p_mode; var $p_parent; - var $acl_forup_id = false; - /**#@-*/ + var $acl_forum_id = false; - /**#@+ - * This array holds information on the list of modules - */ var $module_ary = array(); - /**#@-*/ /** * List modules @@ -40,8 +32,6 @@ class p_master * $this->module_y_ary is created with indentation information for * displaying the module list appropriately. Only modules for which * the user has access rights are included in these lists. - * - * @final */ function list_modules($p_class) { @@ -238,7 +228,7 @@ class p_master } $is_auth = false; - eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z_]+)#', '#cfg_([a-z_]+)#'), array('(int) $auth->acl_get("\\1"\\2)', '(int) $this->acl_forup_id', '(int) $auth->acl_getf_global("\\1")', '(int) $config["\\1"]'), $module_auth) . ');'); + eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z_]+)#', '#cfg_([a-z_]+)#'), array('(int) $auth->acl_get("\\1"\\2)', '(int) $this->acl_forum_id', '(int) $auth->acl_getf_global("\\1")', '(int) $config["\\1"]'), $module_auth) . ');'); return $is_auth; } @@ -300,12 +290,10 @@ class p_master * Loads currently active module * * This method loads a given module, passing it the relevant id and mode. - * - * @final */ function load_active($mode = false, $module_url = false, $execute_module = true) { - global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $user; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user; $module_path = $phpbb_root_path . 'includes/' . $this->p_class; $icat = request_var('icat', ''); @@ -339,7 +327,7 @@ class p_master if (defined('IN_ADMIN')) { // Not being able to overwrite ;) - $this->module->u_action = "{$phpbb_admin_path}index.$phpEx$SID" . (($icat) ? '&icat=' . $icat : '') . "&i={$this->p_id}&mode={$this->p_mode}"; + $this->module->u_action = append_sid("{$phpbb_admin_path}index.$phpEx", "i={$this->p_id}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}"; } else { @@ -350,10 +338,10 @@ class p_master } else { - $this->module->u_action = "{$user->page['script_path']}/{$user->page['page_name']}"; + $this->module->u_action = $phpbb_root_path . (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name']; } - $this->module->u_action .= $SID . (($icat) ? '&icat=' . $icat : '') . "&i={$this->p_id}&mode={$this->p_mode}"; + $this->module->u_action = append_sid($this->module->u_action, "i={$this->p_id}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}"; } // Assign the module path for re-usage @@ -414,7 +402,7 @@ class p_master } break; } - + return $branch; } @@ -434,7 +422,7 @@ class p_master { // Go through the tree to find our branch $parent_tree = $parents[$row['module_id']]; - + foreach ($parent_tree as $id => $value) { if (!isset($branch[$id]) && isset($branch['child'])) @@ -452,7 +440,7 @@ class p_master $branch[$row['module_id']]['child'] = array(); } } - + return $tree; } diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 914e4bd7a8..53f11651a3 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -13,7 +13,7 @@ */ function generate_smilies($mode, $forum_id) { - global $SID, $auth, $db, $user, $config, $template; + global $auth, $db, $user, $config, $template; global $phpEx, $phpbb_root_path; if ($mode == 'window') @@ -85,7 +85,7 @@ function generate_smilies($mode, $forum_id) { $template->assign_vars(array( 'S_SHOW_SMILEY_LINK' => true, - 'U_MORE_SMILIES' => $phpbb_root_path . "posting.$phpEx$SID&mode=smilies&f=$forum_id") + 'U_MORE_SMILIES' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&f=' . $forum_id)) ); } @@ -197,7 +197,7 @@ function posting_gen_topic_icons($mode, $icon_id) { $template->assign_var('S_NO_ICON_CHECKED', ' checked="checked"'); } - + if (sizeof($icons)) { foreach ($icons as $id => $data) @@ -208,7 +208,7 @@ function posting_gen_topic_icons($mode, $icon_id) 'ICON_ID' => $id, 'ICON_IMG' => $phpbb_root_path . $config['icons_path'] . '/' . $data['img'], 'ICON_WIDTH' => $data['width'], - 'ICON_HEIGHT' => $data['height'], + 'ICON_HEIGHT' => $data['height'], 'S_CHECKED' => ($id == $icon_id) ? true : false, 'S_ICON_CHECKED' => ($id == $icon_id) ? ' checked="checked"' : '') @@ -236,9 +236,9 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) 'announce' => array('const' => POST_ANNOUNCE, 'lang' => 'POST_ANNOUNCEMENT'), 'global' => array('const' => POST_GLOBAL, 'lang' => 'POST_GLOBAL') ); - + $topic_type_array = array(); - + foreach ($topic_types as $auth_key => $topic_value) { // We do not have a special post global announcement permission @@ -262,7 +262,7 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) 'VALUE' => POST_NORMAL, 'S_CHECKED' => ($topic_type == POST_NORMAL) ? ' checked="checked"' : '', 'L_TOPIC_TYPE' => $user->lang['POST_NORMAL'])), - + $topic_type_array ); @@ -291,15 +291,15 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false) { global $auth, $user, $config, $db, $cache; - global $phpbb_root_path; + global $phpbb_root_path, $phpEx; $filedata = array( 'error' => array() ); - include_once($phpbb_root_path . 'includes/functions_upload.php'); + include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx); $upload = new fileupload(); - + if (!$local) { $filedata['post_attach'] = ($upload->is_valid($form_name)) ? true : false; @@ -344,10 +344,10 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage $allowed_filesize = ($extensions[$file->get('extension')]['max_filesize'] != 0) ? $extensions[$file->get('extension')]['max_filesize'] : (($is_message) ? $config['max_filesize_pm'] : $config['max_filesize']); $file->upload->set_max_filesize($allowed_filesize); } - + $file->clean_filename('unique', $user->data['user_id'] . '_'); $file->move_file($config['upload_path']); - + if (sizeof($file->error)) { $file->remove(); @@ -387,7 +387,7 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage $filedata['post_attach'] = false; $file->remove(); - + return $filedata; } } @@ -421,8 +421,8 @@ function get_img_size_format($width, $height) round($width * ($max_width / $width)), round($height * ($max_width / $width)) ); - } - else + } + else { return array( round($width * ($max_width / $height)), @@ -456,11 +456,11 @@ function get_supported_image_types($type = false) case 12: $new_type = ($format & IMG_JPG) ? IMG_JPG : 0; break; - + case 3: $new_type = ($format & IMG_PNG) ? IMG_PNG : 0; break; - + case 6: case 15: $new_type = ($format & IMG_WBMP) ? IMG_WBMP : 0; @@ -480,7 +480,7 @@ function get_supported_image_types($type = false) } } } - + return array( 'gd' => ($new_type) ? true : false, 'format' => $new_type, @@ -541,11 +541,11 @@ function create_thumbnail($source, $destination, $mimetype) case IMG_JPG: $image = imagecreatefromjpeg($source); break; - + case IMG_PNG: $image = imagecreatefrompng($source); break; - + case IMG_WBMP: $image = imagecreatefromwbmp($source); break; @@ -561,21 +561,21 @@ function create_thumbnail($source, $destination, $mimetype) $new_image = imagecreatetruecolor($new_width, $new_height); imagecopyresampled($new_image, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); } - + switch ($type['format']) { case IMG_GIF: imagegif($new_image, $destination); break; - + case IMG_JPG: imagejpeg($new_image, $destination, 90); break; - + case IMG_PNG: imagepng($new_image, $destination); break; - + case IMG_WBMP: imagewbmp($new_image, $destination); break; @@ -605,7 +605,7 @@ function posting_gen_inline_attachments(&$attachment_data) if (sizeof($attachment_data)) { $s_inline_attachment_options = ''; - + foreach ($attachment_data as $i => $attachment) { $s_inline_attachment_options .= '<option value="' . $i . '">' . $attachment['real_filename'] . '</option>'; @@ -624,8 +624,8 @@ function posting_gen_inline_attachments(&$attachment_data) */ function posting_gen_attachment_entry(&$attachment_data, &$filename_data) { - global $template, $config, $phpbb_root_path, $SID, $phpEx; - + global $template, $config, $phpbb_root_path, $phpEx; + $template->assign_vars(array( 'S_SHOW_ATTACH_BOX' => true) ); @@ -635,20 +635,20 @@ function posting_gen_attachment_entry(&$attachment_data, &$filename_data) $template->assign_vars(array( 'S_HAS_ATTACHMENTS' => true) ); - + $count = 0; foreach ($attachment_data as $attach_row) { $hidden = ''; - $attach_row['real_filename'] = stripslashes(basename($attach_row['real_filename'])); + $attach_row['real_filename'] = basename($attach_row['real_filename']); foreach ($attach_row as $key => $value) { $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']) : $phpbb_root_path . "download.$phpEx$SID&id=" . intval($attach_row['attach_id']); - + + $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']); + $template->assign_block_vars('attach_row', array( 'FILENAME' => basename($attach_row['real_filename']), 'ATTACH_FILENAME' => basename($attach_row['physical_filename']), @@ -682,7 +682,7 @@ function posting_gen_attachment_entry(&$attachment_data, &$filename_data) function load_drafts($topic_id = 0, $forum_id = 0, $id = 0) { global $user, $db, $template, $auth; - global $phpbb_root_path, $phpEx, $SID; + global $phpbb_root_path, $phpEx; $topic_ids = $forum_ids = $draft_rows = array(); @@ -695,8 +695,8 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0) else { $sql_and = ''; - $sql_and .= ($forum_id) ? ' AND d.forum_id = ' . $forum_id : ''; - $sql_and .= ($topic_id) ? ' AND d.topic_id = ' . $topic_id : ''; + $sql_and .= ($forum_id) ? ' AND d.forum_id = ' . (int) $forum_id : ''; + $sql_and .= ($topic_id) ? ' AND d.topic_id = ' . (int) $topic_id : ''; } $sql = 'SELECT d.*, f.forum_id, f.forum_name @@ -748,24 +748,24 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0) if (isset($topic_rows[$draft['topic_id']]) && $auth->acl_get('f_read', $topic_rows[$draft['topic_id']]['forum_id'])) { $link_topic = true; - $view_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $topic_rows[$draft['topic_id']]['forum_id'] . "&t=" . $draft['topic_id']; + $view_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id']); $title = $topic_rows[$draft['topic_id']]['topic_title']; - $insert_url = "{$phpbb_root_path}posting.$phpEx$SID&f=" . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id']; + $insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id']); } else if ($draft['forum_id'] && $auth->acl_get('f_read', $draft['forum_id'])) { $link_forum = true; - $view_url = "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $draft['forum_id']; + $view_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $draft['forum_id']); $title = $draft['forum_name']; - $insert_url = "{$phpbb_root_path}posting.$phpEx$SID&f=" . $draft['forum_id'] . '&mode=post&d=' . $draft['draft_id']; + $insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $draft['forum_id'] . '&mode=post&d=' . $draft['draft_id']); } else { // Either display as PM draft if forum_id and topic_id are empty or if access to the forums has been denied afterwards... $link_pm = true; - $insert_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=compose&d=" . $draft['draft_id']; + $insert_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=compose&d={$draft['draft_id']}"); } $template->assign_block_vars('draftrow', array( @@ -790,7 +790,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0) function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true) { global $user, $auth, $db, $template, $bbcode; - global $config, $phpbb_root_path, $phpEx, $SID; + global $config, $phpbb_root_path, $phpEx; // Go ahead and pull all data for this topic $sql = 'SELECT u.username, u.user_id, p.* @@ -820,7 +820,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id // Instantiate BBCode class if (!isset($bbcode) && $bbcode_bitfield) { - include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); + include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); $bbcode = new bbcode($bbcode_bitfield); } @@ -857,8 +857,8 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id 'MESSAGE' => str_replace("\n", '<br />', $message), 'U_POST_ID' => $row['post_id'], - 'U_MINI_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&p=" . $row['post_id'] . '#p' . $row['post_id'], - 'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=main&mode=post_details&p=" . $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&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) . "')" : '') ); unset($rowset[$i]); @@ -937,7 +937,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id ); } $db->sql_freeresult($result); - + // forum notification is sent to those not already receiving topic notifications if ($topic_notification) { @@ -1047,8 +1047,8 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id '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", 'U_NEWEST_POST' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&p=$post_id&e=$post_id", - 'U_STOP_WATCHING_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&unwatch=topic", - 'U_STOP_WATCHING_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id&unwatch=forum", + 'U_STOP_WATCHING_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id&unwatch=topic", + 'U_STOP_WATCHING_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id&unwatch=forum", )); $messenger->send($addr['method']); @@ -1061,37 +1061,41 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id } // Handle the DB updates - $db->sql_transaction(); + $db->sql_transaction('begin'); if (!empty($update_notification['topic'])) { - $db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . " + $sql = 'UPDATE ' . TOPICS_WATCH_TABLE . " SET notify_status = 1 WHERE topic_id = $topic_id - AND user_id IN (" . implode(', ', $update_notification['topic']) . ")"); + AND user_id IN (" . implode(', ', $update_notification['topic']) . ")"; + $db->sql_query($sql); } if (!empty($update_notification['forum'])) { - $db->sql_query('UPDATE ' . FORUMS_WATCH_TABLE . " + $sql = 'UPDATE ' . FORUMS_WATCH_TABLE . " SET notify_status = 1 WHERE forum_id = $forum_id - AND user_id IN (" . implode(', ', $update_notification['forum']) . ")"); + AND user_id IN (" . implode(', ', $update_notification['forum']) . ")"; + $db->sql_query($sql); } // Now delete the user_ids not authorized to receive notifications on this topic/forum if (!empty($delete_ids['topic'])) { - $db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . " + $sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . " WHERE topic_id = $topic_id - AND user_id IN (" . implode(', ', $delete_ids['topic']) . ")"); + AND user_id IN (" . implode(', ', $delete_ids['topic']) . ")"; + $db->sql_query($sql); } if (!empty($delete_ids['forum'])) { - $db->sql_query('DELETE FROM ' . FORUMS_WATCH_TABLE . " + $sql = 'DELETE FROM ' . FORUMS_WATCH_TABLE . " WHERE forum_id = $forum_id - AND user_id IN (" . implode(', ', $delete_ids['forum']) . ")"); + AND user_id IN (" . implode(', ', $delete_ids['forum']) . ")"; + $db->sql_query($sql); } $db->sql_transaction('commit'); @@ -1107,7 +1111,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id function delete_post($forum_id, $topic_id, $post_id, &$data) { global $db, $user, $auth; - global $config, $phpEx, $SID, $phpbb_root_path; + global $config, $phpEx, $phpbb_root_path; // Specify our post mode $post_mode = ($data['topic_first_post_id'] == $data['topic_last_post_id']) ? 'delete_topic' : (($data['topic_first_post_id'] == $post_id) ? 'delete_first_post' : (($data['topic_last_post_id'] == $post_id) ? 'delete_last_post' : 'delete')); @@ -1116,7 +1120,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); - $db->sql_transaction(); + $db->sql_transaction('begin'); if (!delete_posts('post_id', array($post_id), false, false)) { @@ -1150,7 +1154,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) $sql_data[FORUMS_TABLE] .= ($sql_data[FORUMS_TABLE]) ? ', ' : ''; $sql_data[FORUMS_TABLE] .= implode(', ', $update_sql[$forum_id]); } - + $sql_data[TOPICS_TABLE] = 'topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : ''); break; @@ -1187,7 +1191,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) $sql_data[FORUMS_TABLE] .= ($sql_data[FORUMS_TABLE]) ? ', ' : ''; $sql_data[FORUMS_TABLE] .= implode(', ', $update_sql[$forum_id]); } - + $sql_data[TOPICS_TABLE] = 'topic_bumped = 0, topic_bumper = 0, topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : ''); $update_sql = update_post_information('topic', $topic_id, true); @@ -1234,7 +1238,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) $sql_data[USERS_TABLE] = ($auth->acl_get('f_postcount', $forum_id)) ? 'user_posts = user_posts - 1' : ''; set_config('num_posts', $config['num_posts'] - 1, true); - $db->sql_transaction(); + $db->sql_transaction('begin'); $where_sql = array( FORUMS_TABLE => "forum_id = $forum_id", @@ -1281,7 +1285,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) */ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true) { - global $db, $auth, $user, $config, $phpEx, $SID, $template, $phpbb_root_path; + global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path; // We do not handle erasing posts here if ($mode == 'delete') @@ -1316,19 +1320,19 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u case 'post': case 'reply': $sql_data[POSTS_TABLE]['sql'] = array( - 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], - 'poster_id' => (int) $user->data['user_id'], + 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], + 'poster_id' => (int) $user->data['user_id'], 'icon_id' => $data['icon_id'], - 'poster_ip' => $user->ip, + 'poster_ip' => $user->ip, 'post_time' => $current_time, - 'post_approved' => ($auth->acl_get('f_moderate', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1, - 'enable_bbcode' => $data['enable_bbcode'], - 'enable_smilies' => $data['enable_smilies'], - 'enable_magic_url' => $data['enable_urls'], - 'enable_sig' => $data['enable_sig'], + 'post_approved' => (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1, + 'enable_bbcode' => $data['enable_bbcode'], + 'enable_smilies' => $data['enable_smilies'], + 'enable_magic_url' => $data['enable_urls'], + 'enable_sig' => $data['enable_sig'], 'post_username' => (!$user->data['is_registered']) ? $username : '', 'post_subject' => $subject, - 'post_text' => $data['message'], + '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, @@ -1340,7 +1344,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u case 'edit_first_post': case 'edit': - + if (!$auth->acl_gets('m_', 'a_') || $data['post_edit_reason']) { $sql_data[POSTS_TABLE]['sql'] = array( @@ -1370,14 +1374,14 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u } $sql_data[POSTS_TABLE]['sql'] = array_merge($sql_data[POSTS_TABLE]['sql'], array( - 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], - 'poster_id' => $data['poster_id'], + 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], + 'poster_id' => $data['poster_id'], 'icon_id' => $data['icon_id'], - 'post_approved' => ($auth->acl_get('f_moderate', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1, - 'enable_bbcode' => $data['enable_bbcode'], - 'enable_smilies' => $data['enable_smilies'], - 'enable_magic_url' => $data['enable_urls'], - 'enable_sig' => $data['enable_sig'], + 'post_approved' => (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1, + 'enable_bbcode' => $data['enable_bbcode'], + 'enable_smilies' => $data['enable_smilies'], + 'enable_magic_url' => $data['enable_urls'], + 'enable_sig' => $data['enable_sig'], 'post_username' => ($username && $data['poster_id'] == ANONYMOUS) ? $username : '', 'post_subject' => $subject, 'post_edit_reason' => $data['post_edit_reason'], @@ -1405,10 +1409,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $sql_data[TOPICS_TABLE]['sql'] = array( 'topic_poster' => (int) $user->data['user_id'], 'topic_time' => $current_time, - 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], + 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], 'icon_id' => $data['icon_id'], - 'topic_approved' => ($auth->acl_get('f_moderate', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1, - 'topic_title' => $subject, + '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_type' => $topic_type, 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, @@ -1430,19 +1434,19 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u if ($topic_type != POST_GLOBAL) { - if (!$auth->acl_get('f_moderate', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) + if ($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) { $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts + 1'; } - $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_real = forum_topics_real + 1' . ((!$auth->acl_get('f_moderate', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) ? ', forum_topics = forum_topics + 1' : ''); + $sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics_real = forum_topics_real + 1' . (($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) ? ', forum_topics = forum_topics + 1' : ''); } break; case 'reply': - $sql_data[TOPICS_TABLE]['stat'][] = 'topic_replies_real = topic_replies_real + 1, topic_bumped = 0, topic_bumper = 0' . ((!$auth->acl_get('f_moderate', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) ? ', topic_replies = topic_replies + 1' : ''); + $sql_data[TOPICS_TABLE]['stat'][] = 'topic_replies_real = topic_replies_real + 1, topic_bumped = 0, topic_bumper = 0' . (($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) ? ', topic_replies = topic_replies + 1' : ''); $sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id'])) ? ', user_posts = user_posts + 1' : ''); - if ((!$auth->acl_get('f_moderate', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) && $topic_type != POST_GLOBAL) + if (($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) && $topic_type != POST_GLOBAL) { $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts + 1'; } @@ -1452,10 +1456,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u case 'edit_first_post': $sql_data[TOPICS_TABLE]['sql'] = array( - 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], + 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], 'icon_id' => $data['icon_id'], - 'topic_approved' => ($auth->acl_get('f_moderate', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1, - 'topic_title' => $subject, + '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' => $username, 'topic_type' => $topic_type, 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, @@ -1470,7 +1474,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u break; } - $db->sql_transaction(); + $db->sql_transaction('begin'); // Submit new topic if ($post_mode == 'post') @@ -1565,17 +1569,19 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u // Update the topics table if (isset($sql_data[TOPICS_TABLE]['sql'])) { - $db->sql_query('UPDATE ' . TOPICS_TABLE . ' + $sql = 'UPDATE ' . TOPICS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_data[TOPICS_TABLE]['sql']) . ' - WHERE topic_id = ' . $data['topic_id']); + WHERE topic_id = ' . $data['topic_id']; + $db->sql_query($sql); } // Update the posts table if (isset($sql_data[POSTS_TABLE]['sql'])) { - $db->sql_query('UPDATE ' . POSTS_TABLE . ' + $sql = 'UPDATE ' . POSTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_data[POSTS_TABLE]['sql']) . ' - WHERE post_id = ' . $data['post_id']); + WHERE post_id = ' . $data['post_id']; + $db->sql_query($sql); } // Update Poll Tables @@ -1672,7 +1678,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u { continue; } - + $attach_sql = array( 'post_msg_id' => $data['post_id'], 'topic_id' => $data['topic_id'], @@ -1753,7 +1759,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u } // Update total post count, do not consider moderated posts/topics - if (!$auth->acl_get('f_moderate', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) + if ($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) { if ($post_mode == 'post') { @@ -1768,7 +1774,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u } // Update forum stats - $db->sql_transaction(); + $db->sql_transaction('begin'); $where_sql = array(POSTS_TABLE => 'post_id = ' . $data['post_id'], TOPICS_TABLE => 'topic_id = ' . $data['topic_id'], FORUMS_TABLE => 'forum_id = ' . $data['forum_id'], USERS_TABLE => 'user_id = ' . $user->data['user_id']); @@ -1783,26 +1789,27 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u // Delete topic shadows (if any exist). We do not need a shadow topic for an global announcement if ($make_global) { - $db->sql_query('DELETE FROM ' . TOPICS_TABLE . ' - WHERE topic_moved_id = ' . $data['topic_id']); + $sql = 'DELETE FROM ' . TOPICS_TABLE . ' + WHERE topic_moved_id = ' . $data['topic_id']; + $db->sql_query($sql); } // Index message contents if ($update_message && $data['enable_indexing']) { // Select the search method and do some additional checks to ensure it can actually be utilised - $search_type = $config['search_type']; - + $search_type = basename($config['search_type']); + if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) { trigger_error('NO_SUCH_SEARCH_MODULE'); } - + require("{$phpbb_root_path}includes/search/$search_type.$phpEx"); $error = false; $search = new $search_type($error); - + if ($error) { trigger_error($error); @@ -1817,7 +1824,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $draft_id = request_var('draft_loaded', 0); if ($draft_id) { - $db->sql_query('DELETE FROM ' . DRAFTS_TABLE . " WHERE draft_id = $draft_id AND user_id = " . $user->data['user_id']); + $sql = 'DELETE FROM ' . DRAFTS_TABLE . " + WHERE draft_id = $draft_id + AND user_id = {$user->data['user_id']}"; + $db->sql_query($sql); } // Topic Notification, do not change if moderator is changing other users posts... @@ -1849,18 +1859,18 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u markread('topic', $data['forum_id'], $data['topic_id'], time()); // Send Notifications - if ($mode != 'edit' && $mode != 'delete' && (!$auth->acl_get('f_moderate', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id']))) + if ($mode != 'edit' && $mode != 'delete' && ($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id']))) { user_notification($mode, $subject, $data['topic_title'], $data['forum_name'], $data['forum_id'], $data['topic_id'], $data['post_id']); } if ($mode == 'post') { - $url = (!$auth->acl_get('f_moderate', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) ? "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $data['forum_id'] . '&t=' . $data['topic_id'] : "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $data['forum_id']; + $url = ($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $data['forum_id'] . '&t=' . $data['topic_id']) : append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $data['forum_id']); } else { - $url = (!$auth->acl_get('f_moderate', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) ? "{$phpbb_root_path}viewtopic.$phpEx$SID&f={$data['forum_id']}&t={$data['topic_id']}&p={$data['post_id']}#p{$data['post_id']}" : "{$phpbb_root_path}viewtopic.$phpEx$SID&f={$data['forum_id']}&t={$data['topic_id']}"; + $url = ($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$data['forum_id']}&t={$data['topic_id']}&p={$data['post_id']}") . "#p{$data['post_id']}" : append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$data['forum_id']}&t={$data['topic_id']}"); } return $url; diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index ebbb119851..25b8ee8fbb 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -20,25 +20,25 @@ if (!defined('IN_PHPBB')) 1) Add an appropiate constant 2) Add a new check array to the global_privmsgs_rules variable and the condition array (if one is required) 3) Add a new language variable to ucp.php - + The user is then able to select the new rule. It will be checked against and handled as specified. To add new actions (yes, checks can be added here too) to the rule management, the core code has to be modified. */ -define('RULE_IS_LIKE', 1); // Is Like -define('RULE_IS_NOT_LIKE', 2); // Is Not Like -define('RULE_IS', 3); // Is -define('RULE_IS_NOT', 4); // Is Not -define('RULE_BEGINS_WITH', 5); // Begins with -define('RULE_ENDS_WITH', 6); // Ends with -define('RULE_IS_FRIEND', 7); // Is Friend -define('RULE_IS_FOE', 8); // Is Foe -define('RULE_IS_USER', 9); // Is User -define('RULE_IS_GROUP', 10); // Is In Usergroup -define('RULE_ANSWERED', 11); // Answered -define('RULE_FORWARDED', 12); // Forwarded -define('RULE_TO_GROUP', 14); // Usergroup -define('RULE_TO_ME', 15); // Me +define('RULE_IS_LIKE', 1); // Is Like +define('RULE_IS_NOT_LIKE', 2); // Is Not Like +define('RULE_IS', 3); // Is +define('RULE_IS_NOT', 4); // Is Not +define('RULE_BEGINS_WITH', 5); // Begins with +define('RULE_ENDS_WITH', 6); // Ends with +define('RULE_IS_FRIEND', 7); // Is Friend +define('RULE_IS_FOE', 8); // Is Foe +define('RULE_IS_USER', 9); // Is User +define('RULE_IS_GROUP', 10); // Is In Usergroup +define('RULE_ANSWERED', 11); // Answered +define('RULE_FORWARDED', 12); // Forwarded +define('RULE_TO_GROUP', 14); // Usergroup +define('RULE_TO_ME', 15); // Me define('ACTION_PLACE_INTO_FOLDER', 1); define('ACTION_MARK_AS_READ', 2); @@ -51,6 +51,10 @@ define('CHECK_MESSAGE', 3); define('CHECK_STATUS', 4); define('CHECK_TO', 5); +/** +* Global private message rules +* These rules define what to do if a rule is hit +*/ $global_privmsgs_rules = array( CHECK_SUBJECT => array( RULE_IS_LIKE => array('check0' => 'message_subject', 'function' => 'preg_match("/" . preg_quote({STRING}, "/") . "/i", {CHECK0})'), @@ -71,23 +75,25 @@ $global_privmsgs_rules = array( RULE_IS_FOE => array('check0' => 'foe', 'function' => '{CHECK0} == 1'), RULE_IS_USER => array('check0' => 'author_id', 'function' => '{CHECK0} == {USER_ID}'), RULE_IS_GROUP => array('check0' => 'author_in_group', 'function' => 'in_array({GROUP_ID}, {CHECK0})')), - + CHECK_MESSAGE => array( RULE_IS_LIKE => array('check0' => 'message_text', 'function' => 'preg_match("/" . preg_quote({STRING}, "/") . "/i", {CHECK0})'), RULE_IS_NOT_LIKE => array('check0' => 'message_text', 'function' => '!(preg_match("/" . preg_quote({STRING}, "/") . "/i", {CHECK0}))'), RULE_IS => array('check0' => 'message_text', 'function' => '{CHECK0} == {STRING}'), RULE_IS_NOT => array('check0' => 'message_text', 'function' => '{CHECK0} != {STRING}')), - + CHECK_STATUS => array( RULE_ANSWERED => array('check0' => 'replied', 'function' => '{CHECK0} == 1'), RULE_FORWARDED => array('check0' => 'forwarded', 'function' => '{CHECK0} == 1')), - + CHECK_TO => array( RULE_TO_GROUP => array('check0' => 'to', 'check1' => 'bcc', 'check2' => 'user_in_group', 'function' => 'in_array("g_" . {CHECK2}, {CHECK0}) || in_array("g_" . {CHECK2}, {CHECK1})'), RULE_TO_ME => array('check0' => 'to', 'check1' => 'bcc', 'function' => 'in_array("u_" . $user_id, {CHECK0}) || in_array("u_" . $user_id, {CHECK1})')) ); -// This is for defining which condition fields to show for which Rule +/** +* This is for defining which condition fields to show for which Rule +*/ $global_rule_conditions = array( RULE_IS_LIKE => 'text', RULE_IS_NOT_LIKE => 'text', @@ -105,7 +111,7 @@ $global_rule_conditions = array( function get_folder($user_id, $folder_id = false) { global $db, $user, $template; - global $phpbb_root_path, $phpEx, $SID; + global $phpbb_root_path, $phpEx; $folder = array(); @@ -143,23 +149,40 @@ function get_folder($user_id, $folder_id = false) // Adjust unread status for outbox $num_unread[PRIVMSGS_OUTBOX] = $num_messages[PRIVMSGS_OUTBOX]; - - $folder[PRIVMSGS_INBOX] = array('folder_name' => $user->lang['PM_INBOX'], 'num_messages' => $num_messages[PRIVMSGS_INBOX], 'unread_messages' => $num_unread[PRIVMSGS_INBOX]); + + $folder[PRIVMSGS_INBOX] = array( + 'folder_name' => $user->lang['PM_INBOX'], + 'num_messages' => $num_messages[PRIVMSGS_INBOX], + 'unread_messages' => $num_unread[PRIVMSGS_INBOX] + ); // Custom Folder $sql = 'SELECT folder_id, folder_name, pm_count FROM ' . PRIVMSGS_FOLDER_TABLE . " WHERE user_id = $user_id"; $result = $db->sql_query($sql); - + while ($row = $db->sql_fetchrow($result)) { - $folder[$row['folder_id']] = array('folder_name' => $row['folder_name'], 'num_messages' => $row['pm_count'], 'unread_messages' => ((isset($num_unread[$row['folder_id']])) ? $num_unread[$row['folder_id']] : 0)); + $folder[$row['folder_id']] = array( + 'folder_name' => $row['folder_name'], + 'num_messages' => $row['pm_count'], + 'unread_messages' => ((isset($num_unread[$row['folder_id']])) ? $num_unread[$row['folder_id']] : 0) + ); } $db->sql_freeresult($result); - $folder[PRIVMSGS_OUTBOX] = array('folder_name' => $user->lang['PM_OUTBOX'], 'num_messages' => $num_messages[PRIVMSGS_OUTBOX], 'unread_messages' => $num_unread[PRIVMSGS_OUTBOX]); - $folder[PRIVMSGS_SENTBOX] = array('folder_name' => $user->lang['PM_SENTBOX'], 'num_messages' => $num_messages[PRIVMSGS_SENTBOX], 'unread_messages' => $num_unread[PRIVMSGS_SENTBOX]); + $folder[PRIVMSGS_OUTBOX] = array( + 'folder_name' => $user->lang['PM_OUTBOX'], + 'num_messages' => $num_messages[PRIVMSGS_OUTBOX], + 'unread_messages' => $num_unread[PRIVMSGS_OUTBOX] + ); + + $folder[PRIVMSGS_SENTBOX] = array( + 'folder_name' => $user->lang['PM_SENTBOX'], + 'num_messages' => $num_messages[PRIVMSGS_SENTBOX], + 'unread_messages' => $num_unread[PRIVMSGS_SENTBOX] + ); // Define Folder Array for template designers (and for making custom folders usable by the template too) foreach ($folder as $f_id => $folder_ary) @@ -172,7 +195,7 @@ function get_folder($user_id, $folder_id = false) 'NUM_MESSAGES' => $folder_ary['num_messages'], 'UNREAD_MESSAGES' => $folder_ary['unread_messages'], - 'U_FOLDER' => ($f_id > 0) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder={$f_id}" : "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder={$folder_id_name}", + 'U_FOLDER' => ($f_id > 0) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $f_id) : append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $folder_id_name), 'S_CUR_FOLDER' => ($f_id === $folder_id) ? true : false, 'S_UNREAD_MESSAGES' => ($folder_ary['unread_messages']) ? true : false, @@ -184,13 +207,14 @@ function get_folder($user_id, $folder_id = false) } /** -* Delete Messages From Sentbox - we are doing this here because this saves us a bunch of checks and queries +* Delete Messages From Sentbox +* we are doing this here because this saves us a bunch of checks and queries */ function clean_sentbox($num_sentbox_messages) { global $db, $user, $config; - // Check Message Limit - + // Check Message Limit if ($user->data['message_limit'] && $num_sentbox_messages > $user->data['message_limit']) { // Delete old messages @@ -236,7 +260,7 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id) // Eval Statement $result = false; eval('$result = (' . $evaluate . ') ? true : false;'); - + if (!$result) { return false; @@ -284,7 +308,6 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) FROM ' . PRIVMSGS_RULES_TABLE . " WHERE user_id = $user_id"; $result = $db->sql_query($sql); - $user_rules = $db->sql_fetchrowset($result); $db->sql_freeresult($result); @@ -313,7 +336,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) } // Get those messages not yet placed into any box - // NOTE: Expand Group Information to all groups the user/author is in? + // @todo question: expand group information to all groups the user/author is in on private message folder?? (user_in_group) $sql = 'SELECT t.*, p.*, u.username, u.group_id as author_in_group FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . " u WHERE t.user_id = $user_id @@ -373,7 +396,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) $_folder_id = (int) $rule_ary['folder_id']; $move_into_folder[$_folder_id][] = $msg_id; $num_new++; - break; + break; case ACTION_MARK_AS_READ: if ($rule_ary['unread']) @@ -381,11 +404,11 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) $unread_ids[] = $msg_id; } $move_into_folder[PRIVMSGS_INBOX][] = $msg_id; - break; + break; case ACTION_DELETE_MESSAGE: $delete_ids[] = $msg_id; - break; + break; case ACTION_MARK_AS_IMPORTANT: if (!$rule_ary['important']) @@ -393,9 +416,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) $important_ids[] = $msg_id; } $move_into_folder[PRIVMSGS_INBOX][] = $msg_id; - break; - - default: + break; } } } @@ -585,7 +606,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_folder_id) { global $db, $user; - global $phpbb_root_path, $phpEx, $SID; + global $phpbb_root_path, $phpEx; $num_moved = 0; @@ -605,17 +626,18 @@ function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_fol WHERE folder_id = $dest_folder AND user_id = $user_id"; $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!($row = $db->sql_fetchrow($result))) + if (!$row) { trigger_error('NOT_AUTHORIZED'); } - $db->sql_freeresult($result); if ($row['pm_count'] + sizeof($move_msg_ids) > $message_limit) { $message = sprintf($user->lang['NOT_ENOUGH_SPACE_FOLDER'], $row['folder_name']) . '<br /><br />'; - $message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], "<a href=\"{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder={$row['folder_id']}\">", '</a>', $row['folder_name']); + $message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $row['folder_id']) . '">', '</a>', $row['folder_name']); trigger_error($message); } } @@ -632,7 +654,7 @@ function move_pm($user_id, $message_limit, $move_msg_ids, $dest_folder, $cur_fol if ($num_messages + sizeof($move_msg_ids) > $message_limit) { $message = sprintf($user->lang['NOT_ENOUGH_SPACE_FOLDER'], $user->lang['PM_INBOX']) . '<br /><br />'; - $message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], "<a href=\"{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox\">", '</a>', $user->lang['PM_INBOX']); + $message .= sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox') . '">', '</a>', $user->lang['PM_INBOX']); trigger_error($message); } } @@ -701,7 +723,7 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id) */ function handle_mark_actions($user_id, $mark_action) { - global $db, $user, $_POST, $phpbb_root_path, $SID, $phpEx; + global $db, $user, $_POST, $phpbb_root_path, $phpEx; $msg_ids = (isset($_POST['marked_msg_id'])) ? array_map('intval', $_POST['marked_msg_id']) : array(); $cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX); @@ -732,7 +754,7 @@ function handle_mark_actions($user_id, $mark_action) delete_pm($user_id, $msg_ids, $cur_folder_id); $success_msg = (sizeof($msg_ids) == 1) ? 'MESSAGE_DELETED' : 'MESSAGES_DELETED'; - $redirect = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=$cur_folder_id"; + $redirect = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $cur_folder_id); meta_refresh(3, $redirect); trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_FOLDER'], '<a href="' . $redirect . '">', '</a>')); @@ -865,7 +887,7 @@ function delete_pm($user_id, $msg_ids, $folder_id) $set_sql .= ($set_sql != '') ? ', ' : ''; $set_sql .= 'user_new_privmsg = user_new_privmsg - ' . $num_new; } - + $db->sql_query('UPDATE ' . USERS_TABLE . " SET $set_sql WHERE user_id = $user_id"); } @@ -912,7 +934,7 @@ function rebuild_header($check_ary) { ${$type}[] = (int) $match[2][$id]; } - + $_types = array('u', 'g'); foreach ($_types as $type) { @@ -930,14 +952,14 @@ function rebuild_header($check_ary) } /** -* Print out/Assign recipient informations +* Print out/assign recipient informations */ function write_pm_addresses($check_ary, $author_id, $plaintext = false) { - global $db, $user, $template, $phpbb_root_path, $SID, $phpEx; + global $db, $user, $template, $phpbb_root_path, $phpEx; $addresses = array(); - + foreach ($check_ary as $check_type => $address_field) { if (!is_array($address_field)) @@ -1020,7 +1042,7 @@ function write_pm_addresses($check_ary, $author_id, $plaintext = false) $address['group'][$row['group_id']] = array('name' => $row['group_name'], 'colour' => $row['group_colour']); } } - + if (isset($address['user'][$row['user_id']])) { $address['user'][$row['user_id']]['in_group'] = $row['group_id']; @@ -1044,7 +1066,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') ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $id : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=group&g=" . $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), 'TYPE' => $type) ); } @@ -1072,17 +1094,16 @@ function get_folder_status($folder_id, $folder) { return false; } - $return = array(); $return = array( 'folder_name' => $folder['folder_name'], 'cur' => $folder['num_messages'], 'remaining' => $user->data['message_limit'] - $folder['num_messages'], 'max' => $user->data['message_limit'], - 'percent' => ($user->data['message_limit'] > 0) ? round(($folder['num_messages'] / $user->data['message_limit']) * 100) : 100 - ); + 'percent' => ($user->data['message_limit'] > 0) ? round(($folder['num_messages'] / $user->data['message_limit']) * 100) : 100, - $return['message'] = sprintf($user->lang['FOLDER_STATUS_MSG'], $return['percent'], $return['cur'], $return['max']); + 'message' => sprintf($user->lang['FOLDER_STATUS_MSG'], $return['percent'], $return['cur'], $return['max']), + ); return $return; } @@ -1096,9 +1117,9 @@ function get_folder_status($folder_id, $folder) */ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = true) { - global $db, $auth, $config, $phpEx, $SID, $template, $user; + global $db, $auth, $config, $phpEx, $template, $user; - // We do not handle erasing posts here + // We do not handle erasing pms here if ($mode == 'delete') { return false; @@ -1165,7 +1186,7 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr } $sql = ''; - + switch ($mode) { case 'reply': @@ -1178,6 +1199,8 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr WHERE user_id = ' . $data['from_user_id'] . ' AND msg_id = ' . $data['reply_from_msg_id']; + // no break + case 'forward': case 'post': case 'quotepost': @@ -1185,14 +1208,14 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr 'root_level' => $root_level, 'author_id' => $data['from_user_id'], 'icon_id' => $data['icon_id'], - 'author_ip' => $data['from_user_ip'], + 'author_ip' => $data['from_user_ip'], 'message_time' => $current_time, - 'enable_bbcode' => $data['enable_bbcode'], - 'enable_smilies' => $data['enable_smilies'], - 'enable_magic_url' => $data['enable_urls'], - 'enable_sig' => $data['enable_sig'], + 'enable_bbcode' => $data['enable_bbcode'], + 'enable_smilies' => $data['enable_smilies'], + 'enable_magic_url' => $data['enable_urls'], + 'enable_sig' => $data['enable_sig'], 'message_subject' => $subject, - 'message_text' => $data['message'], + 'message_text' => $data['message'], 'message_encoding' => $user->lang['ENCODING'], 'message_attachment'=> (isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data'])) ? 1 : 0, 'bbcode_bitfield' => $data['bbcode_bitfield'], @@ -1200,24 +1223,24 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr 'to_address' => implode(':', $to), 'bcc_address' => implode(':', $bcc) ); - break; + break; case 'edit': $sql_data = array( 'icon_id' => $data['icon_id'], 'message_edit_time' => $current_time, - 'enable_bbcode' => $data['enable_bbcode'], - 'enable_smilies' => $data['enable_smilies'], - 'enable_magic_url' => $data['enable_urls'], - 'enable_sig' => $data['enable_sig'], + 'enable_bbcode' => $data['enable_bbcode'], + 'enable_smilies' => $data['enable_smilies'], + 'enable_magic_url' => $data['enable_urls'], + 'enable_sig' => $data['enable_sig'], 'message_subject' => $subject, - 'message_text' => $data['message'], + 'message_text' => $data['message'], 'message_encoding' => $user->lang['ENCODING'], 'message_attachment'=> (isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data'])) ? 1 : 0, 'bbcode_bitfield' => $data['bbcode_bitfield'], 'bbcode_uid' => $data['bbcode_uid'] ); - break; + break; } if (sizeof($sql_data)) @@ -1235,11 +1258,11 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr $db->sql_query($sql); } } - + if ($mode != 'edit') { - $db->sql_transaction(); - + $db->sql_transaction('begin'); + if ($sql) { $db->sql_query($sql); @@ -1310,7 +1333,7 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr $db->sql_query($sql); } - $db->sql_transaction(); + $db->sql_transaction('begin'); // Submit Attachments if (!empty($data['attachment_data']) && $data['msg_id'] && in_array($mode, array('post', 'reply', 'quote', 'quotepost', 'edit', 'forward'))) @@ -1353,7 +1376,7 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr $files_added++; } } - + if (sizeof($data['attachment_data'])) { $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' @@ -1398,7 +1421,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message) global $db, $user, $config, $phpbb_root_path, $phpEx, $auth; $subject = censor_text($subject); - + // Get banned User ID's $sql = 'SELECT ban_userid FROM ' . BANLIST_TABLE; @@ -1442,13 +1465,13 @@ function pm_notification($mode, $author, $recipients, $subject, $message) } } $db->sql_freeresult($result); - + if (!sizeof($msg_list_ary)) { return; } - include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $messenger = new messenger(); $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index a497f0a94a..6416eebda1 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -20,10 +20,8 @@ if (!defined('IN_PHPBB')) * * Extension of template class - Functions needed for compiling templates only. * -* psoTFX - Completion of file caching, decompilation routines and implementation of -* conditionals/keywords and associated changes -* -* phpBB Development Team - further additions and fixes +* psoTFX, phpBB Development Team - Completion of file caching, decompilation +* routines and implementation of conditionals/keywords and associated changes * * The interface was inspired by PHPLib templates, and the template file (formats are * quite similar) @@ -106,7 +104,7 @@ class template_compile preg_match_all('#<!-- ([^<].*?) (.*?)?[ ]?-->#', $code, $blocks); $text_blocks = preg_split('#<!-- ([^<].*?) (.*?)?[ ]?-->#', $code); - + for ($i = 0, $j = sizeof($text_blocks); $i < $j; $i++) { $this->compile_var_tags($text_blocks[$i]); @@ -168,11 +166,11 @@ class template_compile break; case 'INCLUDEPHP': - $compile_blocks[] = ($config['tpl_php']) ? '<?php ' . $this->compile_tag_include_php(array_shift($includephp_blocks)) . ' ?>' : ''; + $compile_blocks[] = ($config['tpl_allow_php']) ? '<?php ' . $this->compile_tag_include_php(array_shift($includephp_blocks)) . ' ?>' : ''; break; case 'PHP': - $compile_blocks[] = ($config['tpl_php']) ? '<?php ' . array_shift($php_blocks) . ' ?>' : ''; + $compile_blocks[] = ($config['tpl_allow_php']) ? '<?php ' . array_shift($php_blocks) . ' ?>' : ''; break; default: @@ -221,11 +219,17 @@ class template_compile // This will handle the remaining root-level varrefs // transform vars prefixed by L_ into their language variable pendant if nothing is set within the tpldata array - $text_blocks = preg_replace('#\{L_([a-z0-9\-_]*)\}#is', "<?php echo ((isset(\$this->_tpldata['.'][0]['L_\\1'])) ? \$this->_tpldata['.'][0]['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '{ ' . ucfirst(strtolower(str_replace('_', ' ', '\\1'))) . ' }')); ?>", $text_blocks); + if (strpos($text_blocks, '{L_') !== false) + { + $text_blocks = preg_replace('#\{L_([a-z0-9\-_]*)\}#is', "<?php echo ((isset(\$this->_tpldata['.'][0]['L_\\1'])) ? \$this->_tpldata['.'][0]['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '{ ' . ucfirst(strtolower(str_replace('_', ' ', '\\1'))) . ' }')); ?>", $text_blocks); + } // Handle addslashed language variables prefixed with LA_ // If a template variable already exist, it will be used in favor of it... - $text_blocks = preg_replace('#\{LA_([a-z0-9\-_]*)\}#is', "<?php echo ((isset(\$this->_tpldata['.'][0]['LA_\\1'])) ? \$this->_tpldata['.'][0]['LA_\\1'] : ((isset(\$this->_tpldata['.'][0]['L_\\1'])) ? addslashes(\$this->_tpldata['.'][0]['L_\\1']) : ((isset(\$user->lang['\\1'])) ? addslashes(\$user->lang['\\1']) : '{ ' . ucfirst(strtolower(str_replace('_', ' ', '\\1'))) . ' }'))); ?>", $text_blocks); + if (strpos($text_blocks, '{LA_') !== false) + { + $text_blocks = preg_replace('#\{LA_([a-z0-9\-_]*)\}#is', "<?php echo ((isset(\$this->_tpldata['.'][0]['LA_\\1'])) ? \$this->_tpldata['.'][0]['LA_\\1'] : ((isset(\$this->_tpldata['.'][0]['L_\\1'])) ? addslashes(\$this->_tpldata['.'][0]['L_\\1']) : ((isset(\$user->lang['\\1'])) ? addslashes(\$user->lang['\\1']) : '{ ' . ucfirst(strtolower(str_replace('_', ' ', '\\1'))) . ' }'))); ?>", $text_blocks); + } // Handle remaining varrefs $text_blocks = preg_replace('#\{([a-z0-9\-_]*)\}#is', "<?php echo (isset(\$this->_tpldata['.'][0]['\\1'])) ? \$this->_tpldata['.'][0]['\\1'] : ''; ?>", $text_blocks); @@ -258,7 +262,7 @@ class template_compile if (preg_match('#^([^()]*)\(([\-\d]+)(?:,([\-\d]+))?\)$#', $tag_args, $match)) { $tag_args = $match[1]; - + if ($match[2] < 0) { $loop_start = '($_' . $tag_args . '_count ' . $match[2] . ' < 0 ? 0 : $_' . $tag_args . '_count ' . $match[2] . ')'; @@ -333,10 +337,10 @@ class template_compile { // Tokenize args for 'if' tag. preg_match_all('/(?: - "[^"\\\\]*(?:\\\\.[^"\\\\]*)*" | - \'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\' | - [(),] | - [^\s(),]+)/x', $tag_args, $match); + "[^"\\\\]*(?:\\\\.[^"\\\\]*)*" | + \'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\' | + [(),] | + [^\s(),]+)/x', $tag_args, $match); $tokens = $match[0]; $is_arg_stack = array(); @@ -491,11 +495,11 @@ class template_compile case 'false': $match[4] = strtoupper($match[4]); break; - + case '.': $match[4] = doubleval($match[4]); break; - + default: $match[4] = intval($match[4]); break; @@ -579,9 +583,6 @@ class template_compile $expr = "!($is_arg % $expr_arg)"; } break; - - default: - break; } if ($negate_expr) diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index 1cc0c48406..401eb01f46 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -47,7 +47,7 @@ class transfer { global $phpbb_root_path; - $destination_file = $this->root_path . '/' . str_replace($phpbb_root_path, '', $destination_file); + $destination_file = $this->root_path . str_replace($phpbb_root_path, '', $destination_file); // need to create a temp file and then move that temp file. // ftp functions can only move files around and can't create. @@ -121,7 +121,7 @@ class transfer $this->_chmod($dir[$i], $this->dir_perms); } - $this->_chdir($this->root_path . '/' . $dirs . $dir[$i]); + $this->_chdir($this->root_path . $dirs . $dir[$i]); $dirs .= $cur_dir; } @@ -141,7 +141,7 @@ class transfer global $phpbb_root_path; $from_loc = ((strpos($from_loc, $phpbb_root_path) !== 0) ? $phpbb_root_path : '') . $from_loc; - $to_loc = $this->root_path . '/' . str_replace($phpbb_root_path, '', $to_loc); + $to_loc = $this->root_path . str_replace($phpbb_root_path, '', $to_loc); if (!file_exists($from_loc)) { @@ -160,7 +160,7 @@ class transfer { global $phpbb_root_path; - $file = $this->root_path . '/' . str_replace($phpbb_root_path, '', $file); + $file = $this->root_path . str_replace($phpbb_root_path, '', $file); return $this->_delete($file); } @@ -173,7 +173,7 @@ class transfer { global $phpbb_root_path; - $dir = $this->root_path . '/' . str_replace($phpbb_root_path, '', $dir); + $dir = $this->root_path . str_replace($phpbb_root_path, '', $dir); return $this->_rmdir($dir); } @@ -185,7 +185,7 @@ class transfer { global $phpbb_root_path; - $old_handle = $this->root_path . '/' . str_replace($phpbb_root_path, '', $old_handle); + $old_handle = $this->root_path . str_replace($phpbb_root_path, '', $old_handle); return $this->_rename($old_handle, $new_handle); } @@ -245,9 +245,9 @@ class ftp 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} != '/' ) ? '/' : '') . ((substr($root_path, -1, 1) == '/') ? substr($root_path, 0, -1) : $root_path); + $this->root_path = (($root_path{0} != '/' ) ? '/' : '') . ((substr($root_path, -1, 1) == '/') ? '' : '/') . $root_path; // Init some needed values transfer::transfer(); @@ -447,7 +447,7 @@ class ftp_fsock extends transfer // 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) $this->root_path = str_replace('\\', '/', $this->root_path); - $this->root_path = (($root_path{0} != '/' ) ? '/' : '') . ((substr($root_path, -1, 1) == '/') ? substr($root_path, 0, -1) : $root_path); + $this->root_path = (($root_path{0} != '/' ) ? '/' : '') . ((substr($root_path, -1, 1) == '/') ? '' : '/') . $root_path; // Init some needed values transfer::transfer(); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index fe311061fd..4c3fbcb956 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -46,6 +46,7 @@ function user_get_id_name(&$user_id_ary, &$username_ary) if (!($row = $db->sql_fetchrow($result))) { + $db->sql_freeresult($result); return 'NO_USERS'; } @@ -63,6 +64,9 @@ function user_get_id_name(&$user_id_ary, &$username_ary) /** * Updates a username across all relevant tables/fields +* +* @param string $old_name the old/current username +* @param string $new_name the new username */ function user_update_name($old_name, $new_name) { @@ -99,7 +103,7 @@ function user_delete($mode, $user_id, $post_username = false) { global $config, $db, $user, $auth; - $db->sql_transaction(); + $db->sql_transaction('begin'); switch ($mode) { @@ -130,7 +134,7 @@ function user_delete($mode, $user_id, $post_username = false) if (!function_exists('delete_posts')) { global $phpbb_root_path, $phpEx; - include_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx); + include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); } $sql = 'SELECT topic_id, COUNT(post_id) AS total_posts @@ -174,7 +178,7 @@ function user_delete($mode, $user_id, $post_username = false) // Delete posts, attachments, etc. delete_posts('poster_id', $user_id); - break; + 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); @@ -295,16 +299,16 @@ function user_active_flip($user_id, $user_type, $user_actkey = false, $username } /** - * Add a ban or ban exclusion to the banlist. Bans either a user, an IP or an email address - * - * @param string $mode Type of ban. One of the following: user, ip, email - * @param mixed $ban Banned entity. Either string or array with usernames, ips or email addresses - * @param int $ban_len Ban length in minutes - * @param string $ban_len_other Ban length as a date (YYYY-MM-DD) - * @param boolean $ban_exclude Exclude these entities from banning? - * @param string $ban_reason String describing the reason for this ban - * @return boolean - */ +* Add a ban or ban exclusion to the banlist. Bans either a user, an IP or an email address +* +* @param string $mode Type of ban. One of the following: user, ip, email +* @param mixed $ban Banned entity. Either string or array with usernames, ips or email addresses +* @param int $ban_len Ban length in minutes +* @param string $ban_len_other Ban length as a date (YYYY-MM-DD) +* @param boolean $ban_exclude Exclude these entities from banning? +* @param string $ban_reason String describing the reason for this ban +* @return boolean +*/ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason = '') { global $db, $user, $auth; @@ -538,7 +542,6 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas // We have some entities to ban if (sizeof($banlist_ary)) { - $sql = ''; $sql_ary = array(); foreach ($banlist_ary as $ban_entry) @@ -605,7 +608,6 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas $result = $db->sql_query($sql); $sql_in = array(); - $sql = ''; if ($row = $db->sql_fetchrow($result)) { @@ -656,7 +658,7 @@ function user_unban($mode, $ban) { $ban = array($ban); } - + $unban_sql = implode(', ', array_map('intval', $ban)); if ($unban_sql) @@ -748,8 +750,7 @@ function user_ipwhois($ip) } /** -* Data validation ... used primarily but not exclusively by -* ucp modules +* Data validation ... used primarily but not exclusively by ucp modules * * "Master" function for validating a range of data types */ @@ -837,6 +838,7 @@ function validate_match($string, $optional = false, $match) { return 'WRONG_DATA'; } + return false; } @@ -863,23 +865,25 @@ function validate_username($username) FROM ' . USERS_TABLE . " WHERE LOWER(username) = '" . strtolower($db->sql_escape($username)) . "'"; $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if ($row = $db->sql_fetchrow($result)) + if ($row) { return 'USERNAME_TAKEN'; } - $db->sql_freeresult($result); $sql = 'SELECT group_name FROM ' . GROUPS_TABLE . " WHERE LOWER(group_name) = '" . strtolower($db->sql_escape($username)) . "'"; $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if ($row = $db->sql_fetchrow($result)) + if ($row) { return 'USERNAME_TAKEN'; } - $db->sql_freeresult($result); $sql = 'SELECT disallow_username FROM ' . DISALLOW_TABLE; @@ -889,6 +893,7 @@ function validate_username($username) { if (preg_match('#^' . str_replace('%', '.*?', preg_quote($row['disallow_username'], '$#')) . '#i', $username)) { + $db->sql_freeresult($result); return 'USERNAME_DISALLOWED'; } } @@ -902,6 +907,7 @@ function validate_username($username) { if (preg_match('#(' . str_replace('\*', '.*?', preg_quote($row['word'], '#')) . ')#i', $username)) { + $db->sql_freeresult($result); return 'USERNAME_DISALLOWED'; } } @@ -938,12 +944,13 @@ function validate_email($email) FROM ' . USERS_TABLE . " WHERE user_email_hash = " . crc32(strtolower($email)) . strlen($email); $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if ($row = $db->sql_fetchrow($result)) + if ($row) { return 'EMAIL_TAKEN'; } - $db->sql_freeresult($result); } return false; @@ -1024,10 +1031,10 @@ function avatar_remote($data, &$error) */ function avatar_upload($data, &$error) { - global $phpbb_root_path, $config, $db, $user; + global $phpbb_root_path, $config, $db, $user, $phpEx; // Init upload class - include_once($phpbb_root_path . 'includes/functions_upload.php'); + include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx); $upload = new fileupload('AVATAR_', array('jpg', 'jpeg', 'gif', 'png'), $config['avatar_filesize'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height']); if (!empty($_FILES['uploadfile']['name'])) @@ -1262,6 +1269,23 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow 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); + + 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', $sql_ary) . " WHERE group_id = $group_id"; $db->sql_query($sql); @@ -1358,18 +1382,14 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $result = $db->sql_query($sql); $add_id_ary = $update_id_ary = array(); - if ($row = $db->sql_fetchrow($result)) + while ($row = $db->sql_fetchrow($result)) { - do - { - $add_id_ary[] = $row['user_id']; + $add_id_ary[] = $row['user_id']; - if ($leader && !$row['group_leader']) - { - $update_id_ary[] = $row['user_id']; - } + if ($leader && !$row['group_leader']) + { + $update_id_ary[] = $row['user_id']; } - while ($row = $db->sql_fetchrow($result)); } $db->sql_freeresult($result); @@ -1396,7 +1416,7 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $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; + break; default: foreach ($add_id_ary as $user_id) @@ -1405,7 +1425,7 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, VALUES ($user_id, $group_id, $leader, $pending)"; $db->sql_query($sql); } - break; + break; } } @@ -1468,13 +1488,20 @@ 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'], - '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'], + 'user_colour' => $row['group_colour'], + 'user_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']) + ); + } } $db->sql_freeresult($result); @@ -1524,6 +1551,23 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, { $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 user_id IN (' . implode(', ', $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 user_id IN (' . implode(', ', $sql_where_ary[$gid]) . ')'; $db->sql_query($sql); @@ -1556,7 +1600,7 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, */ function group_user_attributes($action, $group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $group_attributes = false) { - global $db, $auth; + global $db, $auth, $phpbb_root_path, $phpEx, $config; // We need both username and user_id info user_get_id_name($user_id_ary, $username_ary); @@ -1566,6 +1610,11 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna return false; } + if (!$group_name) + { + $group_name = get_group_name($group_id); + } + switch ($action) { case 'demote': @@ -1580,29 +1629,75 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna break; case 'approve': + // Make sure we only approve those which are pending ;) + $sql = 'SELECT u.user_id, u.user_email, u.username, u.user_notify_type, u.user_jabber, u.user_lang + FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug + WHERE ug.group_id = ' . $group_id . ' + AND ug.user_pending = 1 + AND ug.user_id = u.user_id + AND ug.user_id IN (' . implode(', ', $user_id_ary) . ')'; + $result = $db->sql_query($sql); + + $user_id_ary = $email_users = array(); + while ($row = $db->sql_fetchrow($result)) + { + $user_id_ary[] = $row['user_id']; + $email_users[] = $row; + } + $db->sql_freeresult($result); + + if (!sizeof($user_id_ary)) + { + return false; + } + $sql = 'UPDATE ' . USER_GROUP_TABLE . " SET user_pending = 0 WHERE group_id = $group_id AND user_id IN (" . implode(', ', $user_id_ary) . ')'; $db->sql_query($sql); - $log = 'LOG_GROUP_APPROVE'; + // Send approved email to users... + 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']); + + $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' => $email_sig, + 'SITENAME' => $config['sitename'], + 'USERNAME' => html_entity_decode($row['username']), + 'GROUP_NAME' => html_entity_decode($group_name), + + 'U_GROUP' => generate_board_url() . "/ucp.$phpEx?i=groups&mode=membership") + ); + + $messenger->send($row['user_notify_type']); + $messenger->reset(); + } + + $messenger->save_queue(); + + $log = 'LOG_USERS_APPROVED'; break; case 'default': group_set_user_default($group_id, $user_id_ary, $group_attributes); $log = 'LOG_GROUP_DEFAULTS'; - break; + break; } // Clear permissions cache of relevant users $auth->acl_clear_prefetch($user_id_ary); - if (!$group_name) - { - $group_name = get_group_name($group_id); - } - add_log('admin', $log, $group_name, implode(', ', $username_ary)); return true; @@ -1659,6 +1754,23 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal } } + // 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 user_id IN (' . implode(', ', $user_id_ary) . ') + 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', $sql_ary) . ' WHERE user_id IN (' . implode(', ', $user_id_ary) . ')'; $db->sql_query($sql); diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php index 7d1050f265..7435c3054e 100644 --- a/phpBB/includes/mcp/mcp_ban.php +++ b/phpBB/includes/mcp/mcp_ban.php @@ -18,7 +18,7 @@ class mcp_ban function main($id, $mode) { global $config, $db, $user, $auth, $template, $cache; - global $SID, $phpbb_root_path, $phpEx; + global $phpbb_root_path, $phpEx; include($phpbb_root_path . 'includes/functions_user.' . $phpEx); @@ -103,7 +103,7 @@ class mcp_ban 'S_USERNAME_BAN' => ($mode == 'user') ? true : false, 'U_ACTION' => $this->u_action, - 'U_FIND_USER' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=mcp_ban&field=ban", + 'U_FIND_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_ban&field=ban'), ) ); } diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 994784e2ac..659baffee0 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -14,9 +14,9 @@ function mcp_forum_view($id, $mode, $action, $forum_info) { global $template, $db, $user, $auth, $cache; - global $SID, $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config; - $url = "{$phpbb_root_path}mcp.$phpEx$SID" . extra_url(); + $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url()); if ($action == 'merge_select') { @@ -73,8 +73,8 @@ function mcp_forum_view($id, $mode, $action, $forum_info) 'S_CAN_SYNC' => $auth->acl_get('m_', $forum_id), 'S_CAN_APPROVE' => $auth->acl_get('m_approve', $forum_id), - 'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $forum_id, - 'U_VIEW_FORUM_LOGS' => ($auth->acl_gets('a_', 'm_', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=logs&mode=forum_logs&f=" . $forum_id : '', + '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) : '', 'S_MCP_ACTION' => $url . "&i=$id&action=$action&mode=$mode&start=$start" . (($action == 'merge_select') ? $selected_ids : ''), @@ -165,12 +165,12 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $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( - 'U_VIEW_TOPIC' => "{$phpbb_root_path}mcp.$phpEx$SID&i=$id&f=$forum_id&t={$row['topic_id']}&mode=topic_view", + 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&f=$forum_id&t={$row['topic_id']}&mode=topic_view"), 'S_SELECT_TOPIC' => ($action == 'merge_select' && $row['topic_id'] != $topic_id) ? true : false, 'U_SELECT_TOPIC' => $url . "&i=$id&mode=topic_view&action=merge&to_topic_id=" . $row['topic_id'] . $selected_ids, 'U_MCP_QUEUE' => $u_mcp_queue, - 'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx$SID&i=main&mode=topic_view&t={$row['topic_id']}&action=reports", + '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_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), @@ -200,7 +200,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) */ function mcp_resync_topics($topic_ids) { - global $auth, $db, $template, $phpEx, $user, $SID, $phpbb_root_path; + global $auth, $db, $template, $phpEx, $user, $phpbb_root_path; if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_'))) { diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index f227dec9a6..b9e4f083c7 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -13,10 +13,10 @@ */ function mcp_front_view($id, $mode, $action) { - global $SID, $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config; global $template, $db, $user, $auth; - $url = "{$phpbb_root_path}mcp.$phpEx$SID" . extra_url(); + $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url()); // Latest 5 unapproved $forum_list = get_forum_list('m_approve'); @@ -76,9 +76,9 @@ function mcp_front_view($id, $mode, $action) 'U_POST_DETAILS'=> $url . '&i=main&mode=post_details&p=' . $row['post_id'], 'U_MCP_FORUM' => ($row['forum_id']) ? $url . '&i=main&mode=forum_view&f=' . $row['forum_id'] : '', 'U_MCP_TOPIC' => $url . '&i=main&mode=topic_view&t=' . $row['topic_id'], - 'U_FORUM' => ($row['forum_id']) ? "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $row['forum_id'] : '', - 'U_TOPIC' => $phpbb_root_path . "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&t=' . $row['topic_id'], - 'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['poster_id'], + 'U_FORUM' => ($row['forum_id']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', + 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&t=' . $row['topic_id']), + 'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['poster_id']), 'FORUM_NAME' => ($row['forum_id']) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'], 'TOPIC_TITLE' => $row['topic_title'], @@ -159,9 +159,9 @@ function mcp_front_view($id, $mode, $action) 'U_POST_DETAILS'=> $url . '&p=' . $row['post_id'] . "&i=reports&mode=report_details", 'U_MCP_FORUM' => ($row['forum_id']) ? $url . '&f=' . $row['forum_id'] . "&i=$id&mode=forum_view" : '', 'U_MCP_TOPIC' => $url . '&t=' . $row['topic_id'] . "&i=$id&mode=topic_view", - 'U_FORUM' => ($row['forum_id']) ? "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $row['forum_id'] : '', - 'U_TOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $row['forum_id'] . '&t=' . $row['topic_id'], - 'U_REPORTER' => ($row['user_id'] == ANONYMOUS) ? '' : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'], + 'U_FORUM' => ($row['forum_id']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', + 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']), + 'U_REPORTER' => ($row['user_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), 'FORUM_NAME' => ($row['forum_id']) ? $row['forum_name'] : $user->lang['POST_GLOBAL'], 'TOPIC_TITLE' => $row['topic_title'], diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index 1fc90bf06d..3d4c5d10ab 100755 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -26,7 +26,7 @@ class mcp_logs function main($id, $mode) { global $auth, $db, $user, $template; - global $config, $phpbb_root_path, $phpEx, $SID; + global $config, $phpbb_root_path, $phpEx; $user->add_lang('acp/common'); diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 3f54a1edec..2e9c058bdd 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -15,8 +15,8 @@ */ class mcp_main { - var $p_master; + var $u_action; function mcp_main(&$p_master) { @@ -26,7 +26,7 @@ class mcp_main function main($id, $mode) { global $auth, $db, $user, $template, $action; - global $config, $phpbb_root_path, $phpEx, $SID; + global $config, $phpbb_root_path, $phpEx; $quickmod = ($mode == 'quickmod') ? true : false; @@ -175,14 +175,7 @@ class mcp_main mcp_post_details($id, $mode, $action); - if ($action == 'whois') - { - $this->tpl_name = 'mcp_whois'; - } - else - { - $this->tpl_name = 'mcp_post'; - } + $this->tpl_name = ($action == 'whois') ? 'mcp_whois' : 'mcp_post'; $this->page_title = 'MCP_MAIN_POST_DETAILS'; break; @@ -197,7 +190,7 @@ class mcp_main */ function lock_unlock($action, $ids) { - global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path; + global $auth, $user, $db, $phpEx, $phpbb_root_path; if ($action == 'lock' || $action == 'unlock') { @@ -268,7 +261,7 @@ function lock_unlock($action, $ids) */ function change_topic_type($action, $topic_ids) { - global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path; + global $auth, $user, $db, $phpEx, $phpbb_root_path; if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('f_announce', 'f_sticky', 'm_')))) { @@ -374,7 +367,7 @@ function change_topic_type($action, $topic_ids) function mcp_move_topic($topic_ids) { global $auth, $user, $db, $template; - global $SID, $phpEx, $phpbb_root_path; + global $phpEx, $phpbb_root_path; if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_move'))) { @@ -508,8 +501,8 @@ function mcp_move_topic($topic_ids) $message = $user->lang[$success_msg]; $message .= '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'); - $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], "<a href=\"{$phpbb_root_path}viewforum.$phpEx$SID&f=$forum_id\">", '</a>'); - $message .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], "<a href=\"{$phpbb_root_path}viewforum.$phpEx$SID&f=$to_forum_id\">", '</a>'); + $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id") . '">', '</a>'); + $message .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$to_forum_id") . '">', '</a>'); trigger_error($message); } @@ -520,7 +513,7 @@ function mcp_move_topic($topic_ids) */ function mcp_delete_topic($topic_ids) { - global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path; + global $auth, $user, $db, $phpEx, $phpbb_root_path; if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_delete'))) { @@ -566,8 +559,9 @@ function mcp_delete_topic($topic_ids) } else { - meta_refresh(3, "viewforum.$phpEx$SID&f=$forum_id"); - trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="viewforum.' . $phpEx . $SID . '&f=' . $forum_id . '">', '</a>')); + $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); + meta_refresh(3, $redirect_url); + trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>')); } } @@ -576,7 +570,7 @@ function mcp_delete_topic($topic_ids) */ function mcp_delete_post($post_ids) { - global $auth, $user, $db, $SID, $phpEx, $phpbb_root_path; + global $auth, $user, $db, $phpEx, $phpbb_root_path; if (!($forum_id = check_ids($post_ids, POSTS_TABLE, 'post_id', 'm_delete'))) { @@ -641,9 +635,9 @@ function mcp_delete_post($post_ids) $return_link = array(); if ($affected_topics == 1 && !$deleted_topics && $topic_id) { - $return_link[] = sprintf($user->lang['RETURN_TOPIC'], "<a href=\"viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id\">", '</a>'); + $return_link[] = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id") . '">', '</a>'); } - $return_link[] = sprintf($user->lang['RETURN_FORUM'], "<a href=\"viewforum.$phpEx$SID&f=$forum_id\">", '</a>'); + $return_link[] = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>'); if (sizeof($post_ids) == 1) { @@ -696,7 +690,7 @@ function mcp_delete_post($post_ids) function mcp_fork_topic($topic_ids) { global $auth, $user, $db, $template, $config; - global $SID, $phpEx, $phpbb_root_path; + global $phpEx, $phpbb_root_path; if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_'))) { @@ -927,12 +921,13 @@ function mcp_fork_topic($topic_ids) } else { - meta_refresh(3, "viewforum.$phpEx$SID&f=$forum_id"); - $return_link = sprintf($user->lang['RETURN_FORUM'], '<a href="viewforum.' . $phpEx . $SID . '&f=' . $forum_id . '">', '</a>'); + $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); + meta_refresh(3, $redirect_url); + $return_link = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>'); if ($forum_id != $to_forum_id) { - $return_link .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], '<a href="viewforum.' . $phpEx . $SID . '&f=' . $to_forum_id . '">', '</a>'); + $return_link .= '<br /><br />' . sprintf($user->lang['RETURN_NEW_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $to_forum_id) . '">', '</a>'); } trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link); diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 1c65b68ae3..128a4de062 100755 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -15,9 +15,9 @@ */ class mcp_notes { - var $p_master; - + var $u_action; + function mcp_main(&$p_master) { $this->p_master = &$p_master; @@ -26,7 +26,7 @@ class mcp_notes function main($id, $mode) { global $auth, $db, $user, $template; - global $config, $phpbb_root_path, $phpEx, $SID; + global $config, $phpbb_root_path, $phpEx; $action = request_var('action', array('' => '')); @@ -41,10 +41,10 @@ class mcp_notes { case 'front': $template->assign_vars(array( - 'L_TITLE' => $user->lang['MCP_NOTES'], - 'U_FIND_MEMBER' => "memberlist.$phpEx$SID&mode=searchuser&form=mcp&field=username", - 'U_POST_ACTION' => "mcp.$phpEx$SID&i=notes&mode=user_notes", - ) + 'U_FIND_MEMBER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username'), + 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes'), + + 'L_TITLE' => $user->lang['MCP_NOTES']) ); $this->tpl_name = 'mcp_notes_front'; @@ -53,167 +53,171 @@ class mcp_notes case 'user_notes': $user->add_lang('acp/common'); - mcp_notes_user_view($id, $mode, $action); + $this->mcp_notes_user_view($action); $this->tpl_name = 'mcp_notes_user'; break; } } -} - -// -// Functions -// -function mcp_notes_user_view($id, $mode, $action) -{ - global $SID, $phpEx, $phpbb_root_path, $config; - global $template, $db, $user, $auth; - - $user_id = request_var('u', 0); - $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 = 'SELECT * FROM ' . USERS_TABLE . " WHERE $sql_where"; - $result = $db->sql_query($sql); - - if (!$userrow = $db->sql_fetchrow($result)) + /** + * Display user notes + */ + function mcp_notes_user_view($action) { - trigger_error($user->lang['NO_USER']); - } - $db->sql_freeresult($result); + global $phpEx, $phpbb_root_path, $config; + global $template, $db, $user, $auth; + + $user_id = request_var('u', 0); + $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 = 'SELECT * + FROM ' . USERS_TABLE . " + WHERE $sql_where"; + $result = $db->sql_query($sql); + $userrow = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$userrow) + { + trigger_error($user->lang['NO_USER']); + } - $user_id = $userrow['user_id']; + $user_id = $userrow['user_id']; - $deletemark = ($action == 'del_marked') ? true : false; - $deleteall = ($action == 'del_all') ? true : false; - $marked = request_var('marknote', array(0)); - $usernote = request_var('usernote', '', true); + $deletemark = ($action == 'del_marked') ? true : false; + $deleteall = ($action == 'del_all') ? true : false; + $marked = request_var('marknote', array(0)); + $usernote = request_var('usernote', '', true); - // Handle any actions - if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) - { - $where_sql = ''; - if ($deletemark && $marked) + // Handle any actions + if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) { - $sql_in = array(); - foreach ($marked as $mark) + $where_sql = ''; + if ($deletemark && $marked) { - $sql_in[] = $mark; + $sql_in = array(); + foreach ($marked as $mark) + { + $sql_in[] = $mark; + } + $where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')'; + unset($sql_in); } - $where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')'; - unset($sql_in); - } - if ($where_sql || $deleteall) - { - $sql = 'DELETE FROM ' . LOG_TABLE . ' - WHERE log_type = ' . LOG_USERS . " - AND reportee_id = $user_id - $where_sql"; - $db->sql_query($sql); - - add_log('admin', 'LOG_CLEAR_USER', $userrow['username']); - - $msg = ($deletemark) ? 'MARKED_NOTES_DELETED' : 'ALL_NOTES_DELETED'; - $redirect = "mcp.$phpEx$SID&i=$id&mode=$mode&u=$user_id"; - meta_refresh(2, $redirect); - trigger_error($user->lang[$msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); + if ($where_sql || $deleteall) + { + $sql = 'DELETE FROM ' . LOG_TABLE . ' + WHERE log_type = ' . LOG_USERS . " + AND reportee_id = $user_id + $where_sql"; + $db->sql_query($sql); + + add_log('admin', 'LOG_CLEAR_USER', $userrow['username']); + + $msg = ($deletemark) ? 'MARKED_NOTES_DELETED' : 'ALL_NOTES_DELETED'; + $redirect = $this->u_action . '&u=' . $user_id; + meta_refresh(3, $redirect); + trigger_error($user->lang[$msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); + } } - } - if ($usernote && $action == 'add_feedback') - { - add_log('admin', 'LOG_USER_FEEDBACK', $userrow['username']); - add_log('user', $user_id, 'LOG_USER_GENERAL', $usernote); + if ($usernote && $action == 'add_feedback') + { + add_log('admin', 'LOG_USER_FEEDBACK', $userrow['username']); + add_log('user', $user_id, 'LOG_USER_GENERAL', $usernote); - $redirect = "mcp.$phpEx$SID&i=$id&mode=$mode&u=$user_id"; - meta_refresh(2, $redirect); - trigger_error($user->lang['USER_FEEDBACK_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); - } + $redirect = $this->u_action . '&u=' . $user_id; + meta_refresh(3, $redirect); + trigger_error($user->lang['USER_FEEDBACK_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); + } - // 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); + // 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); - $avatar_img = ''; - if (!empty($userrow['user_avatar'])) - { - switch ($userrow['user_avatar_type']) + $avatar_img = ''; + if (!empty($userrow['user_avatar'])) { - case AVATAR_UPLOAD: - $avatar_img = $config['avatar_path'] . '/'; - break; - case AVATAR_GALLERY: - $avatar_img = $config['avatar_gallery_path'] . '/'; + switch ($userrow['user_avatar_type']) + { + case AVATAR_UPLOAD: + $avatar_img = $config['avatar_path'] . '/'; break; - } - $avatar_img .= $userrow['user_avatar']; - $avatar_img = '<img src="' . $avatar_img . '" width="' . $userrow['user_avatar_width'] . '" height="' . $userrow['user_avatar_height'] . '" border="0" alt="" />'; - } - else - { - $avatar_img = '<img src="adm/images/no_avatar.gif" alt="" />'; - } + case AVATAR_GALLERY: + $avatar_img = $config['avatar_gallery_path'] . '/'; + break; + } + $avatar_img .= $userrow['user_avatar']; - $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.user_id', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation'); + $avatar_img = '<img src="' . $avatar_img . '" width="' . $userrow['user_avatar_width'] . '" height="' . $userrow['user_avatar_height'] . '" alt="" />'; + } + else + { + $avatar_img = '<img src="adm/images/no_avatar.gif" alt="" />'; + } - $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); + $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.user_id', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation'); - // Define where and sort sql for use in displaying logs - $sql_where = ($st) ? (time() - ($st * 86400)) : 0; - $sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC'); + $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); - $log_data = array(); - $log_count = 0; - view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort); + // Define where and sort sql for use in displaying logs + $sql_where = ($st) ? (time() - ($st * 86400)) : 0; + $sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC'); - if ($log_count) - { - $template->assign_var('S_USER_NOTES', true); + $log_data = array(); + $log_count = 0; + view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort); - foreach ($log_data as $row) + if ($log_count) { - $template->assign_block_vars('usernotes', array( - 'REPORT_BY' => $row['username'], - 'REPORT_AT' => $user->format_date($row['time']), - 'ACTION' => $row['action'], - 'ID' => $row['id']) - ); + $template->assign_var('S_USER_NOTES', true); + + foreach ($log_data as $row) + { + $template->assign_block_vars('usernotes', array( + 'REPORT_BY' => $row['username'], + 'REPORT_AT' => $user->format_date($row['time']), + 'ACTION' => $row['action'], + 'ID' => $row['id']) + ); + } } - } - $template->assign_vars(array( - 'U_POST_ACTION' => "mcp.$phpEx$SID&i=$id&mode=$mode&u=$user_id", - 'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false, - 'S_SELECT_SORT_DIR' => $s_sort_dir, - 'S_SELECT_SORT_KEY' => $s_sort_key, - 'S_SELECT_SORT_DAYS' => $s_limit_days, - - 'L_TITLE' => $user->lang['MCP_NOTES_USER'], - 'PAGE_NUMBER' => on_page($log_count, $config['posts_per_page'], $start), - 'PAGINATION' => generate_pagination("mcp.$phpEx$SID&i=$id&mode=$mode&u=$user_id&st=$st&sk=$sk&sd=$sd", $log_count, $config['posts_per_page'], $start), - 'TOTAL_REPORTS' => ($log_count == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $log_count), - - 'USERNAME' => $userrow['username'], - 'USER_COLOR' => (!empty($userrow['user_colour'])) ? $userrow['user_colour'] : '', - 'RANK_TITLE' => $rank_title, - 'JOINED' => $user->format_date($userrow['user_regdate']), - 'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0, - 'WARNINGS' => ($userrow['user_warnings']) ? $userrow['user_warnings'] : 0, - - 'AVATAR_IMG' => $avatar_img, - 'RANK_IMG' => $rank_img, - ) - ); + $template->assign_vars(array( + 'U_POST_ACTION' => $this->u_action . '&u=' . $user_id, + 'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false, + 'S_SELECT_SORT_DIR' => $s_sort_dir, + 'S_SELECT_SORT_KEY' => $s_sort_key, + 'S_SELECT_SORT_DAYS' => $s_limit_days, + + 'L_TITLE' => $user->lang['MCP_NOTES_USER'], + + 'PAGE_NUMBER' => on_page($log_count, $config['posts_per_page'], $start), + 'PAGINATION' => generate_pagination($this->u_action . "&u=$user_id&st=$st&sk=$sk&sd=$sd", $log_count, $config['posts_per_page'], $start), + 'TOTAL_REPORTS' => ($log_count == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $log_count), + + 'USERNAME' => $userrow['username'], + 'USER_COLOR' => (!empty($userrow['user_colour'])) ? $userrow['user_colour'] : '', + 'RANK_TITLE' => $rank_title, + 'JOINED' => $user->format_date($userrow['user_regdate']), + 'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0, + 'WARNINGS' => ($userrow['user_warnings']) ? $userrow['user_warnings'] : 0, + + 'AVATAR_IMG' => $avatar_img, + 'RANK_IMG' => $rank_img, + ) + ); + } } diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 407314d494..9110695180 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -13,7 +13,7 @@ */ function mcp_post_details($id, $mode, $action) { - global $SID, $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config; global $template, $db, $user, $auth; $user->add_lang('posting'); @@ -30,7 +30,7 @@ function mcp_post_details($id, $mode, $action) } $post_info = $post_info[$post_id]; - $url = "{$phpbb_root_path}mcp.$phpEx$SID" . extra_url(); + $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url()); switch ($action) { @@ -45,7 +45,7 @@ function mcp_post_details($id, $mode, $action) $whois = preg_replace('#(\s)(http:/{2}[^\s]*)(\s)#', '\1<a href="\2" target="_blank">\2</a>\3', $whois); $template->assign_vars(array( - 'RETURN_POST' => sprintf($user->lang['RETURN_POST'], "<a href=\"{$phpbb_root_path}mcp.$phpEx$SID&i=$id&mode=$mode&p=$post_id\">", '</a>'), + 'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&p=$post_id") . '">', '</a>'), 'WHOIS' => trim($whois)) ); @@ -101,7 +101,7 @@ function mcp_post_details($id, $mode, $action) $template->assign_vars(array( 'U_MCP_ACTION' => "$url&i=main&quickmod=1", // Use this for mode paramaters 'U_POST_ACTION' => "$url&i=$id&mode=post_details", // Use this for action parameters - 'U_APPROVE_ACTION' => "{$phpbb_root_path}mcp.$phpEx$SID&i=queue&p=$post_id", + 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id"), 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), 'S_CAN_CHGPOSTER' => $auth->acl_get('m_chgposter', $post_info['forum_id']), @@ -114,14 +114,14 @@ function mcp_post_details($id, $mode, $action) 'S_USER_NOTES' => true, 'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false, - 'U_FIND_MEMBER' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=searchuser&form=mcp_chgposter&field=username", - 'U_VIEW_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $post_info['user_id'], - 'U_MCP_USER_NOTES' => ($auth->acl_gets('m_', 'a_')) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=notes&mode=user_notes&u=" . $post_info['user_id'] : '', - 'U_MCP_WARN_USER' => "{$phpbb_root_path}mcp.$phpEx$SID&i=warn&mode=warn_user&u=" . $post_info['user_id'], - 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? "{$phpbb_root_path}posting.$phpEx$SID&mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}" : '', + 'U_FIND_MEMBER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_chgposter&field=username'), + 'U_VIEW_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $post_info['user_id']), + 'U_MCP_USER_NOTES' => ($auth->acl_gets('m_', 'a_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']) : '', + 'U_MCP_WARN_USER' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']), + 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '', - 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], "<a href=\"{$phpbb_root_path}viewtopic.$phpEx$SID&p=$post_id#p$post_id\">", '</a>'), - 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], "<a href=\"{$phpbb_root_path}viewforum.$phpEx$SID&f={$post_info['forum_id']}&start={$start}\">", '</a>'), + 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "p=$post_id") . "#p$post_id\">", '</a>'), + 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$post_info['forum_id']}&start={$start}") . '">', '</a>'), 'REPORTED_IMG' => $user->img('icon_reported', $user->lang['POST_REPORTED']), 'UNAPPROVED_IMG' => $user->img('icon_unapproved', $user->lang['POST_UNAPPROVED']), 'EDIT_IMG' => $user->img('btn_edit', $user->lang['EDIT_POST']), @@ -184,7 +184,7 @@ function mcp_post_details($id, $mode, $action) 'REASON_TITLE' => $row['reason_title'], 'REASON_DESC' => $row['reason_description'], 'REPORTER' => ($row['user_id'] != ANONYMOUS) ? $row['username'] : $user->lang['GUEST'], - 'U_REPORTER' => ($row['user_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['user_id']}" : '', + 'U_REPORTER' => ($row['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']) : '', 'USER_NOTIFY' => ($row['user_notify']) ? true : false, 'REPORT_TIME' => $user->format_date($row['report_time']), 'REPORT_TEXT' => str_replace("\n", '<br />', trim($row['report_text']))) @@ -249,8 +249,8 @@ function mcp_post_details($id, $mode, $action) 'NUM_POSTS' => $row['postings'], 'L_POST_S' => ($row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'], - 'U_PROFILE' => ($row['user_id'] == ANONYMOUS) ? '' : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'], - 'U_SEARCHPOSTS' => "{$phpbb_root_path}search.$phpEx$SID&author=" . urlencode($row['username']) . "&sr=topics") + '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')) ); } $db->sql_freeresult($result); @@ -290,7 +290,7 @@ function mcp_post_details($id, $mode, $action) 'L_POST_S' => ($row['postings'] == 1) ? $user->lang['POST'] : $user->lang['POSTS'], 'U_LOOKUP_IP' => ($rdns_ip_num == $row['poster_ip'] || $rdns_ip_num == 'all') ? '' : "$url&i=$id&mode=post_details&rdns={$row['poster_ip']}#ip", - 'U_WHOIS' => "{$phpbb_root_path}mcp.$phpEx$SID&i=$id&mode=$mode&action=whois&p=$post_id&ip={$row['poster_ip']}") + 'U_WHOIS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&action=whois&p=$post_id&ip={$row['poster_ip']}")) ); } $db->sql_freeresult($result); diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 9cdd9bcacb..f1a9b19acf 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -15,8 +15,8 @@ */ class mcp_queue { - var $p_master; + var $u_action; function mcp_main(&$p_master) { @@ -26,7 +26,7 @@ class mcp_queue function main($id, $mode) { global $auth, $db, $user, $template; - global $config, $phpbb_root_path, $phpEx, $SID, $action; + global $config, $phpbb_root_path, $phpEx, $action; include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); @@ -112,19 +112,19 @@ class mcp_queue $template->assign_vars(array( 'S_MCP_QUEUE' => true, - 'S_APPROVE_ACTION' => "{$phpbb_root_path}mcp.$phpEx$SID&i=queue&p=$post_id&f=$forum_id", + 'S_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id&f=$forum_id"), 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), 'S_POST_REPORTED' => $post_info['post_reported'], 'S_POST_UNAPPROVED' => !$post_info['post_approved'], 'S_POST_LOCKED' => $post_info['post_edit_locked'], 'S_USER_NOTES' => $auth->acl_gets('m_', 'a_') ? true : false, - 'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $post_info['user_id'] : '', - 'U_MCP_USER_NOTES' => "{$phpbb_root_path}mcp.$phpEx$SID&i=notes&mode=user_notes&u=" . $post_info['user_id'], - 'U_MCP_WARN_USER' => "{$phpbb_root_path}mcp.$phpEx$SID&i=warn&mode=warn_user&u=" . $post_info['user_id'], - 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? "{$phpbb_root_path}posting.$phpEx$SID&mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}" : '', + 'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $post_info['user_id']) : '', + 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']), + 'U_MCP_WARN_USER' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']), + 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '', - 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], "<a href=\"{$phpbb_root_path}mcp.$phpEx$SID&i=queue" . (($topic_id) ? '&mode=unapproved_topics' : '&mode=unapproved_posts') . "&start=$start\">", '</a>'), + 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue' . (($topic_id) ? '&mode=unapproved_topics' : '&mode=unapproved_posts')) . "&start=$start\">", '</a>'), 'REPORTED_IMG' => $user->img('icon_reported', $user->lang['POST_REPORTED']), 'UNAPPROVED_IMG' => $user->img('icon_unapproved', $user->lang['POST_UNAPPROVED']), 'EDIT_IMG' => $user->img('btn_edit', $user->lang['EDIT_POST']), @@ -293,12 +293,12 @@ class mcp_queue $s_checkbox = '<input type="checkbox" name="post_id_list[]" value="' . $row['post_id'] . '" />'; $template->assign_block_vars('postrow', array( - 'U_VIEWFORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $row['forum_id'], + 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']), // Q: Why accessing the topic by a post_id instead of its topic_id? // A: To prevent the post from being hidden because of wrong encoding or different charset - 'U_VIEWTOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $row['forum_id'] . '&p=' . $row['post_id'] . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''), - 'U_VIEW_DETAILS'=> "{$phpbb_root_path}mcp.$phpEx$SID&i=queue&start=$start&mode=approve_details&f={$forum_id}&p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&t={$row['topic_id']}" : '' ), - 'U_VIEWPROFILE' => ($row['poster_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['poster_id']}" : '', + 'U_VIEWTOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''), + 'U_VIEW_DETAILS'=> append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&start=$start&mode=approve_details&f={$forum_id}&p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&t={$row['topic_id']}" : '')), + 'U_VIEWPROFILE' => ($row['poster_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['poster_id']) : '', 'FORUM_NAME' => $row['forum_name'], 'TOPIC_TITLE' => $row['topic_title'], @@ -319,7 +319,7 @@ class mcp_queue 'S_FORUM_OPTIONS' => $forum_options, 'S_MCP_ACTION' => build_url(array('t', 'f', 'sd', 'st', 'sk')), - 'PAGINATION' => generate_pagination("{$phpbb_root_path}mcp.$phpEx$SID&i=$id&mode=$mode&f=$forum_id", $total, $config['topics_per_page'], $start), + 'PAGINATION' => generate_pagination($this->u_action . "&f=$forum_id", $total, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start), 'TOPIC_ID' => $topic_id, 'TOTAL' => $total) @@ -335,7 +335,7 @@ class mcp_queue function approve_post($post_id_list, $mode) { global $db, $template, $user, $config; - global $phpEx, $phpbb_root_path, $SID; + global $phpEx, $phpbb_root_path; if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_approve'))) { @@ -551,7 +551,7 @@ function approve_post($post_id_list, $mode) function disapprove_post($post_id_list, $mode) { global $db, $template, $user, $config; - global $phpEx, $phpbb_root_path, $SID; + global $phpEx, $phpbb_root_path; if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_approve'))) { diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index d003b9a6e2..a6725e887e 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -15,8 +15,8 @@ */ class mcp_reports { - var $p_master; + var $u_action; function mcp_main(&$p_master) { @@ -26,7 +26,7 @@ class mcp_reports function main($id, $mode) { global $auth, $db, $user, $template; - global $config, $phpbb_root_path, $phpEx, $SID, $action; + global $config, $phpbb_root_path, $phpEx, $action; include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); @@ -119,24 +119,24 @@ class mcp_reports $template->assign_vars(array( 'S_MCP_REPORT' => true, - 'S_CLOSE_ACTION' => "{$phpbb_root_path}mcp.$phpEx$SID&i=reports&p=$post_id&f=$forum_id", + 'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=reports&p=$post_id&f=$forum_id"), 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), 'S_POST_REPORTED' => $post_info['post_reported'], 'S_POST_UNAPPROVED' => !$post_info['post_approved'], 'S_POST_LOCKED' => $post_info['post_edit_locked'], 'S_USER_NOTES' => $auth->acl_gets('m_', 'a_') ? true : false, - 'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $post_info['user_id'] : '', - 'U_MCP_USER_NOTES' => "{$phpbb_root_path}mcp.$phpEx$SID&i=notes&mode=user_notes&u=" . $post_info['user_id'], - 'U_MCP_WARN_USER' => "{$phpbb_root_path}mcp.$phpEx$SID&i=warn&mode=warn_user&u=" . $post_info['user_id'], - 'U_VIEW_REPORTER_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $report['user_id'], - 'U_MCP_REPORTER_NOTES' => "{$phpbb_root_path}mcp.$phpEx$SID&i=notes&mode=user_notes&u=" . $report['user_id'], - 'U_MCP_WARN_REPORTER' => "{$phpbb_root_path}mcp.$phpEx$SID&i=warn&mode=warn_user&u=" . $report['user_id'], - 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? "{$phpbb_root_path}posting.$phpEx$SID&mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}" : '', + 'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $post_info['user_id']) : '', + 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']), + 'U_MCP_WARN_USER' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']), + 'U_VIEW_REPORTER_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $report['user_id']), + 'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $report['user_id']), + 'U_MCP_WARN_REPORTER' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $report['user_id']), + 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '', 'EDIT_IMG' => $user->img('btn_edit', $user->lang['EDIT_POST']), - 'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], "<a href=\"{$phpbb_root_path}mcp.$phpEx$SID&i=reports" . (($post_info['post_reported']) ? '&mode=reports' : '&mode=reports_closed') . "&start=$start\">", '</a>'), + 'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports' . (($post_info['post_reported']) ? '&mode=reports' : '&mode=reports_closed') . '&start=' . $start) . '">', '</a>'), 'REPORTED_IMG' => $user->img('icon_reported', $user->lang['POST_REPORTED']), 'REPORT_REASON_TITLE' => $reason['title'], 'REPORT_REASON_DESCRIPTION' => $reason['description'], @@ -292,13 +292,13 @@ class mcp_reports $s_checkbox = '<input type="checkbox" name="post_id_list[]" value="' . $row['post_id'] . '" />'; $template->assign_block_vars('postrow', array( - 'U_VIEWFORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $row['forum_id'], + 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']), // Q: Why accessing the topic by a post_id instead of its topic_id? // A: To prevent the post from being hidden because of wrong encoding or different charset - 'U_VIEWTOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $row['forum_id'] . '&p=' . $row['post_id'] . '#p' . $row['post_id'], - 'U_VIEW_DETAILS' => "{$phpbb_root_path}mcp.$phpEx$SID&i=reports&start=$start&mode=report_details&f={$forum_id}&p={$row['post_id']}", - 'U_VIEW_POSTER_PROFILE' => ($row['poster_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['poster_id']}" : '', - 'U_VIEW_REPORTER_PROFILE' => ($row['reporter_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['reporter_id']}" : '', + 'U_VIEWTOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&p=' . $row['post_id']) . '#p' . $row['post_id'], + 'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=reports&start=$start&mode=report_details&f={$forum_id}&p={$row['post_id']}"), + 'U_VIEW_POSTER_PROFILE' => ($row['poster_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['poster_id']) : '', + 'U_VIEW_REPORTER_PROFILE' => ($row['reporter_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['reporter_id']) : '', 'S_CHECKBOX' => $s_checkbox, @@ -324,7 +324,7 @@ class mcp_reports 'S_FORUM_OPTIONS' => $forum_options, 'S_CLOSED' => ($mode == 'reports_closed') ? true : false, - 'PAGINATION' => generate_pagination("{$phpbb_root_path}mcp.$phpEx$SID&i=$id&mode=$mode&f=$forum_id&t=$topic_id", $total, $config['topics_per_page'], $start), + 'PAGINATION' => generate_pagination($this->u_action . "&f=$forum_id&t=$topic_id", $total, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start), 'TOPIC_ID' => $topic_id, 'TOTAL' => $total) @@ -342,7 +342,7 @@ class mcp_reports function close_report($post_id_list, $mode, $action) { global $db, $template, $user, $config; - global $phpEx, $phpbb_root_path, $SID; + global $phpEx, $phpbb_root_path; if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_report'))) { diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index cf3d72303f..4b092a7bd0 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -13,10 +13,10 @@ */ function mcp_topic_view($id, $mode, $action) { - global $SID, $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config; global $template, $db, $user, $auth; - $url = "{$phpbb_root_path}mcp.$phpEx$SID" . extra_url(); + $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url()); $user->add_lang('viewtopic'); @@ -132,7 +132,7 @@ function mcp_topic_view($id, $mode, $action) 'POST_SUBJECT' => $post_subject, 'MESSAGE' => $message, 'POST_ID' => $row['post_id'], - 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], "<a href=\"{$phpbb_root_path}viewtopic.$phpEx$SID&t=$topic_id\">", '</a>'), + 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id) . '">', '</a>'), 'MINI_POST_IMG' => ($row['post_time'] > $user->data['user_lastvisit'] && $user->data['is_registered']) ? $user->img('icon_post_new', $user->lang['NEW_POST']) : $user->img('icon_post', $user->lang['POST']), @@ -141,8 +141,8 @@ function mcp_topic_view($id, $mode, $action) 'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true, 'U_POST_DETAILS' => "$url&i=$id&p={$row['post_id']}&mode=post_details", - 'U_MCP_APPROVE' => "{$phpbb_root_path}mcp.$phpEx$SID&i=queue&mode=unapproved_posts&action=approve&post_id_list[]=" . $row['post_id'], - 'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx$SID&i=reports&mode=report_details&p=" . $row['post_id']) + 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=unapproved_posts&action=approve&post_id_list[]=' . $row['post_id']), + 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&p=' . $row['post_id'])) ); unset($rowset[$i]); @@ -179,10 +179,10 @@ function mcp_topic_view($id, $mode, $action) $template->assign_vars(array( 'TOPIC_TITLE' => $topic_info['topic_title'], - 'U_VIEWTOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $topic_info['forum_id'] . '&t=' . $topic_info['topic_id'], + '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="' . $phpbb_root_path . "viewtopic.$phpEx$SID&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) . '" target="_new">' . $to_topic_info['topic_title'] . '</a>') : '', 'SPLIT_SUBJECT' => $subject, 'POSTS_PER_PAGE' => $posts_per_page, @@ -205,11 +205,11 @@ function mcp_topic_view($id, $mode, $action) 'U_SELECT_TOPIC' => "$url&i=$id&mode=forum_view&action=merge_select", - 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], "<a href=\"{$phpbb_root_path}viewtopic.$phpEx$SID&f={$topic_info['forum_id']}&t={$topic_info['topic_id']}&start=$start\">", '</a>'), - 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], "<a href=\"{$phpbb_root_path}viewforum.$phpEx$SID&f={$topic_info['forum_id']}&start=$start\">", '</a>'), + 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$topic_info['forum_id']}&t={$topic_info['topic_id']}&start=$start") . '">', '</a>'), + 'RETURN_FORUM' => sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", "f={$topic_info['forum_id']}&start=$start") . '">', '</a>'), 'PAGE_NUMBER' => on_page($total, $posts_per_page, $start), - 'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination("{$phpbb_root_path}mcp.$phpEx$SID&i=$id&t=" . $topic_info['topic_id'] . "&mode=$mode&action=$action&to_topic_id=$to_topic_id&posts_per_page=$posts_per_page&st=$sort_days&sk=$sort_key&sd=$sort_dir", $total, $posts_per_page, $start), + 'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&t={$topic_info['topic_id']}&mode=$mode&action=$action&to_topic_id=$to_topic_id&posts_per_page=$posts_per_page&st=$sort_days&sk=$sort_key&sd=$sort_dir"), $total, $posts_per_page, $start), 'TOTAL' => $total) ); } @@ -219,7 +219,7 @@ function mcp_topic_view($id, $mode, $action) */ function split_topic($action, $topic_id, $to_forum_id, $subject) { - global $db, $template, $user, $phpEx, $SID, $phpbb_root_path, $auth; + global $db, $template, $user, $phpEx, $phpbb_root_path, $auth; $post_id_list = request_var('post_id_list', array(0)); $start = request_var('start', 0); @@ -375,7 +375,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) $success_msg = 'TOPIC_SPLIT_SUCCESS'; // Link back to both topics - $return_link = sprintf($user->lang['RETURN_TOPIC'], "<a href=\"{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $post_info['forum_id'] . '&t=' . $post_info['topic_id'] . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], "<a href=\"{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $to_forum_id . '&t=' . $to_topic_id . '">', '</a>'); + $return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>'); } else { @@ -391,7 +391,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) } else { - meta_refresh(3, "viewtopic.$phpEx$SID&f=$to_forum_id&t=$to_topic_id"); + meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&t=$to_topic_id")); trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link); } } @@ -401,7 +401,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) */ function merge_posts($topic_id, $to_topic_id) { - global $db, $template, $user, $phpEx, $SID, $phpbb_root_path, $auth; + global $db, $template, $user, $phpEx, $phpbb_root_path, $auth; if (!$to_topic_id) { @@ -463,11 +463,11 @@ function merge_posts($topic_id, $to_topic_id) if (sizeof($topic_data)) { - $return_link .= sprintf($user->lang['RETURN_TOPIC'], '<a href="viewtopic.' . $phpEx . $SID . '&f=' . $forum_id . '&t=' . $topic_id . '">', '</a>'); + $return_link .= sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&t=' . $topic_id) . '">', '</a>'); } // Link to the new topic - $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="viewtopic.' . $phpEx . $SID . '&f=' . $to_forum_id . '&t=' . $to_topic_id . '">', '</a>'); + $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>'); } else { @@ -483,7 +483,7 @@ function merge_posts($topic_id, $to_topic_id) } else { - meta_refresh(3, "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$to_forum_id&t=$to_topic_id"); + meta_refresh(3, append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$to_forum_id&t=$to_topic_id")); trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_link); } } diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 26eeb89bd6..e22739dd99 100755 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -15,9 +15,9 @@ */ class mcp_warn { - var $p_master; - + var $u_action; + function mcp_main(&$p_master) { $this->p_master = &$p_master; @@ -26,7 +26,7 @@ class mcp_warn function main($id, $mode) { global $auth, $db, $user, $template; - global $config, $phpbb_root_path, $phpEx, $SID; + global $config, $phpbb_root_path, $phpEx; $action = request_var('action', array('' => '')); @@ -59,21 +59,17 @@ class mcp_warn } } -// -// Functions -// - /** * Generates the summary on the main page of the warning module */ function mcp_warn_front_view($id, $mode) { - global $SID, $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config; global $template, $db, $user, $auth; $template->assign_vars(array( - 'U_FIND_MEMBER' => "memberlist.$phpEx$SID&mode=searchuser&form=mcp&field=username", - 'U_POST_ACTION' => "mcp.$phpEx$SID&i=warn&mode=warn_user", + 'U_FIND_MEMBER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username'), + 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user'), ) ); @@ -88,8 +84,8 @@ function mcp_warn_front_view($id, $mode) foreach ($highest as $row) { $template->assign_block_vars('highest', array( - 'U_NOTES' => 'mcp.' . $phpEx . $SID . '&i=notes&mode=user_notes&u=' . $row['user_id'], - 'U_USER' => 'memberlist.' . $phpEx . $SID . '&mode=viewprofile&u=' . $row['user_id'], + 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $row['user_id']), + 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), 'USERNAME' => $row['username'], 'WARNING_TIME' => $user->format_date($row['user_last_warning']), @@ -109,8 +105,8 @@ function mcp_warn_front_view($id, $mode) while ($row = $db->sql_fetchrow($result)) { $template->assign_block_vars('latest', array( - 'U_NOTES' => 'mcp.' . $phpEx . $SID . '&i=notes&mode=user_notes&u=' . $row['user_id'], - 'U_USER' => 'memberlist.' . $phpEx . $SID . '&mode=viewprofile&u=' . $row['user_id'], + 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $row['user_id']), + 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), 'USERNAME' => $row['username'], 'WARNING_TIME' => $user->format_date($row['warning_time']), @@ -126,7 +122,7 @@ function mcp_warn_front_view($id, $mode) */ function mcp_warn_list_view($id, $mode, $action) { - global $SID, $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config; global $template, $db, $user, $auth; $user->add_lang('memberlist'); @@ -155,8 +151,8 @@ function mcp_warn_list_view($id, $mode, $action) foreach ($users as $row) { $template->assign_block_vars('user', array( - 'U_NOTES' => 'mcp.' . $phpEx . $SID . '&i=notes&mode=user_notes&u=' . $row['user_id'], - 'U_USER' => 'memberlist.' . $phpEx . $SID . '&mode=viewprofile&u=' . $row['user_id'], + 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $row['user_id']), + 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), 'USERNAME' => $row['username'], 'WARNING_TIME' => $user->format_date($row['user_last_warning']), @@ -166,14 +162,14 @@ function mcp_warn_list_view($id, $mode, $action) } $template->assign_vars(array( - 'U_POST_ACTION' => "mcp.$phpEx$SID&i=$id&mode=$mode", + 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode"), 'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false, 'S_SELECT_SORT_DIR' => $s_sort_dir, 'S_SELECT_SORT_KEY' => $s_sort_key, 'S_SELECT_SORT_DAYS' => $s_limit_days, 'PAGE_NUMBER' => on_page($user_count, $config['topics_per_page'], $start), - 'PAGINATION' => generate_pagination("mcp.$phpEx$SID&i=$id&mode=$mode&st=$st&sk=$sk&sd=$sd", $user_count, $config['topics_per_page'], $start), + 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&st=$st&sk=$sk&sd=$sd"), $user_count, $config['topics_per_page'], $start), 'TOTAL_USERS' => ($user_count == 1) ? $user->lang['LIST_USER'] : sprintf($user->lang['LIST_USERS'], $user_count), ) ); @@ -185,7 +181,7 @@ function mcp_warn_list_view($id, $mode, $action) */ function mcp_warn_post_view($id, $mode, $action) { - global $SID, $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config; global $template, $db, $user, $auth; $post_id = request_var('p', 0); @@ -227,7 +223,7 @@ function mcp_warn_post_view($id, $mode, $action) { add_warning($userrow, $warning, $notify, $post_id); - $redirect = "mcp.$phpEx$SID&i=notes&mode=user_notes&u=$user_id"; + $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&mode=user_notes&u=$user_id"); meta_refresh(2, $redirect); trigger_error($user->lang['USER_WARNING_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); } @@ -274,11 +270,11 @@ function mcp_warn_post_view($id, $mode, $action) } else { - $avatar_img = '<img src="adm/images/no_avatar.gif" alt="" />'; + $avatar_img = '<img src="' . $phpbb_root_path . 'images/no_avatar.gif" alt="" />'; } $template->assign_vars(array( - 'U_POST_ACTION' => "mcp.$phpEx$SID&i=$id&mode=$mode&p=$post_id", + 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&p=$post_id"), 'POST' => $message, 'USERNAME' => $userrow['username'], @@ -298,7 +294,7 @@ function mcp_warn_post_view($id, $mode, $action) */ function mcp_warn_user_view($id, $mode, $action) { - global $SID, $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config; global $template, $db, $user, $auth; $user_id = request_var('u', 0); @@ -321,7 +317,7 @@ function mcp_warn_user_view($id, $mode, $action) { add_warning($userrow, $warning, $notify); - $redirect = "mcp.$phpEx$SID&i=notes&mode=user_notes&u=$user_id"; + $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&mode=user_notes&u=$user_id"); meta_refresh(2, $redirect); trigger_error($user->lang['USER_WARNING_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); } @@ -353,7 +349,7 @@ function mcp_warn_user_view($id, $mode, $action) // OK, they didn't submit a warning so lets build the page for them to do so $template->assign_vars(array( - 'U_POST_ACTION' => "mcp.$phpEx$SID&i=$id&mode=$mode&u=$user_id", + 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&u=$user_id"), 'USERNAME' => $userrow['username'], 'USER_COLOR' => (!empty($userrow['user_colour'])) ? $userrow['user_colour'] : '', @@ -373,7 +369,7 @@ function mcp_warn_user_view($id, $mode, $action) */ function add_warning($userrow, $warning, $send_pm = true, $post_id = 0) { - global $SID, $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config; global $template, $db, $user, $auth; if ($send_pm) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index e4be20a91b..9f85549d8d 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -250,7 +250,21 @@ class bbcode_firstpass extends bbcode { return ''; } - + + // Apply the same size checks on flash files as on images + if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width']) + { + if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $height) + { + $this->warn_msg[] = sprintf($user->lang['MAX_FLASH_HEIGHT_EXCEEDED'], $config['max_' . $this->mode . '_img_height']); + } + + if ($config['max_' . $this->mode . '_img_width'] && $config['max_' . $this->mode . '_img_width'] < $width) + { + $this->warn_msg[] = sprintf($user->lang['MAX_FLASH_WIDTH_EXCEEDED'], $config['max_' . $this->mode . '_img_width']); + } + } + return '[flash=' . $width . ',' . $height . ':' . $this->bbcode_uid . ']' . $in . '[/flash:' . $this->bbcode_uid . ']'; } diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 40c6da1606..939fd94ae2 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -73,7 +73,7 @@ class session $page_dir = str_repeat('../', sizeof($root_dirs)) . implode('/', $page_dirs); - if ($page_dir && $page_dir{strlen($page_dir) - 1} == '/') + if ($page_dir && substr($page_dir, -1, 1) == '/') { $page_dir = substr($page_dir, 0, -1); } @@ -81,10 +81,10 @@ class session // Current page from phpBB root (for example: adm/index.php?i=10&b=2) $page = (($page_dir) ? $page_dir . '/' : '') . $page_name . (($query_string) ? "?$query_string" : ''); - // The script path from the webroot to the current directory (for example: /phpBB2/adm) : always prefixed with / + // The script path from the webroot to the current directory (for example: /phpBB2/adm/) : always prefixed with / and ends in / $script_path = trim(str_replace('\\', '/', dirname($script_name))); - // The script path from the webroot to the phpBB root (for example: /phpBB2) + // The script path from the webroot to the phpBB root (for example: /phpBB2/) $script_dirs = explode('/', $script_path); array_splice($script_dirs, -sizeof($page_dirs)); $root_script_path = implode('/', $script_dirs) . (sizeof($root_dirs) ? '/' . implode('/', $root_dirs) : ''); @@ -95,6 +95,9 @@ class session $root_script_path = ($page_dir) ? str_replace($page_dir, '', $script_path) : $script_path; } + $script_path .= (substr($script_path, -1, 1) == '/') ? '' : '/'; + $root_script_path .= (substr($root_script_path, -1, 1) == '/') ? '' : '/'; + $page_array += array( 'page_name' => $page_name, 'page_dir' => $page_dir, @@ -124,7 +127,7 @@ class session */ function session_begin() { - global $phpEx, $SID, $db, $config, $phpbb_root_path; + global $phpEx, $SID, $_SID, $db, $config, $phpbb_root_path; $this->time_now = time(); @@ -143,12 +146,13 @@ class session $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', ''); - + $SID = (defined('NEED_SID')) ? '?sid=' . $this->session_id : '?sid='; + $_SID = (defined('NEED_SID')) ? $this->session_id : ''; } else { - $this->session_id = request_var('sid', ''); + $this->session_id = $_SID = request_var('sid', ''); $SID = '?sid=' . $this->session_id; } @@ -282,7 +286,7 @@ class session */ function session_create($user_id = false, $set_admin = false, $persist_login = false, $viewonline = true) { - global $SID, $db, $config, $cache, $phpbb_root_path, $phpEx; + global $SID, $_SID, $db, $config, $cache, $phpbb_root_path, $phpEx; $this->data = array(); @@ -490,6 +494,7 @@ class session } $SID = '?sid='; + $_SID = ''; if (!$bot) { $cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000); @@ -499,6 +504,7 @@ class session $this->set_cookie('sid', $this->session_id, $cookie_expire); $SID = '?sid=' . $this->session_id; + $_SID = $this->session_id; if ($this->data['user_id'] != ANONYMOUS) { @@ -521,7 +527,7 @@ class session */ function session_kill() { - global $SID, $db, $config, $phpbb_root_path, $phpEx; + global $SID, $_SID, $db, $config, $phpbb_root_path, $phpEx; $sql = 'DELETE FROM ' . SESSIONS_TABLE . " WHERE session_id = '" . $db->sql_escape($this->session_id) . "' @@ -583,7 +589,7 @@ class session unset($cookie_expire); $SID = '?sid='; - $this->session_id = ''; + $this->session_id = $_SID = ''; return true; } @@ -966,10 +972,11 @@ class user extends session if (!empty($_GET['style']) && $auth->acl_get('a_styles')) { - global $SID; + global $SID, $_EXTRA_URL; $style = request_var('style', 0); $SID .= '&style=' . $style; + $_EXTRA_URL = array('style=' . $style); } else { @@ -1075,11 +1082,9 @@ class user extends session // already in the ucp if (!defined('IN_ADMIN') && $config['chg_passforce'] && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400)) { - global $SID; - if (strpos($this->page['query_string'], 'mode=reg_details') !== false && $this->page['page_name'] == "ucp.$phpEx") { - redirect("ucp.$phpEx$SID&i=profile&mode=reg_details"); + redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&mode=reg_details')); } } diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php index 83d8cf1701..93d1f63e05 100644 --- a/phpBB/includes/ucp/ucp_activate.php +++ b/phpBB/includes/ucp/ucp_activate.php @@ -17,7 +17,7 @@ class ucp_activate { function main($id, $mode) { - global $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx; + global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; $user_id = request_var('u', 0); $key = request_var('k', ''); @@ -36,7 +36,7 @@ class ucp_activate if ($row['user_type'] <> USER_INACTIVE && !$row['user_newpasswd']) { - meta_refresh(3, "index.$phpEx$SID"); + meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); trigger_error($user->lang['ALREADY_ACTIVATED']); } @@ -110,7 +110,7 @@ class ucp_activate set_config('num_users', $config['num_users'] + 1, true); } - meta_refresh(3, "{$phpbb_root_path}index.$phpEx$SID"); + meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); trigger_error($user->lang[$message]); } } diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index f8a6d1bf89..b699643f37 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -15,9 +15,11 @@ */ class ucp_attachments { + var $u_action; + function main($id, $mode) { - global $template, $user, $db, $config, $phpEx, $phpbb_root_path, $SID; + global $template, $user, $db, $config, $phpEx, $phpbb_root_path; $start = request_var('start', 0); $sort_key = request_var('sk', 'a'); @@ -44,9 +46,8 @@ class ucp_attachments } delete_attachments('attach', $delete_ids); - $refresh_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=$id"; - meta_refresh(3, $refresh_url); - $message = ((sizeof($delete_ids) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED']) . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $refresh_url . '">', '</a>'); + meta_refresh(3, $this->u_action); + $message = ((sizeof($delete_ids) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED']) . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); trigger_error($message); } else @@ -103,11 +104,11 @@ class ucp_attachments { if ($row['in_message']) { - $view_topic = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&p={$row['post_msg_id']}"; + $view_topic = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&p={$row['post_msg_id']}"); } else { - $view_topic = "{$phpbb_root_path}viewtopic.$phpEx$SID&t={$row['topic_id']}&p={$row['post_msg_id']}#p{$row['post_msg_id']}"; + $view_topic = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&p={$row['post_msg_id']}") . "#p{$row['post_msg_id']}"; } $template->assign_block_vars('attachrow', array( @@ -126,7 +127,7 @@ class ucp_attachments 'S_IN_MESSAGE' => $row['in_message'], - 'U_VIEW_ATTACHMENT' => $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $row['attach_id'], + 'U_VIEW_ATTACHMENT' => append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $row['attach_id']), 'U_VIEW_TOPIC' => $view_topic) ); @@ -138,22 +139,22 @@ class ucp_attachments $template->assign_vars(array( 'PAGE_NUMBER' => on_page($num_attachments, $config['posts_per_page'], $start), - 'PAGINATION' => generate_pagination("{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=$sort_key&sd=$sort_dir", $num_attachments, $config['posts_per_page'], $start), + 'PAGINATION' => generate_pagination($this->u_action . "&sk=$sort_key&sd=$sort_dir", $num_attachments, $config['posts_per_page'], $start), 'TOTAL_ATTACHMENTS' => $num_attachments, 'L_TITLE' => $user->lang['UCP_ATTACHMENTS'], - 'U_SORT_FILENAME' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=a&sd=" . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_FILE_COMMENT' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=b&sd=" . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_EXTENSION' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=c&sd=" . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_FILESIZE' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=d&sd=" . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_DOWNLOADS' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=e&sd=" . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_POST_TIME' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=f&sd=" . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_TOPIC_TITLE' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&sk=g&sd=" . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_FILENAME' => $this->u_action . "&sk=a&sd=" . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_FILE_COMMENT' => $this->u_action . "&sk=b&sd=" . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_EXTENSION' => $this->u_action . "&i=$id&sk=c&sd=" . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_FILESIZE' => $this->u_action . "&sk=d&sd=" . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_DOWNLOADS' => $this->u_action . "&sk=e&sd=" . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_POST_TIME' => $this->u_action . "&sk=f&sd=" . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_TOPIC_TITLE' => $this->u_action . "&sk=g&sd=" . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'), 'S_DISPLAY_MARK_ALL' => ($num_attachments) ? true : false, 'S_DISPLAY_PAGINATION' => ($num_attachments) ? true : false, - 'S_UCP_ACTION' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id", + 'S_UCP_ACTION' => $this->u_action, 'S_SORT_OPTIONS' => $s_sort_key, 'S_ORDER_SELECT' => $s_sort_dir) ); diff --git a/phpBB/includes/ucp/ucp_confirm.php b/phpBB/includes/ucp/ucp_confirm.php index 6c371b7a63..ec9b5c77d6 100644 --- a/phpBB/includes/ucp/ucp_confirm.php +++ b/phpBB/includes/ucp/ucp_confirm.php @@ -24,7 +24,7 @@ class ucp_confirm { function main($id, $mode) { - global $db, $user, $phpbb_root_path, $config; + global $db, $user, $phpbb_root_path, $config, $phpEx; // Do we have an id? No, then just exit $confirm_id = request_var('id', ''); @@ -74,12 +74,12 @@ class ucp_confirm $policy = ''; if (extension_loaded('gd') && sizeof($policy_modules)) { - include($phpbb_root_path . 'includes/captcha/captcha_gd.php'); + include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx); $policy = $policy_modules[array_rand($policy_modules)]; } else { - include($phpbb_root_path . 'includes/captcha/captcha_non_gd.php'); + include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx); } $captcha = new captcha(); diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index bb16baf2b3..3f30ec2d37 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -18,7 +18,7 @@ class ucp_groups function main($id, $mode) { - global $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx; + global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; $user->add_lang('groups'); @@ -47,8 +47,8 @@ class ucp_groups FROM ' . GROUPS_TABLE . " WHERE group_id IN ($group_id, {$user->data['group_id']})"; $result = $db->sql_query($sql); - $group_row = array(); + $group_row = array(); while ($row = $db->sql_fetchrow($result)) { $row['group_name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']; @@ -86,7 +86,7 @@ class ucp_groups group_user_attributes('default', $group_id, $user->data['user_id']); add_log('user', $user->data['user_id'], 'LOG_USER_GROUP_CHANGE', sprintf($user->lang['USER_GROUP_CHANGE'], $group_row[$group_id]['group_name'], $group_row[$user->data['group_id']]['group_name'])); - + meta_refresh(3, $this->u_action); trigger_error($user->lang['CHANGED_DEFAULT_GROUP'] . $return_page); } @@ -96,7 +96,7 @@ class ucp_groups 'default' => $group_id, 'change_default'=> true ); - + confirm_box(false, sprintf($user->lang['GROUP_CHANGE_DEFAULT'], $group_row[$group_id]['group_name']), build_hidden_fields($s_hidden_fields)); } @@ -115,13 +115,13 @@ class ucp_groups trigger_error($user->lang['NOT_MEMBER_OF_GROUP'] . $return_page); } list(, $row) = each($row); - + if (confirm_box(true)) { group_user_del($group_id, $user->data['user_id']); - + add_log('user', $user->data['user_id'], 'LOG_USER_GROUP_RESIGN', $group_row[$group_id]['group_name']); - + meta_refresh(3, $this->u_action); trigger_error($user->lang[($row['user_pending']) ? 'GROUP_RESIGNED_PENDING' : 'GROUP_RESIGNED_MEMBERSHIP'] . $return_page); } @@ -132,7 +132,7 @@ class ucp_groups 'action' => 'resign', 'submit' => true ); - + confirm_box(false, ($row['user_pending']) ? 'GROUP_RESIGN_PENDING' : 'GROUP_RESIGN_MEMBERSHIP', build_hidden_fields($s_hidden_fields)); } @@ -192,7 +192,7 @@ class ucp_groups 'USERNAME' => html_entity_decode($row['username']), 'GROUP_NAME' => html_entity_decode($group_row[$group_id]['group_name']), - 'U_PENDING' => generate_board_url() . "/ucp.$phpEx?i=usergroups&mode=manage", + '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") ); @@ -301,7 +301,7 @@ class ucp_groups 'GROUP_SPECIAL' => ($row['group_type'] <> GROUP_SPECIAL) ? false : true, 'GROUP_STATUS' => $user->lang['GROUP_IS_' . $group_status], - 'U_VIEW_GROUP' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=group&g={$row['group_id']}", + 'U_VIEW_GROUP' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']), 'S_GROUP_DEFAULT' => ($row['group_id'] == $user->data['group_id']) ? true : false, 'S_ROW_COUNT' => ${$block . '_count'}++) @@ -355,7 +355,7 @@ class ucp_groups 'GROUP_STATUS' => $user->lang['GROUP_IS_' . $group_status], 'S_CAN_JOIN' => ($row['group_type'] == GROUP_OPEN || $row['group_type'] == GROUP_FREE) ? true : false, - 'U_VIEW_GROUP' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=group&g={$row['group_id']}", + 'U_VIEW_GROUP' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']), 'S_ROW_COUNT' => $nonmember_count++) ); @@ -637,8 +637,8 @@ class ucp_groups 'GROUP_CLOSED' => $type_closed, 'GROUP_HIDDEN' => $type_hidden, - 'U_SWATCH' => "{$phpbb_root_path}adm/swatch.$phpEx$SID&form=ucp&name=group_colour", - 'UA_SWATCH' => "{$phpbb_root_path}adm/swatch.$phpEx$SID&form=ucp&name=group_colour", + 'U_SWATCH' => append_sid("{$phpbb_root_path}adm/swatch.$phpEx", 'form=ucp&name=group_colour'), + 'UA_SWATCH' => append_sid("{$phpbb_root_path}adm/swatch.$phpEx", 'form=ucp&name=group_colour', false), 'S_UCP_ACTION' => $this->u_action . "&action=$action&g=$group_id", 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024))) ); @@ -693,7 +693,7 @@ class ucp_groups $template->assign_block_vars($row['group_leader'] ? 'leader' : 'member', array( 'USERNAME' => $row['username'], - 'U_USER_VIEW' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['user_id']}", + 'U_USER_VIEW' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), 'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false, 'JOINED' => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ', 'USER_POSTS' => $row['user_posts'], @@ -717,7 +717,7 @@ 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' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=searchuser&form=list&field=usernames") + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=list&field=usernames')) ); break; diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 336c050fad..70f0e20f60 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -16,6 +16,7 @@ class ucp_main { var $p_master; + var $u_action; function ucp_main(&$p_master) { @@ -24,7 +25,7 @@ class ucp_main function main($id, $mode) { - global $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx; + global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; switch ($mode) { @@ -137,10 +138,10 @@ class ucp_main 'S_USER_POSTED' => (!empty($row['topic_posted']) && $row['topic_posted']) ? true : false, 'S_UNREAD' => $unread_topic, - 'U_LAST_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$g_forum_id&t=$topic_id&p=" . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], - 'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['topic_last_poster_id'] : '', - 'U_NEWEST_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$g_forum_id&t=$topic_id&view=unread#unread", - 'U_VIEW_TOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$g_forum_id&t=$topic_id") + 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&t=$topic_id&p=" . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], + 'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['topic_last_poster_id']) : '', + 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&t=$topic_id&view=unread") . '#unread', + 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$g_forum_id&t=$topic_id")) ); } @@ -173,7 +174,7 @@ class ucp_main // 'S_GROUP_OPTIONS' => $group_options, 'S_SHOW_ACTIVITY' => ($config['load_user_activity']) ? true : false, - 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? "{$phpbb_root_path}search.$phpEx$SID&author_id=" . $user->data['user_id'] . "&sr=posts" : '', + 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $user->data['user_id'] . '&sr=posts') : '', ) ); break; @@ -213,9 +214,9 @@ class ucp_main $l_unwatch .= '_TOPICS'; } - $message = $user->lang['UNWATCHED' . $l_unwatch] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&i=$id&mode=subscribed\">", '</a>'); + $message = $user->lang['UNWATCHED' . $l_unwatch] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=subscribed") . '">', '</a>'); - meta_refresh(3, "ucp.$phpEx$SID&i=$id&mode=subscribed"); + meta_refresh(3, append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=subscribed")); trigger_error($message); } } @@ -246,7 +247,8 @@ class ucp_main } else { - $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array(); + $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : ''; + $tracking_topics = ($tracking_topics) ? unserialize($tracking_topics) : array(); } $sql = $db->sql_build_query('SELECT', $sql_array); @@ -262,7 +264,7 @@ class ucp_main } else { - $forum_check = (isset($tracking_topics['f'][$forum_id])) ? base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate'] : $user->data['user_lastmark']; + $forum_check = (isset($tracking_topics['f'][$forum_id])) ? (int) (base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate']) : $user->data['user_lastmark']; } $unread_forum = ($row['forum_last_post_time'] > $forum_check) ? true : false; @@ -285,9 +287,9 @@ 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_url = ($row['forum_last_poster_id'] == ANONYMOUS) ? '' : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['forum_last_poster_id']; + $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 = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&p=" . $row['forum_last_post_id'] . '#p' . $row['forum_last_post_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']; } else { @@ -305,7 +307,7 @@ class ucp_main 'U_LAST_POST_AUTHOR'=> $last_poster_url, 'U_LAST_POST' => $last_post_url, - 'U_VIEWFORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $row['forum_id']) + 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id'])) ); } $db->sql_freeresult($result); @@ -324,7 +326,7 @@ class ucp_main if ($topics_count) { $template->assign_vars(array( - 'PAGINATION' => generate_pagination("ucp.$phpEx$SID&i=$id&mode=$mode", $topics_count, $config['topics_per_page'], $start), + 'PAGINATION' => generate_pagination($this->u_action, $topics_count, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start), 'TOTAL_TOPICS' => ($topics_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count)) ); @@ -413,7 +415,7 @@ class ucp_main $folder_img = $folder_alt = $topic_type = ''; topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type); - $view_topic_url = "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id"; + $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"); // Send vars to template $template->assign_block_vars('topicrow', array( @@ -424,7 +426,7 @@ class ucp_main '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, "viewtopic.$phpEx$SID&f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&t=$topic_id"), + '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'], 'TOPIC_TITLE' => censor_text($row['topic_title']), @@ -443,9 +445,9 @@ class ucp_main 'S_USER_POSTED' => (!empty($row['topic_posted'])) ? true : false, 'S_UNREAD_TOPIC' => $unread_topic, - 'U_NEWEST_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&view=unread#unread", + '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']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['topic_last_poster_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_VIEW_TOPIC' => $view_topic_url) ); @@ -495,7 +497,7 @@ class ucp_main { $s_hidden_fields = '<input type="hidden" name="unbookmark" value="1" />'; $topics = (isset($_POST['t'])) ? array_map('intval', array_keys($_POST['t'])) : array(); - $url = "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=$mode"; + $url = $this->u_action; if (!sizeof($topics)) { @@ -564,7 +566,7 @@ class ucp_main $unread_topic = false; topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type); - $view_topic_url = "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id"; + $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"); $template->assign_block_vars('topicrow', array( 'FORUM_ID' => $forum_id, @@ -581,7 +583,7 @@ class ucp_main '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, "viewtopic.$phpEx$SID&f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&t=$topic_id"), + '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']), @@ -591,11 +593,11 @@ class ucp_main 'LAST_POST_IMG' => $user->img('icon_post_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']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['topic_last_poster_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_VIEW_TOPIC' => $view_topic_url, - 'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f={$forum_id}", - 'U_MOVE_UP' => ($row['order_id'] != 1) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=main&mode=bookmarks&move_up={$row['order_id']}" : '', - 'U_MOVE_DOWN' => ($row['order_id'] != $max_order_id) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=main&mode=bookmarks&move_down={$row['order_id']}" : '') + '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']) : '', + 'U_MOVE_DOWN' => ($row['order_id'] != $max_order_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=main&mode=bookmarks&move_down=' . $row['order_id']) : '') ); } @@ -627,9 +629,9 @@ class ucp_main AND user_id = " .$user->data['user_id']; $db->sql_query($sql); - $message = $user->lang['DRAFTS_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&i=$id&mode=$mode\">", '</a>'); + $message = $user->lang['DRAFTS_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); - meta_refresh(3, "ucp.$phpEx$SID&i=$id&mode=$mode"); + meta_refresh(3, $this->u_action); trigger_error($message); } } @@ -652,9 +654,9 @@ class ucp_main AND user_id = " . $user->data['user_id']; $db->sql_query($sql); - $message = $user->lang['DRAFT_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&i=$id&mode=$mode\">", '</a>'); + $message = $user->lang['DRAFT_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); - meta_refresh(3, "ucp.$phpEx$SID&i=$id&mode=$mode"); + meta_refresh(3, $this->u_action); trigger_error($message); } else @@ -721,23 +723,23 @@ class ucp_main if (isset($topic_rows[$draft['topic_id']]) && $auth->acl_get('f_read', $topic_rows[$draft['topic_id']]['forum_id'])) { $link_topic = true; - $view_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . $topic_rows[$draft['topic_id']]['forum_id'] . "&t=" . $draft['topic_id']; + $view_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id']); $title = $topic_rows[$draft['topic_id']]['topic_title']; - $insert_url = "{$phpbb_root_path}posting.$phpEx$SID&f=" . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id']; + $insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id']); } else if ($auth->acl_get('f_read', $draft['forum_id'])) { $link_forum = true; - $view_url = "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $draft['forum_id']; + $view_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $draft['forum_id']); $title = $draft['forum_name']; - $insert_url = "{$phpbb_root_path}posting.$phpEx$SID&f=" . $draft['forum_id'] . '&mode=post&d=' . $draft['draft_id']; + $insert_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'f=' . $draft['forum_id'] . '&mode=post&d=' . $draft['draft_id']); } else if ($pm_drafts) { $link_pm = true; - $insert_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=compose&d=" . $draft['draft_id']; + $insert_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=compose&d=" . $draft['draft_id']); } $template_row = array( @@ -751,7 +753,7 @@ class ucp_main 'TOPIC_ID' => $draft['topic_id'], 'U_VIEW' => $view_url, - 'U_VIEW_EDIT' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=$mode&edit=" . $draft['draft_id'], + 'U_VIEW_EDIT' => $this->u_action . '&edit=' . $draft['draft_id'], 'U_INSERT' => $insert_url, 'S_LINK_TOPIC' => $link_topic, @@ -778,7 +780,7 @@ class ucp_main 'S_DISPLAY_MARK_ALL'=> ($mode == 'watched' || ($mode == 'drafts' && !isset($_GET['edit']))) ? true : false, 'S_HIDDEN_FIELDS' => (isset($s_hidden_fields)) ? $s_hidden_fields : '', - 'S_UCP_ACTION' => $phpbb_root_path . "ucp.$phpEx$SID&i=$id&mode=$mode") + 'S_UCP_ACTION' => $this->u_action) ); // Set desired template diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index e6fe312dba..18ca027582 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -33,9 +33,11 @@ */ class ucp_pm { + var $u_action; + function main($id, $mode) { - global $user, $template, $phpbb_root_path, $auth, $phpEx, $db, $SID, $config; + global $user, $template, $phpbb_root_path, $auth, $phpEx, $db, $config; if (!$user->data['is_registered']) { @@ -95,8 +97,9 @@ 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="' . $phpbb_root_path . 'ucp.' . $phpEx . $SID . '&i=pm&folder=inbox" onclick="jump_to_inbox();return false;" target="_new">', '</a>'), - 'U_INBOX' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox") + '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>'), + '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)) ); $tpl_file = 'ucp_pm_popup'; @@ -330,24 +333,23 @@ class ucp_pm // Header for message view - folder and so on $folder_status = get_folder_status($folder_id, $folder); - $url = "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=$mode"; $template->assign_vars(array( 'CUR_FOLDER_ID' => $folder_id, 'CUR_FOLDER_NAME' => $folder_status['folder_name'], 'NUM_NOT_MOVED' => $num_not_moved, - 'RELEASE_MESSAGE_INFO' => sprintf($user->lang['RELEASE_MESSAGES'], '<a href="' . $url . '&folder=' . $folder_id . '&release=1">', '</a>'), + 'RELEASE_MESSAGE_INFO' => sprintf($user->lang['RELEASE_MESSAGES'], '<a href="' . $this->u_action . '&folder=' . $folder_id . '&release=1">', '</a>'), 'NOT_MOVED_MESSAGES' => ($num_not_moved == 1) ? $user->lang['NOT_MOVED_MESSAGE'] : sprintf($user->lang['NOT_MOVED_MESSAGES'], $num_not_moved), 'S_FOLDER_OPTIONS' => $s_folder_options, 'S_TO_FOLDER_OPTIONS' => $s_to_folder_options, - 'S_FOLDER_ACTION' => "$url&action=view_folder", - 'S_PM_ACTION' => "$url&action=$action", + 'S_FOLDER_ACTION' => $this->u_action . '&action=view_folder', + 'S_PM_ACTION' => $this->u_action . '&action=' . $action, - 'U_INBOX' => "$url&folder=inbox", - 'U_OUTBOX' => "$url&folder=outbox", - 'U_SENTBOX' => "$url&folder=sentbox", - 'U_CREATE_FOLDER' => "$url&mode=options", + 'U_INBOX' => $this->u_action . '&folder=inbox', + 'U_OUTBOX' => $this->u_action . '&folder=outbox', + 'U_SENTBOX' => $this->u_action . '&folder=sentbox', + 'U_CREATE_FOLDER' => $this->u_action . '&mode=options', 'S_IN_INBOX' => ($folder_id == PRIVMSGS_INBOX) ? true : false, 'S_IN_OUTBOX' => ($folder_id == PRIVMSGS_OUTBOX) ? true : false, @@ -393,7 +395,7 @@ class ucp_pm $template->assign_vars(array( 'L_TITLE' => $user->lang['UCP_PM_' . strtoupper($mode)], - 'S_UCP_ACTION' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=$mode" . ((isset($action)) ? "&action=$action" : '')) + 'S_UCP_ACTION' => $this->u_action . ((isset($action)) ? "&action=$action" : '')) ); // Set desired template diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 715a41b8cf..61e15a467e 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -15,7 +15,7 @@ function compose_pm($id, $mode, $action) { global $template, $db, $auth, $user; - global $phpbb_root_path, $phpEx, $config, $SID; + global $phpbb_root_path, $phpEx, $config; include($phpbb_root_path . 'includes/functions_posting.'.$phpEx); include($phpbb_root_path . 'includes/message_parser.'.$phpEx); @@ -60,9 +60,9 @@ function compose_pm($id, $mode, $action) { if ($msg_id) { - redirect("ucp.$phpEx$SID&i=pm&mode=view&action=view_message&p=$msg_id"); + redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=view&action=view_message&p=' . $msg_id)); } - redirect("ucp.$phpEx$SID&i=pm"); + redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm')); } $sql = ''; @@ -253,7 +253,7 @@ function compose_pm($id, $mode, $action) $message_parser->message = ($action == 'reply') ? '' : $message_text; unset($message_text); - $s_action = "{$phpbb_root_path}ucp.$phpEx?sid={$user->session_id}&i=$id&mode=$mode&action=$action"; + $s_action = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=$mode&action=$action", true, $user->session_id); $s_action .= ($msg_id) ? "&p=$msg_id" : ''; // Delete triggered ? @@ -268,7 +268,7 @@ function compose_pm($id, $mode, $action) delete_pm($user->data['user_id'], $msg_id, $folder_id); // TODO - jump to next message in "history"? - $meta_info = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=$folder_id"; + $meta_info = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&folder=$folder_id"); $message = $user->lang['MESSAGE_DELETED']; meta_refresh(3, $meta_info); @@ -283,7 +283,7 @@ function compose_pm($id, $mode, $action) 'action'=> 'delete' ); - // "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=compose" + // "{$phpbb_root_path}ucp.$phpEx?i=pm&mode=compose" confirm_box(false, 'DELETE_MESSAGE', build_hidden_fields($s_hidden_fields)); } } @@ -372,9 +372,10 @@ function compose_pm($id, $mode, $action) 'draft_message' => $message)); $db->sql_query($sql); - meta_refresh(3, "ucp.$phpEx$SID&i=pm&mode=$mode"); + $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=$mode"); - $message = $user->lang['DRAFT_SAVED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&i=pm&mode=$mode\">", '</a>'); + meta_refresh(3, $redirect_url); + $message = $user->lang['DRAFT_SAVED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $redirect_url . '">', '</a>'); trigger_error($message); } @@ -519,8 +520,8 @@ function compose_pm($id, $mode, $action) // ((!$message_subject) ? $subject : $message_subject) $msg_id = submit_pm($action, $subject, $pm_data, true); - $return_message_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=view&p=" . $msg_id; - $return_folder_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=outbox"; + $return_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=view&p=' . $msg_id); + $return_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=outbox'); meta_refresh(3, $return_message_url); $message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>') . '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $return_folder_url . '">', '</a>', $user->lang['PM_OUTBOX']); @@ -617,7 +618,7 @@ function compose_pm($id, $mode, $action) $forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username); $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$SID&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=\"[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_subject = ((!preg_match('/^Fwd:/', $message_subject)) ? 'Fwd: ' : '') . censor_text($message_subject); } @@ -705,7 +706,7 @@ function compose_pm($id, $mode, $action) 'IS_USER' => ($type == 'u'), 'COLOUR' => (${$type}[$id]['colour']) ? ${$type}[$id]['colour'] : '', 'UG_ID' => $id, - 'U_VIEW' => ($type == 'u') ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $id : "{$phpbb_root_path}memberlist.$phpEx$SID&mode=group&g=" . $id, + 'U_VIEW' => ($type == 'u') ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $id) : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $id), 'TYPE' => $type) ); } @@ -771,7 +772,7 @@ 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="' . "faq.$phpEx$SID&mode=bbcode" . '" onclick="target=\'_phpbbcode\';">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . "faq.$phpEx$SID&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') . '" 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>'), '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'], @@ -800,8 +801,8 @@ function compose_pm($id, $mode, $action) 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']), - 'U_PROGRESS_BAR' => "{$phpbb_root_path}posting.$phpEx$SID&f=0&mode=popup", - 'UA_PROGRESS_BAR' => "{$phpbb_root_path}posting.$phpEx$SID&f=0&mode=popup", + 'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", 'f=0&mode=popup'), + 'UA_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", 'f=0&mode=popup', false), ) ); diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php index d4399b5b63..6b6542f498 100644 --- a/phpBB/includes/ucp/ucp_pm_options.php +++ b/phpBB/includes/ucp/ucp_pm_options.php @@ -13,9 +13,9 @@ */ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions) { - global $phpbb_root_path, $phpEx, $SID, $user, $template, $auth, $config, $db; + global $phpbb_root_path, $phpEx, $user, $template, $auth, $config, $db; - $redirect_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=options"; + $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=options"); // Change "full folder" setting - what to do if folder is full if (isset($_POST['fullfolder'])) @@ -220,7 +220,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit $user->data['user_full_folder'] = PRIVMSGS_INBOX; } - $meta_info = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=$mode"; + $meta_info = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=$mode"); $message = $user->lang['FOLDER_REMOVED']; meta_refresh(3, $meta_info); @@ -299,7 +299,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit if (!$delete_id) { - redirect("ucp.$phpEx$SID&i=pm&mode=$mode"); + redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=' . $mode)); } // Do we need to confirm? @@ -310,7 +310,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit AND rule_id = $delete_id"; $db->sql_query($sql); - $meta_info = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=$mode"; + $meta_info = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=' . $mode); $message = $user->lang['RULE_DELETED']; // Reset user_message_rules if no more assigned @@ -421,7 +421,7 @@ 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' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=searchuser&form=ucp&field=rule_string") + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=rule_string')) ); $rule_lang = $action_lang = $check_lang = array(); diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index e088104828..b3421a203d 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -15,11 +15,11 @@ function view_folder($id, $mode, $folder_id, $folder) { global $user, $template, $auth, $db, $cache; - global $phpbb_root_path, $config, $phpEx, $SID; + global $phpbb_root_path, $config, $phpEx; $submit_export = (isset($_POST['submit_export'])) ? true : false; - $folder_info = get_pm_from($folder_id, $folder, $user->data['user_id'], "{$phpbb_root_path}ucp.$phpEx$SID"); + $folder_info = get_pm_from($folder_id, $folder, $user->data['user_id']); if (!$submit_export) { @@ -148,15 +148,13 @@ function view_folder($id, $mode, $folder_id, $folder) { foreach ($id_ary as $ug_id => $_id) { - $address_list[$message_id][] = (($type == 'u') ? "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=$ug_id\">" : "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&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>'; + $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>'; } } } unset($recipient_list, $address); } - $url = "{$phpbb_root_path}ucp.$phpEx$SID"; - $data = array(); foreach ($folder_info['pm_list'] as $message_id) @@ -167,9 +165,9 @@ function view_folder($id, $mode, $folder_id, $folder) $folder_alt = ($row['unread']) ? 'NEW_MESSAGES' : 'NO_NEW_MESSAGES'; // Generate all URIs ... - $message_author = "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['author_id'] . '">' . $row['username'] . '</a>'; - $view_message_url = "$url&i=$id&mode=view&f=$folder_id&p=$message_id"; - $remove_message_url = "$url&i=$id&mode=compose&action=delete&p=$message_id"; + $message_author = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['author_id']) . '">' . $row['username'] . '</a>'; + $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"); $row_indicator = ''; foreach ($color_rows as $var) @@ -193,7 +191,7 @@ function view_folder($id, $mode, $folder_id, $folder) 'SENT_TIME' => $user->format_date($row['message_time']), 'SUBJECT' => censor_text($row['message_subject']), 'FOLDER' => (isset($folder[$row['folder_id']])) ? $folder[$row['folder_id']]['folder_name'] : '', - 'U_FOLDER' => (isset($folder[$row['folder_id']])) ? "$url&folder=" . $row['folder_id'] : '', + 'U_FOLDER' => (isset($folder[$row['folder_id']])) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'folder=' . $row['folder_id']) : '', 'PM_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '<img src="' . $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] . '" width="' . $icons[$row['icon_id']]['width'] . '" height="' . $icons[$row['icon_id']]['height'] . '" alt="" title="" />' : '', 'FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'PM_IMG' => ($row_indicator) ? $user->img('pm_' . $row_indicator, '') : '', @@ -381,9 +379,9 @@ function view_folder($id, $mode, $folder_id, $folder) /** * Get Messages from folder/user */ -function get_pm_from($folder_id, $folder, $user_id, $url) +function get_pm_from($folder_id, $folder, $user_id) { - global $user, $db, $template, $config, $auth, $_POST; + global $user, $db, $template, $config, $auth, $phpbb_root_path, $phpEx; $start = request_var('start', 0); @@ -434,7 +432,7 @@ function get_pm_from($folder_id, $folder, $user_id, $url) } $template->assign_vars(array( - 'PAGINATION' => generate_pagination("$url&i=pm&mode=view&action=view_folder&f=$folder_id&$u_sort_param", $pm_count, $config['topics_per_page'], $start), + 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id&$u_sort_param"), $pm_count, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($pm_count, $config['topics_per_page'], $start), 'TOTAL_MESSAGES'=> (($pm_count == 1) ? $user->lang['VIEW_PM_MESSAGE'] : sprintf($user->lang['VIEW_PM_MESSAGES'], $pm_count)), @@ -447,8 +445,8 @@ function get_pm_from($folder_id, $folder, $user_id, $url) 'S_SELECT_SORT_DAYS' => $s_limit_days, 'S_TOPIC_ICONS' => ($config['enable_pm_icons']) ? true : false, - 'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? "$url&i=pm&mode=compose" : '', - 'S_PM_ACTION' => "$url&i=pm&mode=view&action=view_folder&f=$folder_id") + 'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose') : '', + 'S_PM_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id")) ); // Grab all pm data diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 351e0646a1..aa32899e28 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -14,7 +14,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) { global $user, $template, $auth, $db, $cache; - global $phpbb_root_path, $phpEx, $SID, $config; + global $phpbb_root_path, $phpEx, $config; $user->add_lang(array('viewtopic', 'memberlist')); @@ -159,7 +159,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) $signature = str_replace("\n", '<br />', censor_text($signature)); } - $url = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm"; + $url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm'); $template->assign_vars(array( 'AUTHOR_NAME' => ($user_info['user_colour']) ? '<span style="color:#' . $user_info['user_colour'] . '">' . $user_info['username'] . '</span>' : $user_info['username'], @@ -187,9 +187,9 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) 'SIGNATURE' => ($message_row['enable_sig']) ? $signature : '', 'EDITED_MESSAGE' => $l_edited_by, - 'U_INFO' => ($auth->acl_get('m_info') && $message_row['forwarded']) ? "{$phpbb_root_path}mcp.$phpEx$SID&mode=pm_details&p=" . $message_row['msg_id'] : '', + 'U_INFO' => ($auth->acl_get('m_info') && $message_row['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' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $author_id, + 'U_AUTHOR_PROFILE' => 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_EDIT' => (($message_row['message_time'] > time() - $config['pm_edit_time'] || !$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'] : '', @@ -235,7 +235,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) */ function message_history($msg_id, $user_id, $message_row, $folder) { - global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $SID, $auth, $bbcode; + global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth, $bbcode; // Get History Messages (could be newer) $sql = 'SELECT t.*, p.*, u.* @@ -266,7 +266,7 @@ function message_history($msg_id, $user_id, $message_row, $folder) $rowset = array(); $bbcode_bitfield = 0; - $folder_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder="; + $folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm') . '&folder='; $title = ($sort_dir == 'd') ? $row['message_subject'] : ''; do @@ -307,7 +307,7 @@ function message_history($msg_id, $user_id, $message_row, $folder) $title = censor_text($title); - $url = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm"; + $url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm'); $next_history_pm = $previous_history_pm = $prev_id = 0; foreach ($rowset as $id => $row) @@ -347,7 +347,7 @@ function message_history($msg_id, $user_id, $message_row, $folder) 'U_MSG_ID' => $row['msg_id'], 'U_VIEW_MESSAGE' => "$url&f=$folder_id&p=" . $row['msg_id'], - 'U_AUTHOR_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=$author_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'] : '') ); @@ -372,7 +372,7 @@ function message_history($msg_id, $user_id, $message_row, $folder) function get_user_informations($user_id, $user_row) { global $db, $auth, $user, $cache; - global $phpbb_root_path, $phpEx, $SID, $config; + global $phpbb_root_path, $phpEx, $config; if (!$user_id) { @@ -455,7 +455,7 @@ function get_user_informations($user_id, $user_row) if (!empty($user_row['user_allow_viewemail']) || $auth->acl_get('a_email')) { - $user_row['email'] = ($config['board_email_form'] && $config['email_enable']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=email&u=$user_id" : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $user_row['user_email']); + $user_row['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&u=$user_id") : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $user_row['user_email']); } else { diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index ba867481f8..9882d9c223 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -15,9 +15,11 @@ */ class ucp_prefs { + var $u_action; + function main($id, $mode) { - global $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx; + global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; $submit = (isset($_POST['submit'])) ? true : false; $error = $data = array(); @@ -84,8 +86,8 @@ class ucp_prefs WHERE user_id = ' . $user->data['user_id']; $db->sql_query($sql); - meta_refresh(3, "ucp.$phpEx$SID&i=$id&mode=$mode"); - $message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&i=$id&mode=$mode\">", '</a>'); + meta_refresh(3, $this->u_action); + $message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); trigger_error($message); } @@ -240,8 +242,8 @@ class ucp_prefs WHERE user_id = ' . $user->data['user_id']; $db->sql_query($sql); - meta_refresh(3, "ucp.$phpEx$SID&i=$id&mode=$mode"); - $message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&i=$id&mode=$mode\">", '</a>'); + meta_refresh(3, $this->u_action); + $message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); trigger_error($message); } @@ -379,8 +381,8 @@ class ucp_prefs WHERE user_id = ' . $user->data['user_id']; $db->sql_query($sql); - meta_refresh(3, "ucp.$phpEx$SID&i=$id&mode=$mode"); - $message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&i=$id&mode=$mode\">", '</a>'); + meta_refresh(3, $this->u_action); + $message = $user->lang['PREFERENCES_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); trigger_error($message); } @@ -420,7 +422,7 @@ class ucp_prefs 'L_TITLE' => $user->lang['UCP_PREFS_' . strtoupper($mode)], 'S_HIDDEN_FIELDS' => $s_hidden_fields, - 'S_UCP_ACTION' => "ucp.$phpEx$SID&i=$id&mode=$mode") + 'S_UCP_ACTION' => $this->u_action) ); $this->tpl_name = 'ucp_prefs_' . $mode; diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index e50ed67037..1087d2f575 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -15,9 +15,11 @@ */ class ucp_profile { + var $u_action; + function main($id, $mode) { - global $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx; + global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; $user->add_lang('posting'); @@ -195,8 +197,8 @@ class ucp_profile user_update_name($user->data['username'], $username); } - meta_refresh(3, "ucp.$phpEx$SID&i=$id&mode=$mode"); - $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&i=$id&mode=$mode\">", '</a>'); + meta_refresh(3, $this->u_action); + $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); trigger_error($message); } @@ -329,8 +331,8 @@ class ucp_profile } } - meta_refresh(3, "ucp.$phpEx$SID&i=$id&mode=$mode"); - $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&i=$id&mode=$mode\">", '</a>'); + meta_refresh(3, $this->u_action); + $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); trigger_error($message); } @@ -437,7 +439,7 @@ class ucp_profile WHERE user_id = ' . $user->data['user_id']; $db->sql_query($sql); - $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&i=$id&mode=$mode\">", '</a>'); + $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); trigger_error($message); } } @@ -465,7 +467,7 @@ 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="' . "faq.$phpEx$SID&mode=bbcode" . '" onclick="target=\'_phpbbcode\';">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . "faq.$phpEx$SID&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') . '" 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>'), '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'], @@ -595,8 +597,8 @@ class ucp_profile } } - meta_refresh(3, "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=$mode"); - $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=$mode\">", '</a>'); + meta_refresh(3, $this->u_action); + $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); trigger_error($message); } @@ -663,7 +665,7 @@ class ucp_profile 'L_TITLE' => $user->lang['UCP_PROFILE_' . strtoupper($mode)], 'S_HIDDEN_FIELDS' => $s_hidden_fields, - 'S_UCP_ACTION' => "ucp.$phpEx$SID&i=$id&mode=$mode") + 'S_UCP_ACTION' => $this->u_action) ); // Set desired template diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index e13983a761..99eed58884 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -15,9 +15,11 @@ */ class ucp_register { + var $u_action; + function main($id, $mode) { - global $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx; + global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; // if ($config['require_activation'] == USER_ACTIVATION_DISABLE) @@ -60,11 +62,11 @@ 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' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=register&coppa=0", - 'U_COPPA_YES' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=register&coppa=1", + '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'), 'S_SHOW_COPPA' => true, - 'S_REGISTER_ACTION' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=register") + 'S_REGISTER_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register')) ); } else @@ -74,7 +76,7 @@ class ucp_register 'S_SHOW_COPPA' => false, 'S_REGISTRATION' => true, - 'S_REGISTER_ACTION' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=register") + 'S_REGISTER_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register')) ); } @@ -232,7 +234,7 @@ class ucp_register } // Begin transaction ... should this screw up we can rollback - $db->sql_transaction(); + $db->sql_transaction('begin'); $sql_ary = array( 'username' => $username, @@ -404,7 +406,7 @@ class ucp_register } unset($data); - $message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], "<a href=\"index.$phpEx$SID\">", '</a>'); + $message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>'); trigger_error($message); } } @@ -468,7 +470,7 @@ class ucp_register $db->sql_query($sql); } - $confirm_image = '<img src="' . $phpbb_root_path . 'ucp.' . $phpEx . $SID . '&mode=confirm&id=' . $confirm_id . '&type=' . CONFIRM_REG . '" alt="" title="" />'; + $confirm_image = '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&id=' . $confirm_id . '&type=' . CONFIRM_REG) . '" alt="" title="" />'; $s_hidden_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />'; } @@ -510,7 +512,7 @@ class ucp_register 'S_CONFIRM_CODE' => ($config['enable_confirm']) ? true : false, 'S_COPPA' => $coppa, 'S_HIDDEN_FIELDS' => $s_hidden_fields, - 'S_UCP_ACTION' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=register") + 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register')) ); // diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php index a0976da443..018c7b7105 100644 --- a/phpBB/includes/ucp/ucp_remind.php +++ b/phpBB/includes/ucp/ucp_remind.php @@ -15,9 +15,11 @@ */ class ucp_remind { + var $u_action; + function main($id, $mode) { - global $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx; + global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; $submit = (isset($_POST['submit'])) ? true : false; @@ -80,9 +82,9 @@ class ucp_remind $messenger->save_queue(); - meta_refresh(3, "index.$phpEx$SID"); + meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); - $message = $user->lang['PASSWORD_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . "index.$phpEx$SID" . '">', '</a>'); + $message = $user->lang['PASSWORD_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>'); trigger_error($message); } else diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php index 96278fd35a..a18eb14e0d 100644 --- a/phpBB/includes/ucp/ucp_resend.php +++ b/phpBB/includes/ucp/ucp_resend.php @@ -15,9 +15,11 @@ */ class ucp_resend { + var $u_action; + function main($id, $mode) { - global $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx; + global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; $submit = (isset($_POST['submit'])) ? true : false; @@ -130,9 +132,9 @@ class ucp_resend $db->sql_freeresult($result); } - meta_refresh(3, "index.$phpEx$SID"); + meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); - $message = $user->lang['ACTIVATION_EMAIL_SENT'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . "index.$phpEx$SID" . '">', '</a>'); + $message = $user->lang['ACTIVATION_EMAIL_SENT'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>'); trigger_error($message); } else diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index c8b4e5b66d..60d8822a00 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -14,9 +14,11 @@ */ class ucp_zebra { + var $u_action; + function main($id, $mode) { - global $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx; + global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; $submit = (isset($_POST['submit']) || isset($_GET['add'])) ? true : false; $s_hidden_fields = ''; @@ -171,8 +173,8 @@ class ucp_zebra if (!sizeof($error)) { - meta_refresh(3, "ucp.$phpEx$SID&i=$id&mode=$mode"); - $message = $user->lang[strtoupper($mode) . '_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&i=$id&mode=$mode\">", '</a>'); + meta_refresh(3, $this->u_action); + $message = $user->lang[strtoupper($mode) . '_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); trigger_error($message); } else @@ -200,11 +202,11 @@ class ucp_zebra $template->assign_vars(array( 'L_TITLE' => $user->lang['UCP_ZEBRA_' . strtoupper($mode)], - 'U_SEARCH_USER' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=searchuser&form=ucp&field=add", + 'U_SEARCH_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=add'), 'S_USERNAME_OPTIONS' => $s_username_options, 'S_HIDDEN_FIELDS' => $s_hidden_fields, - 'S_UCP_ACTION' => "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=$mode") + 'S_UCP_ACTION' => $this->u_action) ); $this->tpl_name = 'ucp_zebra_' . $mode; diff --git a/phpBB/index.php b/phpBB/index.php index 81fe6aa356..862eb5234f 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -14,7 +14,7 @@ define('IN_PHPBB', true); $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.'.$phpEx); +include($phpbb_root_path . 'common.' . $phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); // Start session management @@ -25,11 +25,11 @@ $user->setup('viewforum'); display_forums('', $config['load_moderators']); // Set some stats, get posts count from forums data if we... hum... retrieve all forums data -$total_posts = $config['num_posts']; -$total_topics = $config['num_topics']; -$total_users = $config['num_users']; -$newest_user = $config['newest_username']; -$newest_uid = $config['newest_user_id']; +$total_posts = $config['num_posts']; +$total_topics = $config['num_topics']; +$total_users = $config['num_users']; +$newest_user = $config['newest_username']; +$newest_uid = $config['newest_user_id']; $l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER'; $l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER'; @@ -45,7 +45,7 @@ $result = $db->sql_query($sql); $legend = ''; while ($row = $db->sql_fetchrow($result)) { - $legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . "{$phpbb_root_path}memberlist.$phpEx$SID" . '&mode=group&g=' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>'; + $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); @@ -56,16 +56,16 @@ if ($config['load_birthdays']) $now = getdate(); $sql = 'SELECT user_id, username, user_colour, user_birthday FROM ' . USERS_TABLE . " - WHERE user_birthday LIKE '" . sprintf('%2d-%2d-', $now['mday'], $now['mon']) . "%' + WHERE user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%' AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] .'"' : ''; - $birthday_list .= (($birthday_list != '') ? ', ' : '') . '<a' . $user_colour . " href=\"{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'] . '">' . $row['username'] . '</a>'; + $birthday_list .= (($birthday_list != '') ? ', ' : '') . '<a' . $user_colour . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']) . '">' . $row['username'] . '</a>'; - if ($age = (int)substr($row['user_birthday'], -4)) + if ($age = (int) substr($row['user_birthday'], -4)) { $birthday_list .= ' (' . ($now['year'] - $age) . ')'; } @@ -78,19 +78,19 @@ $template->assign_vars(array( 'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts), 'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics), 'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users), - 'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], "<a href=\"{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=$newest_uid \">", $newest_user, '</a>'), + 'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $newest_uid) . '">', $newest_user, '</a>'), 'LEGEND' => $legend, 'BIRTHDAY_LIST' => $birthday_list, - 'FORUM_IMG' => $user->img('forum', 'NO_NEW_POSTS'), - 'FORUM_NEW_IMG' => $user->img('forum_new', 'NEW_POSTS'), - 'FORUM_LOCKED_IMG' => $user->img('forum_locked', 'NO_NEW_POSTS_LOCKED'), + 'FORUM_IMG' => $user->img('forum', 'NO_NEW_POSTS'), + 'FORUM_NEW_IMG' => $user->img('forum_new', 'NEW_POSTS'), + 'FORUM_LOCKED_IMG' => $user->img('forum_locked', 'NO_NEW_POSTS_LOCKED'), - 'S_LOGIN_ACTION' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=login", + 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'), 'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false, - 'U_MARK_FORUMS' => "{$phpbb_root_path}index.$phpEx$SID&mark=forums", - 'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=main&mode=front" : '') + 'U_MARK_FORUMS' => append_sid("{$phpbb_root_path}index.$phpEx", 'mark=forums'), + 'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '') ); // Output page diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index ea1a54c3f1..b2c8e08fea 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1354,7 +1354,7 @@ class install_install extends module */ function email_admin($mode, $sub) { - global $auth, $config, $db, $lang, $template, $user, $SID, $phpbb_root_path, $phpEx; + global $auth, $config, $db, $lang, $template, $user, $phpbb_root_path, $phpEx; $this->page_title = $lang['STAGE_FINAL']; @@ -1419,7 +1419,7 @@ class install_install extends module 'TITLE' => $lang['INSTALL_CONGRATS'], 'BODY' => sprintf($lang['INSTALL_CONGRATS_EXPLAIN'], '<a href="../docs/README.html" target="_blank">', '</a>'), 'L_SUBMIT' => $lang['INSTALL_LOGIN'], - 'U_ACTION' => $phpbb_root_path . 'adm/index.' . $phpEx . $SID, + 'U_ACTION' => append_sid($phpbb_root_path . 'adm/index.' . $phpEx), )); } diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 57c4f38784..78197db1fb 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -37,7 +37,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_download_pm', INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_flash_pm', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_img_pm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_method', 'db'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_quote_pm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_smilies_pm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_filesize', '6144'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_gallery_path', 'images/avatars/gallery'); @@ -53,14 +52,13 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_dst', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email', 'address@yourdomain.tld'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_form', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_sig', 'Thanks, The Management'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_hide_emails', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_hide_emails', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_timezone', '0'); 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 ('chg_passforce', '0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('chg_passremind', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_domain', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_name', 'phpbb3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_path', '/'); @@ -78,7 +76,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0'); 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'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_pm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_confirm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_pm_icons', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_post_confirm', '1'); @@ -110,7 +107,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_package_size', INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_port', '5222'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_resource', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_username', ''); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('lastread', '432000'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_base_dn', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_server', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_uid', ''); @@ -206,6 +202,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_password', '' INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_port', '25'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_username', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', '25'); +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', '2.1.2'); @@ -231,35 +228,35 @@ INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('warnin # -- Forum related auth options INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_list', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_read', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_post', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_reply', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_edit', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_user_lock', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_delete', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_bump', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_poll', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_vote', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_votechg', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_announce', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_sticky', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_attach', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_bbcode', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_bump', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_delete', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_download', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_edit', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_email', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_flash', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_icons', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_bbcode', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_smilies', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_ignoreflood', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_img', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_flash', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_sigs', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_search', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_email', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_list', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_noapprove', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_print', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_ignoreflood', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_poll', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_post', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_postcount', 1); -INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_moderate', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_read', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_reply', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_report', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_search', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_sigs', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_smilies', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_sticky', 1); INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_subscribe', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_user_lock', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_vote', 1); +INSERT INTO phpbb_auth_options (auth_option, is_local) VALUES ('f_votechg', 1); # -- Moderator related auth options INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_', 1, 1); @@ -483,13 +480,11 @@ INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT # Queue Moderator (m_) INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 13, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'm_%' AND auth_option IN ('m_', 'm_approve', 'm_edit'); -# Full Access (f_) 14 -INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 14, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_moderate'); -INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 14, auth_option_id, 0 FROM phpbb_auth_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_moderate'); +# Full Access (f_) +INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 14, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'f_%'; # Standard Access (f_) -INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 15, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_delete', 'f_ignoreflood', 'f_moderate', 'f_poll', 'f_sticky', 'f_user_lock'); -INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 15, auth_option_id, 0 FROM phpbb_auth_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_moderate'); +INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 15, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_delete', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock'); # No Access (f_) INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 16, auth_option_id, 0 FROM phpbb_auth_options WHERE auth_option = 'f_'; @@ -498,17 +493,17 @@ INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 17, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_read', 'f_search', 'f_subscribe'); # Limited Access (f_) -INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 18, auth_option_id, 1 FROM phpbb_auth_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_moderate', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg'); +INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 18, auth_option_id, 1 FROM phpbb_auth_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_poll', 'f_sticky', 'f_user_lock', 'f_votechg'); # Bot Access (f_) INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 19, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_read'); # On Moderation Queue (f_) -INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 20, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg'); +INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 20, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg', 'f_noapprove'); +INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 20, auth_option_id, 0 FROM phpbb_auth_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_noapprove'); # Standard Access + Polls (f_) -INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 21, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_delete', 'f_ignoreflood', 'f_moderate', 'f_sticky', 'f_user_lock'); -INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 21, auth_option_id, 0 FROM phpbb_auth_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_moderate'); +INSERT INTO phpbb_auth_roles_data (role_id, auth_option_id, auth_setting) SELECT 21, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_delete', 'f_ignoreflood', 'f_sticky', 'f_user_lock'); # Permissions diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 5885cfab0d..8cf26ac157 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -28,133 +28,287 @@ 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 -// Jabber settings +// Board 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!', + 'ACP_BOARD_SETTINGS_EXPLAIN' => 'Here you can determine the basic operation of your board, from the site name through user registration to private messaging.', - '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.', + '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', + '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', + 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces users style with the default.', + 'SITE_DESC' => 'Site description', + 'SITE_NAME' => 'Site name', + 'SYSTEM_DST' => 'Enable Daylight Savings Time', + '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', +)); - '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_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_PORT' => 'Jabber port', - 'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not 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_USERNAME' => 'Jabber username', - 'JAB_USERNAME_EXPLAIN' => 'If this user is not registered it will be created if possible.', +// Board Features +$lang = array_merge($lang, array( + 'ACP_BOARD_FEATURES_EXPLAIN' => 'Here you can enable/disable several board features', + + '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_NO_CENSORS_EXPLAIN' => 'User can disable word censoring.', + '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_SMILIES' => 'Allow use of smilies in user signatures', + '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.', )); -// Auth settings +// Avatar Settings $lang = array_merge($lang, array( - 'ACP_AUTH_SETTINGS_EXPLAIN' => 'phpBB2 supports authentication plug-ins, or modules. These allow you determine how users are authenticated when they log into the board. By default three plug-ins are provided; DB, LDAP and Apache. Not all methods require additional information so only fill out fields if they are relevant to the selected method.', - 'AUTH_METHOD' => 'Select an authentication method', - 'LDAP_NO_IDENTITY' => 'Could not find a login identity for %s', - 'LDAP_NO_LDAP_EXTENSION' => 'LDAP extension not availible', - 'LDAP_NO_SERVER_CONNECTION' => 'Could not connect to LDAP server', - '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_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.', + 'ACP_AVATAR_SETTINGS_EXPLAIN' => 'Avatars are generally small, unique images a user can associate with themselves. Depending on the style they are usually displayed below the username when viewing topics. Here you can determine how users can define their avatars. Please note that in order to upload avatars you need to have created the directory you name below and ensure it can be written to by the web server. Please also note that filesize limits are only imposed on uploaded avatars, they do not apply to remotely linked images.', + + 'ALLOW_LOCAL' => 'Enable gallery avatars', + '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', + 'MAX_AVATAR_SIZE_EXPLAIN' => '(Height x Width in pixels)', + 'MAX_FILESIZE' => 'Maximum Avatar File Size', + 'MAX_FILESIZE_EXPLAIN' => 'For uploaded avatar files', + 'MIN_AVATAR_SIZE' => 'Minimum Avatar Dimensions', + 'MIN_AVATAR_SIZE_EXPLAIN' => '(Height x Width in pixels)', )); -// Board Settings +// Message Settings $lang = array_merge($lang, array( - 'ACP_BOARD_FEATURES_EXPLAIN' => 'Here you can enable/disable several board features', - '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.', 'ACP_MESSAGE_SETTINGS_EXPLAIN' => 'Here you can set all default settings for private messaging', - 'ACP_POST_SETTINGS_EXPLAIN' => 'Here you can set all default settings for posting', - 'ACP_REGISTER_SETTINGS_EXPLAIN' => 'Here you are able to define registration and profile related settings', - 'ACP_SECURITY_SETTINGS_EXPLAIN' => 'Here you are able to define session and login related settings', - 'ACP_SIGNATURE_SETTINGS_EXPLAIN' => 'Here you can set all default settings for signatures', - 'ACP_VC_SETTINGS_EXPLAIN' => 'Here you are able to define visual confirmation defaults and captcha settings', - 'BOXES_MAX' => 'Max private message folders', - 'BOXES_MAX_EXPLAIN' => 'By default users may create this many personal folders for private messages.', + 'ALLOW_BBCODE_PM' => 'Allow BBCode in private messages', + 'ALLOW_DOWNLOAD_PM' => 'Allow downloading of attachments in private messages', + 'ALLOW_EMAIL_PM' => 'Allow emailing private messages', + 'ALLOW_FLASH_PM' => 'Allow use of FLASH BBCode Tag', + 'ALLOW_FORWARD_PM' => 'Allow forwarding of private messages', + 'ALLOW_IMG_PM' => 'Allow use of IMG BBCode Tag', + 'ALLOW_MASS_PM' => 'Allow Mass PM\'s', + 'ALLOW_PRINT_PM' => 'Allow print view in private messaging', + 'ALLOW_QUOTE_PM' => 'Allow quotes in private messages', + 'ALLOW_SIG_PM' => 'Allow signature in private messages', + 'ALLOW_SMILIES_PM' => 'Allow smilies in private messages', 'BOXES_LIMIT' => 'Max private messages per box', 'BOXES_LIMIT_EXPLAIN' => 'Users may receive no more than this many messages in each of their private message boxes or zero for unlimited messages.', - - 'CAPTCHA_OPTIONS' => 'Captcha Options', - - 'CAPTCHA_OVERLAP' => 'Overlap', - 'CAPTCHA_ENTROPY' => 'Entropy', - 'CAPTCHA_SHAPE' => 'Shape', - 'CAPTCHA_3DBITMAP' => '3D Bitmap', - 'CAPTCHA_CELLS' => 'Cells', - 'CAPTCHA_STENCIL' => 'Stencil', - 'CAPTCHA_COMPOSITE' => 'Composite', - - 'ENTROPY_NOISE_PIXEL' => 'Entropy pixel noise', - 'ENTROPY_NOISE_LINE' => 'Entropy line noise', - 'SHAPE_NOISE_PIXEL' => 'Shape pixel noise', - 'SHAPE_NOISE_LINE' => 'Shape line noise', - 'OVERLAP_NOISE_PIXEL' => 'Overlap pixel noise', - 'OVERLAP_NOISE_LINE' => 'Overlap line noise', - 'HEAVY' => 'Heavy', - 'MEDIUM' => 'Medium', - 'LIGHT' => 'Light', - + 'BOXES_MAX' => 'Max private message folders', + '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 special folder "SENTBOX" 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', +)); - '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)', +// Post Settings +$lang = array_merge($lang, array( + 'ACP_POST_SETTINGS_EXPLAIN' => 'Here you can set all default settings for posting', + + 'BUMP_INTERVAL' => 'Bump Interval', + 'BUMP_INTERVAL_EXPLAIN' => 'Number of minutes, hours or days between the last post to a topic and the ability to bump this topic.', + 'CHAR_LIMIT' => 'Max characters per post', + 'CHAR_LIMIT_EXPLAIN' => 'Set to 0 for unlimited characters.', + 'DISPLAY_LAST_EDITED' => 'Display last edited time information', + 'DISPLAY_LAST_EDITED_EXPLAIN' => 'Choose if the last edited by information to be displayed on posts', + 'EDIT_TIME' => 'Limit editing time', + 'EDIT_TIME_EXPLAIN' => 'Limits the time available to edit a new post, zero equals infinity', + 'FLOOD_INTERVAL' => 'Flood Interval', + 'FLOOD_INTERVAL_EXPLAIN' => 'Number of seconds a user must wait between posting new messages. To enable users to ignore this alter their permissions.', + 'HOT_THRESHOLD' => 'Posts for Popular Threshold', + 'MAX_POLL_OPTIONS' => 'Max number of poll options', + 'MAX_POST_FONT_SIZE' => 'Max font size per post', + 'MAX_POST_FONT_SIZE_EXPLAIN' => 'Set to 0 for unlimited font size.', + 'MAX_POST_IMG_HEIGHT' => 'Max image height per post', + 'MAX_POST_IMG_HEIGHT_EXPLAIN' => 'Set to 0 for unlimited image height.', + 'MAX_POST_IMG_WIDTH' => 'Max image width per post', + 'MAX_POST_IMG_WIDTH_EXPLAIN' => 'Set to 0 for unlimited image width.', + 'MAX_POST_URLS' => 'Max links per post', + 'MAX_POST_URLS_EXPLAIN' => 'Set to 0 for unlimited links.', + 'POSTING' => 'Posting', + 'POSTS_PER_PAGE' => 'Posts Per Page', + 'QUOTE_DEPTH_LIMIT' => 'Max nested quotes per post', + 'QUOTE_DEPTH_LIMIT_EXPLAIN' => 'Set to 0 for unlimited depth.', + 'SMILIES_LIMIT' => 'Max smilies per post', + 'SMILIES_LIMIT_EXPLAIN' => 'Set to 0 for unlimited smilies.', + 'TOPICS_PER_PAGE' => 'Topics Per Page', +)); + +// Signature Settings +$lang = array_merge($lang, array( + 'ACP_SIGNATURE_SETTINGS_EXPLAIN' => 'Here you can set all default settings for signatures', + + 'MAX_SIG_FONT_SIZE' => 'Maximum signature font size', + 'MAX_SIG_FONT_SIZE_EXPLAIN' => 'Maximum font size allowed in user signatures. Set to 0 for unlimited size.', + 'MAX_SIG_IMG_HEIGHT' => 'Maximum signature image height', + 'MAX_SIG_IMG_HEIGHT_EXPLAIN' => 'Maximum height of an image in user signatures. Set to 0 for unlimited size.', + 'MAX_SIG_IMG_WIDTH' => 'Maximum signature image width', + 'MAX_SIG_IMG_WIDTH_EXPLAIN' => 'Maximum width of an image in user signatures. Set to 0 for unlimited size.', + 'MAX_SIG_LENGTH' => 'Maximum signature length', + 'MAX_SIG_LENGTH_EXPLAIN' => 'Maximum number of characters in user signatures.', + 'MAX_SIG_SMILIES' => 'Maximum smilies per signature', + 'MAX_SIG_SMILIES_EXPLAIN' => 'Maximum smilies allowed in user signatures. Set to 0 for unlimited size.', + 'MAX_SIG_URLS' => 'Maximum signature links', + 'MAX_SIG_URLS_EXPLAIN' => 'Maximum number of links in user signatures. Set to 0 for unlimited links.', +)); + +// Registration Settings +$lang = array_merge($lang, array( + 'ACP_REGISTER_SETTINGS_EXPLAIN' => 'Here you are able to define registration and profile related settings', + + 'ACC_ACTIVATION' => 'Account activation', + 'ACC_ACTIVATION_EXPLAIN' => 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations.', + 'ACC_ADMIN' => 'Admin', + 'ACC_DISABLE' => 'Disable', + 'ACC_NONE' => 'None', + 'ACC_USER' => 'User', +// 'ACC_USER_ADMIN' => 'User + Admin', + '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_HIDE_GROUPS' => 'Hide COPPA Groups', + 'COPPA_HIDE_GROUPS_EXPLAIN' => 'Do not display the special COPPA groups within admin-facing parts', + '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.', + 'MAX_CHARS' => 'Max', + 'MIN_CHARS' => 'Min', + 'PASSWORD_LENGTH' => 'Password length', + 'PASSWORD_LENGTH_EXPLAIN' => 'Minimum and maximum number of characters in passwords.', + 'REG_LIMIT' => 'Registration attempts', + 'REG_LIMIT_EXPLAIN' => 'Number of attempts users can make at the confirmation code before being locked out that session.', + 'USERNAME_ALPHA_ONLY' => 'Alphanumeric only', + 'USERNAME_ALPHA_SPACERS' => 'Alphanumeric and spacers', + 'USERNAME_CHARS' => 'Limit username chars', + 'USERNAME_CHARS_ANY' => 'Any character', + 'USERNAME_CHARS_EXPLAIN' => 'Restrict type of characters that may be used in usernames, spacers are; space, -, +, _, [ and ]', + 'USERNAME_LENGTH' => 'Username length', + 'USERNAME_LENGTH_EXPLAIN' => 'Minimum and maximum number of characters in usernames.', +)); - 'ALLOW_MASS_PM' => 'Allow Mass PM\'s', - 'ALLOW_BBCODE_PM' => 'Allow BBCode in private messages', - 'ALLOW_SMILIES_PM' => 'Allow smilies in private messages', - 'ALLOW_DOWNLOAD_PM' => 'Allow downloading of attachments in private messages', - 'ALLOW_FORWARD_PM' => 'Allow forwarding of private messages', - 'ALLOW_PRINT_PM' => 'Allow print view in private messaging', - 'ALLOW_EMAIL_PM' => 'Allow emailing private messages', - 'ALLOW_IMG_PM' => 'Allow use of IMG BBCode Tag', - 'ALLOW_FLASH_PM' => 'Allow use of FLASH BBCode Tag', - 'ALLOW_SIG_PM' => 'Allow signature in private messages', - 'ALLOW_QUOTE_PM' => 'Allow quotes in private messages', - 'ENABLE_PM_ICONS' => 'Enable use of topic icons in private messages', +// Visual Confirmation Settings +$lang = array_merge($lang, array( + 'ACP_VC_SETTINGS_EXPLAIN' => 'Here you are able to define visual confirmation defaults and captcha settings', + + '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', + 'ENTROPY_NOISE_LINE' => 'Entropy line noise', + 'ENTROPY_NOISE_PIXEL' => 'Entropy pixel noise', + 'HEAVY' => 'Heavy', + 'LIGHT' => 'Light', + 'MEDIUM' => 'Medium', + 'OVERLAP_NOISE_LINE' => 'Overlap line noise', + 'OVERLAP_NOISE_PIXEL' => 'Overlap pixel noise', + 'SHAPE_NOISE_LINE' => 'Shape line noise', + 'SHAPE_NOISE_PIXEL' => 'Shape pixel noise', + 'VISUAL_CONFIRM_POST' => 'Enable visual confirmation for guest postings', + 'VISUAL_CONFIRM_POST_EXPLAIN' => 'Requires anonymous users to enter a random code matching an image to help prevent mass postings.', + 'VISUAL_CONFIRM_REG' => 'Enable visual confirmation for registrations', + 'VISUAL_CONFIRM_REG_EXPLAIN' => 'Requires new users to enter a random code matching an image to help prevent mass registrations.', +)); + +// Cookie Settings +$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', + 'COOKIE_SECURE_EXPLAIN' => 'If your server is running via SSL set this to enabled else leave as disabled', + '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', + 'SESSION_LENGTH_EXPLAIN' => 'Sessions will expire after this time, in seconds.', +)); - 'ACP_AVATAR_SETTINGS_EXPLAIN' => 'Avatars are generally small, unique images a user can associate with themselves. Depending on the style they are usually displayed below the username when viewing topics. Here you can determine how users can define their avatars. Please note that in order to upload avatars you need to have created the directory you name below and ensure it can be written to by the web server. Please also note that filesize limits are only imposed on uploaded avatars, they do not apply to remotely linked images.', - 'ALLOW_LOCAL' => 'Enable gallery avatars', - 'ALLOW_REMOTE' => 'Enable remote avatars', - 'ALLOW_REMOTE_EXPLAIN' => 'Avatars linked to from another website', - 'ALLOW_UPLOAD' => 'Enable avatar uploading', - 'MAX_FILESIZE' => 'Maximum Avatar File Size', - 'MAX_FILESIZE_EXPLAIN' => 'For uploaded avatar files', - 'MIN_AVATAR_SIZE' => 'Minimum Avatar Dimensions', - 'MIN_AVATAR_SIZE_EXPLAIN' => '(Height x Width in pixels)', - 'MAX_AVATAR_SIZE' => 'Maximum Avatar Dimensions', - 'MAX_AVATAR_SIZE_EXPLAIN' => '(Height x Width in pixels)', - 'AVATAR_STORAGE_PATH' => 'Avatar Storage Path', - 'AVATAR_STORAGE_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/avatars/upload', - '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', +// Load Settings +$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', + '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', + 'LIMIT_SESSIONS_EXPLAIN' => 'If the number of sessions exceeds this value within a one minute period the board will go offline. Set to 0 for unlimited sessions.', + 'LOAD_CPF_MEMBERLIST' => 'Display custom profile fields in memberlist', + 'LOAD_CPF_VIEWPROFILE' => 'Display custom profile fields in user profiles', + 'LOAD_CPF_VIEWTOPIC' => 'Display custom profile fields on viewtopic', + 'LOAD_USER_ACTIVITY' => 'Show users activity', + 'LOAD_USER_ACTIVITY_EXPLAIN' => 'Displays active topic/forum in user profiles and user control panel. It is recommended to disable this on boards with more than one million posts.', + 'RECOMPILE_TEMPLATES' => 'Recompile stale templates', + 'RECOMPILE_TEMPLATES_EXPLAIN' => 'Check for updated template files on filesystem and recompile.', + 'YES_BIRTHDAYS' => 'Enable birthday listing', + 'YES_JUMPBOX' => 'Enable display of Jumpbox', + 'YES_MODERATORS' => 'Enable display of Moderators', + 'YES_ONLINE' => 'Enable online user listings', + 'YES_ONLINE_EXPLAIN' => 'Display online user information on index, forum and topic pages.', + 'YES_ONLINE_GUESTS' => 'Enable online guest listings in viewonline', + 'YES_ONLINE_GUESTS_EXPLAIN' => 'Allow display of guest user informations in viewonline.', + 'YES_ONLINE_TRACK' => 'Enable display of user online img', + 'YES_ONLINE_TRACK_EXPLAIN' => 'Display online information for user in profiles and viewtopic.', + 'YES_POST_MARKING' => 'Enable dotted topics', + 'YES_POST_MARKING_EXPLAIN' => 'Indicates whether user has posted to a topic.', + 'YES_READ_MARKING' => 'Enable server-side topic marking', + 'YES_READ_MARKING_EXPLAIN' => 'Stores read/unread status information in the database rather than a cookie.', +)); + +// Auth settings +$lang = array_merge($lang, array( + 'ACP_AUTH_SETTINGS_EXPLAIN' => 'phpBB2 supports authentication plug-ins, or modules. These allow you determine how users are authenticated when they log into the board. By default three plug-ins are provided; DB, LDAP and Apache. Not all methods require additional information so only fill out fields if they are relevant to the selected method.', + + 'AUTH_METHOD' => 'Select an authentication method', + '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_NO_IDENTITY' => 'Could not find a login identity for %s', + 'LDAP_NO_LDAP_EXTENSION' => 'LDAP extension not availible', + 'LDAP_NO_SERVER_CONNECTION' => 'Could not connect to LDAP server', + '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.', +)); +// Server Settings +$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', + 'ICONS_PATH' => 'Post icons storage path', + 'ICONS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/icons', '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', + '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_PORT' => 'Server Port', @@ -162,228 +316,106 @@ $lang = array_merge($lang, array( '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', - '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.', - 'ALL' => 'All', - 'CLASS_C' => 'A.B.C', - 'CLASS_B' => 'A.B', - 'BROWSER_VALID' => 'Validate browser', - 'BROWSER_VALID_EXPLAIN' => 'Enables browser validation for each session improving security.', - 'SEND_ENCODING' => 'Send Encoding', - 'SEND_ENCODING_EXPLAIN' => 'Send the file encoding from phpBB via HTTP overriding the webserver configuration', - 'ENABLE_GZIP' => 'Enable GZip Compression', 'SMILIES_PATH' => 'Smilies storage path', 'SMILIES_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/smilies', - 'ICONS_PATH' => 'Post icons storage path', - 'ICONS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/icons', 'UPLOAD_ICONS_PATH' => 'Extension group icons storage path', 'UPLOAD_ICONS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/upload_icons', - 'RANKS_PATH' => 'Rank image storage path', - 'RANKS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/ranks', - - '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', +)); - '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', - 'LIMIT_SESSIONS_EXPLAIN' => 'If the number of sessions exceeds this value within a one minute period the board will go offline. Set to 0 for unlimited sessions.', - 'LOAD_CPF_MEMBERLIST' => 'Display custom profile fields in memberlist', - 'LOAD_CPF_VIEWPROFILE' => 'Display custom profile fields in user profiles', - 'LOAD_CPF_VIEWTOPIC' => 'Display custom profile fields on viewtopic', - 'LOAD_USER_ACTIVITY' => 'Show users activity', - 'LOAD_USER_ACTIVITY_EXPLAIN' => 'Displays active topic/forum in user profiles and user control panel. It is recommended to disable this on boards with more than one million posts.', +// Security Settings +$lang = array_merge($lang, array( + 'ACP_SECURITY_SETTINGS_EXPLAIN' => 'Here you are able to define session and login related settings', - '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.', - - 'RECOMPILE_TEMPLATES' => 'Recompile stale templates', - 'RECOMPILE_TEMPLATES_EXPLAIN' => 'Check for updated template files on filesystem and recompile.', - - 'SESSION_LENGTH' => 'Session length', - 'SESSION_LENGTH_EXPLAIN' => 'Sessions will expire after this time, in seconds.', - - 'YES_POST_MARKING' => 'Enable dotted topics', - 'YES_POST_MARKING_EXPLAIN' => 'Indicates whether user has posted to a topic.', - 'YES_READ_MARKING' => 'Enable server-side topic marking', - 'YES_READ_MARKING_EXPLAIN' => 'Stores read/unread status information in the database rather than a cookie.', - 'YES_ONLINE' => 'Enable online user listings', - 'YES_ONLINE_EXPLAIN' => 'Display online user information on index, forum and topic pages.', - 'YES_ONLINE_GUESTS' => 'Enable online guest listings in viewonline', - 'YES_ONLINE_GUESTS_EXPLAIN' => 'Allow display of guest user informations in viewonline.', - 'YES_ONLINE_TRACK' => 'Enable display of user online img', - 'YES_ONLINE_TRACK_EXPLAIN' => 'Display online information for user in profiles and viewtopic.', - 'YES_BIRTHDAYS' => 'Enable birthday listing', - 'YES_MODERATORS' => 'Enable display of Moderators', - 'YES_JUMPBOX' => 'Enable display of Jumpbox', + '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_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.', + 'CLASS_B' => 'A.B', + 'CLASS_C' => 'A.B.C', + '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.', + '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)', + 'PASSWORD_TYPE' => 'Password complexity', + 'PASSWORD_TYPE_EXPLAIN' => 'Determines how complex a password needs to be when set or altered, subsequent options include the previous ones.', + 'PASS_TYPE_ALPHA' => 'Must contain alphanumerics', + 'PASS_TYPE_ANY' => 'No requirements', + '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.', +)); +// 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.', - '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.', - '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.', - 'BOARD_HIDE_EMAILS' => 'Hide email addresses', - 'BOARD_HIDE_EMAILS_EXPLAIN' => 'This function keeps email addresses completely private.', - '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_EXPLAIN' => 'This is the number of emails sent in one package.', - 'ADMIN_EMAIL' => 'Return Email Address', - 'ADMIN_EMAIL_EXPLAIN' => 'This will be used as the return address on all emails.', - 'EMAIL_SIG' => 'Email Signature', - 'EMAIL_SIG_EXPLAIN' => 'This text will be attached to all emails the board sends.', - '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.', - - 'SMTP_SETTINGS' => 'SMTP Settings', - '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.', - 'SMTP_SERVER' => 'SMTP Server Address', - 'SMTP_PORT' => 'SMTP Server Port', - 'SMTP_PORT_EXPLAIN' => 'Only change this if you know your SMTP server is on a different port.', - 'SMTP_AUTH_METHOD' => 'Authentication method for SMTP', - 'SMTP_AUTH_METHOD_EXPLAIN' => 'Only used if a username/password is set, ask your provider if you are unsure which method to use.', - 'SMTP_LOGIN' => 'LOGIN', - 'SMTP_PLAIN' => 'PLAIN', - 'SMTP_CRAM_MD5' => 'CRAM-MD5', - 'SMTP_DIGEST_MD5' => 'DIGEST-MD5', - 'SMTP_POP_BEFORE_SMTP' => 'POP-BEFORE-SMTP', - 'SMTP_USERNAME' => 'SMTP Username', - 'SMTP_USERNAME_EXPLAIN' => 'Only enter a username if your smtp server requires it.', - 'SMTP_PASSWORD' => 'SMTP Password', - 'SMTP_PASSWORD_EXPLAIN' => 'Only enter a password if your smtp server requires it.', - 'ACP_BOARD_SETTINGS_EXPLAIN' => 'Here you can determine the basic operation of your board, from the site name through user registration to private messaging.', - 'SITE_NAME' => 'Site name', - 'SITE_DESC' => 'Site description', - '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.', - 'ACC_ACTIVATION' => 'Account activation', - 'ACC_ACTIVATION_EXPLAIN' => 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations.', - 'ACC_NONE' => 'None', - 'ACC_USER' => 'User', - 'ACC_ADMIN' => 'Admin', - 'ACC_USER_ADMIN' => 'User + Admin', - 'ACC_DISABLE' => 'Disable', - '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_EXPLAIN' => 'Number of days after which persistent login keys are removed or zero to disable.', - 'VISUAL_CONFIRM_REG' => 'Enable visual confirmation for registrations', - 'VISUAL_CONFIRM_REG_EXPLAIN'=> 'Requires new users to enter a random code matching an image to help prevent mass registrations.', - 'VISUAL_CONFIRM_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.', - 'LOGIN_LIMIT' => 'Login attempts', - 'LOGIN_LIMIT_EXPLAIN' => 'Number of failed logins users can make before being locked out that session', - 'REG_LIMIT' => 'Registration attempts', - 'REG_LIMIT_EXPLAIN' => 'Number of attempts users can make at the confirmation code before being locked out that session.', - '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.', - 'SAVE_PASSWORDS' => 'Save previous passwords', - 'SAVE_PASSWORDS_EXPLAIN' => 'Prevents users re-using the specified number of previous passwords or zero to disable.', - 'CHAR_LIMIT' => 'Max characters per post', - 'CHAR_LIMIT_EXPLAIN' => 'Set to 0 for unlimited characters.', - 'MAX_POST_URLS' => 'Max links per post', - 'MAX_POST_URLS_EXPLAIN' => 'Set to 0 for unlimited links.', - 'MAX_POST_FONT_SIZE' => 'Max font size per post', - 'MAX_POST_FONT_SIZE_EXPLAIN'=> 'Set to 0 for unlimited font size.', - 'MAX_POST_IMG_WIDTH' => 'Max image width per post', - 'MAX_POST_IMG_WIDTH_EXPLAIN'=> 'Set to 0 for unlimited image width.', - 'MAX_POST_IMG_HEIGHT' => 'Max image height per post', - 'MAX_POST_IMG_HEIGHT_EXPLAIN'=> 'Set to 0 for unlimited image height.', - 'SMILIES_LIMIT' => 'Max smilies per post', - 'SMILIES_LIMIT_EXPLAIN' => 'Set to 0 for unlimited smilies.', - 'QUOTE_DEPTH_LIMIT' => 'Max nested quotes per post', - 'QUOTE_DEPTH_LIMIT_EXPLAIN' => 'Set to 0 for unlimited depth.', - 'USERNAME_LENGTH' => 'Username length', - 'USERNAME_LENGTH_EXPLAIN' => 'Minimum and maximum number of characters in usernames.', - 'USERNAME_CHARS' => 'Limit username chars', - 'USERNAME_CHARS_EXPLAIN' => 'Restrict type of characters that may be used in usernames, spacers are; space, -, +, _, [ and ]', - 'PASSWORD_LENGTH' => 'Password length', - 'PASSWORD_LENGTH_EXPLAIN' => 'Minimum and maximum number of characters in passwords.', - 'PASSWORD_TYPE' => 'Password complexity', - 'PASSWORD_TYPE_EXPLAIN' => 'Determines how complex a password needs to be when set or altered, subsequent options include the previous ones.', - 'PASS_TYPE_ANY' => 'No requirements', - 'PASS_TYPE_CASE' => 'Must be mixed case', - 'PASS_TYPE_ALPHA' => 'Must contain alphanumerics', - 'PASS_TYPE_SYMBOL' => 'Must contain symbols', - 'MIN_CHARS' => 'Min', - 'MAX_CHARS' => 'Max', - 'ALLOW_EMAIL_REUSE' => 'Allow Email address re-use', - 'ALLOW_EMAIL_REUSE_EXPLAIN' => 'Different users can register with the same email address.', - 'USERNAME_CHARS_ANY' => 'Any character', - 'USERNAME_ALPHA_ONLY' => 'Alphanumeric only', - 'USERNAME_ALPHA_SPACERS' => 'Alphanumeric and spacers', - '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.', - 'COPPA_FAX' => 'COPPA Fax Number', - 'COPPA_HIDE_GROUPS' => 'Hide COPPA Groups', - 'COPPA_HIDE_GROUPS_EXPLAIN' => 'Do not display the special COPPA groups within admin-facing parts', - 'COPPA_MAIL' => 'COPPA Mailing Address', - 'COPPA_MAIL_EXPLAIN' => 'This is the mailing address where parents will send COPPA registration forms', - 'BOARD_PM' => 'Private Messaging', - 'BOARD_PM_EXPLAIN' => 'Enable or disable private messaging for all users.', - 'EDIT_TIME' => 'Limit editing time', - 'EDIT_TIME_EXPLAIN' => 'Limits the time available to edit a new post, zero equals infinity', - 'DISPLAY_LAST_EDITED' => 'Display last edited time information', - 'DISPLAY_LAST_EDITED_EXPLAIN' => 'Choose if the last edited by information to be displayed on posts', - 'FLOOD_INTERVAL' => 'Flood Interval', - 'FLOOD_INTERVAL_EXPLAIN' => 'Number of seconds a user must wait between posting new messages. To enable users to ignore this alter their permissions.', - '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.', - 'TOPICS_PER_PAGE' => 'Topics Per Page', - 'POSTS_PER_PAGE' => 'Posts Per Page', - 'HOT_THRESHOLD' => 'Posts for Popular Threshold', - 'MAX_POLL_OPTIONS' => 'Max number of poll options', - 'COPPA' => 'Coppa', - 'REGISTRATION' => 'User Registration', - 'POSTING' => 'Posting', - 'MODERATION' => 'Moderation', - 'WARNINGS_EXPIRE' => 'Warning duration', - 'WARNINGS_EXPIRE_EXPLAIN' => 'Number of days after it is issued before a warning will expire from a user\'s record', - - 'ACP_BOARD_DEFAULTS_EXPLAIN' => 'These settings allow you to define a number of default or global settings used by the board. This data is also used for new user registrations and (where relevant) guest users. Please note that registered users can override some of these options with their own settings.', - 'DEFAULT_STYLE' => 'Default Style', - 'OVERRIDE_STYLE' => 'Override user style', - 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces users style with the default.', - 'DEFAULT_LANGUAGE' => 'Default Language', - 'DEFAULT_DATE_FORMAT' => 'Date Format', - 'DEFAULT_DATE_FORMAT_EXPLAIN'=> 'The date format is the same as the PHP date function.', - 'SYSTEM_TIMEZONE' => 'System Timezone', - 'SYSTEM_DST' => 'Enable Daylight Savings Time', - 'ALLOW_TOPIC_NOTIFY' => 'Allow Topic Watching', - 'ALLOW_FORUM_NOTIFY' => 'Allow Forum Watching', - 'ALLOW_NAME_CHANGE' => 'Allow Username changes', + '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.', + 'BOARD_HIDE_EMAILS' => 'Hide email addresses', + '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_EXPLAIN' => 'The email function used to send mails through PHP.', + '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_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.', + 'SMTP_AUTH_METHOD' => 'Authentication method for SMTP', + 'SMTP_AUTH_METHOD_EXPLAIN' => 'Only used if a username/password is set, ask your provider if you are unsure which method to use.', + 'SMTP_CRAM_MD5' => 'CRAM-MD5', + '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_PLAIN' => 'PLAIN', + 'SMTP_POP_BEFORE_SMTP' => 'POP-BEFORE-SMTP', + 'SMTP_PORT' => 'SMTP Server Port', + 'SMTP_PORT_EXPLAIN' => 'Only change this if you know your SMTP server is on a different port.', + '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.', + '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.', +)); - 'MAX_SIG_LENGTH' => 'Maximum signature length', - 'MAX_SIG_LENGTH_EXPLAIN' => 'Maximum number of characters in user signatures.', - 'MAX_SIG_URLS' => 'Maximum signature links', - 'MAX_SIG_URLS_EXPLAIN' => 'Maximum number of links in user signatures. Set to 0 for unlimited links.', - 'MAX_SIG_FONT_SIZE' => 'Maximum signature font size', - 'MAX_SIG_FONT_SIZE_EXPLAIN' => 'Maximum font size allowed in user signatures. Set to 0 for unlimited size.', - 'MAX_SIG_SMILIES' => 'Maximum smilies per signature', - 'MAX_SIG_SMILIES_EXPLAIN' => 'Maximum smilies allowed in user signatures. Set to 0 for unlimited size.', - 'MAX_SIG_IMG_WIDTH' => 'Maximum signature image width', - 'MAX_SIG_IMG_WIDTH_EXPLAIN' => 'Maximum width of an image in user signatures. Set to 0 for unlimited size.', - 'MAX_SIG_IMG_HEIGHT' => 'Maximum signature image height', - 'MAX_SIG_IMG_HEIGHT_EXPLAIN'=> 'Maximum height of an image in user signatures. Set to 0 for unlimited size.', - 'MIN_RATINGS' => 'Ratings count before karma', - 'MIN_RATINGS_EXPLAIN' => 'Number of distinct ratings before users karma is calculated.', - 'ALLOW_ATTACHMENTS' => 'Allow Attachments', - 'ALLOW_PM_ATTACHMENTS' => 'Allow Attachments in Private Messages', - 'ALLOW_BBCODE' => 'Allow BBCode', - 'ALLOW_SMILIES' => 'Allow Smilies', - 'ALLOW_SIG' => 'Allow Signatures', - 'ALLOW_SIG_IMG' => 'Allow use of IMG BBCode Tag in user signatures', - 'ALLOW_SIG_BBCODE' => 'Allow BBCode in user signatures', - 'ALLOW_SIG_SMILIES' => 'Allow use of smilies in user signatures', - 'ALLOW_SIG_FLASH' => 'Allow use of FLASH BBCode Tag in user signatures', - 'ALLOW_NO_CENSORS' => 'Allow Disable of Censors', - 'ALLOW_NO_CENSORS_EXPLAIN' => 'User can disable word censoring.', - 'ALLOW_BOOKMARKS' => 'Allow bookmarking topics', - 'ALLOW_BOOKMARKS_EXPLAIN' => 'User is able to store personal bookmarks', +// 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_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_ENABLE' => 'Enable Jabber', + 'JAB_ENABLE_EXPLAIN' => 'Enables use of jabber messaging and notifications', + '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_PORT' => 'Jabber port', + 'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not 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_USERNAME' => 'Jabber username', + 'JAB_USERNAME_EXPLAIN' => 'If this user is not registered it will be created if possible.', )); ?>
\ 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 de46158b69..3db436e1ca 100644 --- a/phpBB/language/en/acp/permissions_phpbb.php +++ b/phpBB/language/en/acp/permissions_phpbb.php @@ -148,7 +148,7 @@ $lang = array_merge($lang, array( 'acl_f_search' => array('lang' => 'Can search the forum', 'cat' => 'misc'), 'acl_f_ignoreflood' => array('lang' => 'Can ignore flood limit', 'cat' => 'misc'), 'acl_f_postcount' => array('lang' => 'Increment post counter', 'cat' => 'misc'), - 'acl_f_moderate' => array('lang' => 'Posts are moderated', 'cat' => 'misc'), + 'acl_f_noapprove' => array('lang' => 'Can post without approval', 'cat' => 'misc'), )); // Moderator Permissions diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 1a33fe956a..3d92f159fa 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -128,6 +128,7 @@ $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", 'EMPTY_SUBJECT' => 'You must specify a subject when posting a new topic.', 'ENABLED' => 'Enabled', 'ENCLOSURE' => 'Enclosure', @@ -217,15 +218,16 @@ $lang = array_merge($lang, array( 'HOURS' => 'Hours', 'HOME' => 'Home', - 'ICQ_STATUS' => 'ICQ status', - 'IF' => 'if', - 'IMAGE' => 'Image', - 'IN' => 'in', - 'INDEX' => 'Index page', - 'INFORMATION' => 'Information', - 'INTERESTS' => 'Interests', - 'INVALID_EMAIL_LOG' => '<strong>%s</strong> possibly an invalid email address?', - 'IP' => 'IP', + 'ICQ_STATUS' => 'ICQ status', + 'IF' => 'if', + 'IMAGE' => 'Image', + 'IN' => 'in', + 'INDEX' => 'Index page', + 'INFORMATION' => 'Information', + 'INTERESTS' => 'Interests', + 'INVALID_DIGEST_CHALLENGE' => 'Invalid digest challenge', + 'INVALID_EMAIL_LOG' => '<strong>%s</strong> possibly an invalid email address?', + 'IP' => 'IP', 'JOINED' => 'Joined', 'JUMP_PAGE' => 'Enter the page number you wish to go to', @@ -293,7 +295,11 @@ $lang = array_merge($lang, array( '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_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_FORUMS' => 'This board has no forums', 'NO_GROUP' => 'The requested usergroup does not exist.', @@ -304,6 +310,7 @@ $lang = array_merge($lang, array( 'NO_NEW_POSTS' => 'No new posts', 'NO_POSTS' => 'No posts', '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_UNREAD_PM' => '<strong>0</strong> unread messages', @@ -415,6 +422,7 @@ $lang = array_merge($lang, array( 'SETTINGS' => 'Settings', 'SIGNATURE' => 'Signature', 'SKIP' => 'Skip to content', + 'SMTP_NO_AUTH_SUPPORT' => 'SMTP server does not support authentication', 'SORRY_AUTH_READ' => 'You are not authorised to read this forum', 'SORT_BY' => 'Sort by', 'SORT_JOINED' => 'Joined date', @@ -439,18 +447,41 @@ $lang = array_merge($lang, array( 'THE_TEAM' => 'The team', 'TIME' => 'Time', + 'TOO_LONG_AIM' => 'The screenname you entered is too long.', + 'TOO_LONG_CONFIRM_CODE' => 'The confirm code you entered is too long.', + 'TOO_LONG_ICQ' => 'The ICQ number you entered is too long.', + 'TOO_LONG_INTERESTS' => 'The interests you entered is too long.', + 'TOO_LONG_JABBER' => 'The jabber account name you entered is too long.', + 'TOO_LONG_LOCATION' => 'The location you entered is too long.', + 'TOO_LONG_MSN' => 'The MSN name you entered is too long.', 'TOO_LONG_NEW_PASSWORD' => 'The password you entered is too long.', + 'TOO_LONG_OCCUPATION' => 'The occupation you entered is too long.', 'TOO_LONG_PASSWORD_CONFIRM' => 'The password confirmation you entered is too long.', 'TOO_LONG_USER_PASSWORD' => 'The password you entered is too long.', 'TOO_LONG_USERNAME' => 'The username you entered is too long.', + 'TOO_LONG_EMAIL' => 'The email address you entered is too long.', + 'TOO_LONG_EMAIL_CONFIRM' => 'The email address confirmation you entered is too long.', + 'TOO_LONG_WEBSITE' => 'The website address you entered is too long.', + 'TOO_LONG_YIM' => 'The yahoo messenger name you entered is too long.', + 'TOO_MANY_VOTE_OPTIONS' => 'You have tried to vote for too many options.', + + 'TOO_SHORT_AIM' => 'The screenname you entered is too short.', 'TOO_SHORT_CONFIRM_CODE' => 'The confirm code you entered is too short.', + 'TOO_SHORT_ICQ' => 'The ICQ number you entered is too short.', + 'TOO_SHORT_INTERESTS' => 'The interests you entered is too short.', + 'TOO_SHORT_JABBER' => 'The jabber account name you entered is too short.', + 'TOO_SHORT_LOCATION' => 'The location you entered is too short.', + 'TOO_SHORT_MSN' => 'The MSN name you entered is too short.', 'TOO_SHORT_NEW_PASSWORD' => 'The password you entered is too short.', + 'TOO_SHORT_OCCUPATION' => 'The occupation you entered is too short.', 'TOO_SHORT_PASSWORD_CONFIRM' => 'The password confirmation you entered is too short.', 'TOO_SHORT_USER_PASSWORD' => 'The password you entered is too short.', 'TOO_SHORT_USERNAME' => 'The username you entered is too short.', 'TOO_SHORT_EMAIL' => 'The email address you entered is too short.', 'TOO_SHORT_EMAIL_CONFIRM' => 'The email address confirmation you entered is too short.', + 'TOO_SHORT_WEBSITE' => 'The website address you entered is too short.', + 'TOO_SHORT_YIM' => 'The yahoo messenger name you entered is too short.', 'TOPIC' => 'Topic', 'TOPICS' => 'Topics', @@ -524,6 +555,11 @@ $lang = array_merge($lang, array( 'WHO_IS_ONLINE' => 'Who is online', 'WRONG_PASSWORD' => 'You entered an incorrect password.', + 'WRONG_DATA_ICQ' => 'The number you entered is not a valid icq number.', + 'WRONG_DATA_JABBER' => 'The name you entered is not a valid jabber account name.', + 'WRONG_DATA_LANG' => 'The language you specified is not valid.', + 'WRONG_DATA_WEBSITE' => 'The website address has to be a valid url, including the protocol. For example http://www.example.com/.', + 'YEAR' => 'Year', 'YES' => 'Yes', 'YOU_LAST_VISIT' => 'Last visit was: %s', diff --git a/phpBB/language/en/email/group_approved.txt b/phpBB/language/en/email/group_approved.txt index 38773c513d..b2134f86f9 100644 --- a/phpBB/language/en/email/group_approved.txt +++ b/phpBB/language/en/email/group_approved.txt @@ -6,6 +6,6 @@ Congratulations, Your request to join the "{GROUP_NAME}" group on {SITENAME} has been approved. Click on the following link to see your group membership. -{U_GROUPCP} +{U_GROUP} {EMAIL_SIG} diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index 977b6d63d3..d7e196ebf8 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -108,6 +108,8 @@ $lang = array_merge($lang, array( 'LOGIN_EXPLAIN_REPLY' => 'You need to login in order to reply to topics within this forum', 'MAX_FONT_SIZE_EXCEEDED' => 'You may only use fonts up to size %1$d.', + 'MAX_FLASH_HEIGHT_EXCEEDED' => 'Your flash files may only be up to %1$d pixels high.', + 'MAX_FLASH_WIDTH_EXCEEDED' => 'Your flash files may only be up to %1$d pixels wide.', 'MAX_IMG_HEIGHT_EXCEEDED' => 'Your images may only be up to %1$d pixels high.', 'MAX_IMG_WIDTH_EXCEEDED' => 'Your images may only be up to %1$d pixels wide.', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 7989be639a..94b74f9185 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -443,7 +443,6 @@ $lang = array_merge($lang, array( 'WATCHED_FORUMS' => 'Watched forums', 'WATCHED_TOPICS' => 'Watched topics', 'WRONG_ACTIVATION' => 'The activation key you supplied does not match any in the database', - 'WRONG_DATA_WEBSITE' => 'The website address has to be a valid url, including the protocol. For example http://www.example.com/.', 'YOUR_DETAILS' => 'Your activity', 'YOUR_FOES' => 'Your foes', diff --git a/phpBB/mcp.php b/phpBB/mcp.php index d8450a4470..6f805cb2be 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -14,12 +14,9 @@ define('IN_PHPBB', true); $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.'.$phpEx); -include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); -require($phpbb_root_path . 'includes/functions_module.'.$phpEx); - -/** -*/ +include($phpbb_root_path . 'common.' . $phpEx); +include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); +require($phpbb_root_path . 'includes/functions_module.' . $phpEx); // Start session management $user->session_begin(); @@ -46,7 +43,7 @@ if (!$user->data['is_registered']) { if ($user->data['is_bot']) { - redirect("index.$phpEx$SID"); + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } login_box('', $user->lang['LOGIN_EXPLAIN_MCP']); @@ -110,7 +107,8 @@ if (!$auth->acl_get('m_') && !$auth->acl_getf_global('m_')) 'make_sticky' => 'f_sticky', 'make_announce' => 'f_announce', 'make_global' => 'f_announce', - 'make_normal' => array('f_announce', 'f_sticky')); + 'make_normal' => array('f_announce', 'f_sticky') + ); $allow_user = false; if ($quickmod && isset($user_quickmod_actions[$action]) && $user->data['is_registered'] && $auth->acl_gets($user_quickmod_actions[$action], $forum_id)) @@ -130,7 +128,7 @@ if (!$auth->acl_get('m_') && !$auth->acl_getf_global('m_')) if ($forum_id) { - $module->acl_forup_id = $forum_id; + $module->acl_forum_id = $forum_id; } // Instantiate module system and generate list of available modules @@ -155,7 +153,8 @@ if ($quickmod) case 'delete_post': case 'delete_topic': $module->load('mcp', 'main', 'quickmod'); - exit; + exit; + break; case 'topic_logs': $module->set_active('logs', 'topic_logs'); @@ -211,7 +210,7 @@ if (!$user_id && $username == '') $module->load_active(); // Assign data to the template engine for the list of modules -$module->assign_tpl_vars("mcp.$phpEx$SID"); +$module->assign_tpl_vars(append_sid("{$phpbb_root_path}mcp.$phpEx")); // Generate the page $module->display($module->get_page_title()); @@ -233,10 +232,12 @@ function _module_logs_url($mode) function extra_url() { global $forum_id, $topic_id, $post_id; + $url_extra = ''; $url_extra .= ($forum_id) ? "&f=$forum_id" : ''; $url_extra .= ($topic_id) ? "&t=$topic_id" : ''; $url_extra .= ($post_id) ? "&p=$post_id" : ''; + return $url_extra; } @@ -247,6 +248,7 @@ function get_topic_data($topic_ids, $acl_list = false) { global $auth, $db; static $rowset = array(); + $topics = array(); if (!sizeof($topic_ids)) @@ -276,6 +278,7 @@ function get_topic_data($topic_ids, $acl_list = false) $topics[$row['topic_id']] = $row; } + $db->sql_freeresult($result); } foreach ($cache_topic_ids as $id) @@ -295,6 +298,7 @@ function get_topic_data($topic_ids, $acl_list = false) function get_post_data($post_ids, $acl_list = false) { global $db, $auth; + $rowset = array(); if (!sizeof($post_ids)) @@ -319,8 +323,8 @@ function get_post_data($post_ids, $acl_list = false) ), 'WHERE' => 'p.post_id IN (' . implode(', ', $post_ids) . ') - AND u.user_id = p.poster_id - AND t.topic_id = p.topic_id', + AND u.user_id = p.poster_id + AND t.topic_id = p.topic_id', )); $result = $db->sql_query($sql); @@ -339,6 +343,7 @@ function get_post_data($post_ids, $acl_list = false) $rowset[$row['post_id']] = $row; } + $db->sql_freeresult($result); return $rowset; } @@ -349,6 +354,7 @@ function get_post_data($post_ids, $acl_list = false) function get_forum_data($forum_id, $acl_list = 'f_list') { global $auth, $db; + $rowset = array(); if (!sizeof($forum_id)) @@ -367,6 +373,7 @@ function get_forum_data($forum_id, $acl_list = 'f_list') { continue; } + if ($auth->acl_get('m_approve', $row['forum_id'])) { $row['forum_topics'] = $row['forum_topics_real']; @@ -374,6 +381,7 @@ function get_forum_data($forum_id, $acl_list = 'f_list') $rowset[$row['forum_id']] = $row; } + $db->sql_freeresult($result); return $rowset; } @@ -396,6 +404,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, $type = 'topics'; $default_key = 't'; $default_dir = 'd'; + $sql = 'SELECT COUNT(topic_id) AS total FROM ' . TOPICS_TABLE . " $where_sql forum_id = $forum_id @@ -406,21 +415,23 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, { $sql .= 'AND topic_approved = 1'; } - break; + break; case 'viewtopic': $type = 'posts'; $default_key = 't'; $default_dir = 'a'; + $sql = 'SELECT COUNT(post_id) AS total FROM ' . POSTS_TABLE . " $where_sql topic_id = $topic_id AND post_time >= $min_time"; + if (!$auth->acl_get('m_approve', $forum_id)) { $sql .= 'AND post_approved = 1'; } - break; + break; case 'unapproved_posts': $type = 'posts'; @@ -433,18 +444,19 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, $where_sql forum_id IN (" . (($forum_id) ? $forum_id : implode(', ', get_forum_list('m_approve'))) . ') AND post_approved = 0 AND post_time >= ' . $min_time; - break; + break; case 'unapproved_topics': $type = 'topics'; $default_key = 't'; $default_dir = 'd'; + $sql = 'SELECT COUNT(topic_id) AS total FROM ' . TOPICS_TABLE . " $where_sql forum_id IN (" . (($forum_id) ? $forum_id : implode(', ', get_forum_list('m_approve'))) . ') AND topic_approved = 0 AND topic_time >= ' . $min_time; - break; + break; case 'reports': case 'reports_closed': @@ -480,18 +492,19 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, $where_sql AND p.post_id = r.post_id $limit_time_sql"; - break; + break; case 'viewlogs': $type = 'logs'; $default_key = 't'; $default_dir = 'd'; + $sql = 'SELECT COUNT(log_id) AS total FROM ' . LOG_TABLE . " $where_sql forum_id IN (" . (($forum_id) ? $forum_id : implode(', ', get_forum_list('m_'))) . ') AND log_time >= ' . $min_time . ' AND log_type = ' . LOG_MOD; - break; + break; } $sort_key = request_var('sk', $default_key); @@ -506,20 +519,20 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, $sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'tt' => 't.topic_time', 'r' => (($auth->acl_get('m_approve', $forum_id)) ? 't.topic_replies_real' : 't.topic_replies'), 's' => 't.topic_title', 'v' => 't.topic_views'); $limit_time_sql = ($min_time) ? "AND t.topic_last_post_time >= $min_time" : ''; - break; + break; case 'posts': $limit_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); $sort_by_sql = array('a' => 'u.username', 't' => 'p.post_id', 's' => 'p.post_subject'); $limit_time_sql = ($min_time) ? "AND p.post_time >= $min_time" : ''; - break; + break; case 'reports': $limit_days = array(0 => $user->lang['ALL_REPORTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('a' => $user->lang['AUTHOR'], 'r' => $user->lang['REPORTER'], 'p' => $user->lang['POST_TIME'], 't' => $user->lang['REPORT_TIME'], 's' => $user->lang['SUBJECT']); $sort_by_sql = array('a' => 'u.username', 'r' => 'ru.username', 'p' => 'p.post_id', 't' => 'r.report_time', 's' => 'p.post_subject'); - break; + break; case 'logs': $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); @@ -527,7 +540,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, $sort_by_sql = array('u' => 'l.user_id', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); $limit_time_sql = ($min_time) ? "AND l.log_time >= $min_time" : ''; - break; + break; } $sort_order_sql = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); @@ -536,15 +549,16 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $sort_url); $template->assign_vars(array( - 'S_SELECT_SORT_DIR' => $s_sort_dir, - 'S_SELECT_SORT_KEY' => $s_sort_key, - 'S_SELECT_SORT_DAYS'=> $s_limit_days) + 'S_SELECT_SORT_DIR' => $s_sort_dir, + 'S_SELECT_SORT_KEY' => $s_sort_key, + 'S_SELECT_SORT_DAYS' => $s_limit_days) ); if (($sort_days && $mode != 'viewlogs') || in_array($mode, array('reports', 'unapproved_topics', 'unapproved_posts')) || $where_sql != 'WHERE') { $result = $db->sql_query($sql); - $total = ($row = $db->sql_fetchrow($result)) ? $row['total'] : 0; + $total = (int) $db->sql_fetchfield('total'); + $db->sql_freeresult($result); } else { @@ -606,7 +620,7 @@ function check_ids(&$ids, $table, $sql_id, $acl_list = false) if (!$forum_id) { - trigger_error('Missing forum_id, has to be in url if global announcement...'); + trigger_error('Missing forum_id, has to be in url if global announcement...', E_USER_ERROR); } $sql = "SELECT $sql_id FROM $table diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 22567691e0..35867eabc2 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -14,7 +14,7 @@ define('IN_PHPBB', true); $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.'.$phpEx); +include($phpbb_root_path . 'common.' . $phpEx); // Start session management $user->session_begin(); @@ -31,7 +31,7 @@ $topic_id = request_var('t', 0); switch ($mode) { case 'email': - break; + break; default: // Can this user view profiles/memberlist? @@ -44,7 +44,7 @@ switch ($mode) login_box('', ((isset($user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)])) ? $user->lang['LOGIN_EXPLAIN_' . strtoupper($mode)] : $user->lang['LOGIN_EXPLAIN_MEMBERLIST'])); } - break; + break; } @@ -65,7 +65,6 @@ switch ($mode) { case 'leaders': // Display a listing of board admins, moderators - $user->add_lang('groups'); $page_title = $user->lang['THE_TEAM']; @@ -129,7 +128,7 @@ switch ($mode) ), 'WHERE' => 'u.user_id IN (' . implode(', ', array_unique(array_merge($admin_id_ary, $mod_id_ary))) . ') - AND u.group_id = g.group_id', + AND u.group_id = g.group_id', 'ORDER_BY' => 'g.group_name ASC, u.username ASC' )); @@ -164,7 +163,7 @@ switch ($mode) else { $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']; - $u_group = "{$phpbb_root_path}memberlist.$phpEx$SID&mode=group&g={$row['group_id']}"; + $u_group = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']); } $rank_title = $rank_img = ''; @@ -183,8 +182,8 @@ switch ($mode) 'RANK_IMG_SRC' => $rank_img_src, 'U_GROUP' => $u_group, - 'U_VIEWPROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['user_id']}", - 'U_PM' => ($auth->acl_get('u_sendpm')) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=compose&u={$row['user_id']}" : '') + 'U_VIEWPROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), + 'U_PM' => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $row['user_id']) : '') ); } $db->sql_freeresult($result); @@ -192,7 +191,7 @@ switch ($mode) $template->assign_vars(array( 'PM_IMG' => $user->img('btn_pm', $user->lang['SEND_PRIVATE_MESSAGE'])) ); - break; + break; case 'contact': $page_title = $user->lang['IM_USER']; @@ -206,32 +205,32 @@ switch ($mode) $sql_field = 'user_icq'; $s_select = 'S_SEND_ICQ'; $s_action = 'http://wwp.icq.com/scripts/WWPMsg.dll'; - break; + break; case 'aim': $lang = 'AIM'; $sql_field = 'user_aim'; $s_select = 'S_SEND_AIM'; $s_action = ''; - break; + break; case 'msnm': $lang = 'MSNM'; $sql_field = 'user_msnm'; $s_select = 'S_SEND_MSNM'; $s_action = ''; - break; + break; case 'jabber': $lang = 'JABBER'; $sql_field = 'user_jabber'; $s_select = (@extension_loaded('xml') && $config['jab_enable']) ? 'S_SEND_JABBER' : 'S_NO_SEND_JABBER'; - $s_action = "{$phpbb_root_path}memberlist.$phpEx$SID&mode=contact&action=$action&u=$user_id"; - break; + $s_action = append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=$action&u=$user_id"); + break; default: $sql_field = ''; - break; + break; } // Grab relevant data @@ -240,24 +239,25 @@ switch ($mode) WHERE user_id = $user_id AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')'; $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!($row = $db->sql_fetchrow($result))) + if (!$row) { trigger_error('NO_USER_DATA'); } - $db->sql_freeresult($result); // Post data grab actions switch ($action) { case 'icq': $presence_img = '<img src="http://web.icq.com/whitepages/online?icq=' . $row[$sql_field] . '&img=5" width="18" height="18" alt="" />'; - break; + break; case 'jabber': if ($submit && @extension_loaded('xml') && $config['jab_enable']) { - include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']); $message = request_var('message', '', true); @@ -273,7 +273,7 @@ switch ($mode) $messenger->assign_vars(array( 'SITENAME' => $config['sitename'], 'BOARD_EMAIL' => $config['board_contact'], - 'FROM_USERNAME' => html_entity_decode($user->data['username']), + 'FROM_USERNAME' => html_entity_decode($user->data['username']), 'TO_USERNAME' => html_entity_decode($row['username']), 'MESSAGE' => html_entity_decode($message)) ); @@ -282,7 +282,7 @@ switch ($mode) $s_select = 'S_SENT_JABBER'; } - break; + break; } // Send vars to the template @@ -302,7 +302,7 @@ switch ($mode) 'S_IM_ACTION' => $s_action) ); - break; + break; case 'viewprofile': // Display a profile @@ -317,12 +317,13 @@ switch ($mode) WHERE user_id = $user_id AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')'; $result = $db->sql_query($sql); + $member = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!($member = $db->sql_fetchrow($result))) + if (!$member) { trigger_error('NO_USER'); } - $db->sql_freeresult($result); // Do the SQL thang $sql = 'SELECT g.group_id, g.group_name, g.group_type @@ -365,7 +366,7 @@ switch ($mode) if ($member['user_sig_bbcode_bitfield'] && $member['user_sig']) { - include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); + 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']); } @@ -382,14 +383,15 @@ switch ($mode) { case AVATAR_UPLOAD: $poster_avatar = $config['avatar_path'] . '/'; - break; + break; + case AVATAR_GALLERY: $poster_avatar = $config['avatar_gallery_path'] . '/'; - break; + break; } $poster_avatar .= $member['user_avatar']; - $poster_avatar = '<img src="' . $poster_avatar . '" width="' . $member['user_avatar_width'] . '" height="' . $member['user_avatar_height'] . '" border="0" alt="" />'; + $poster_avatar = '<img src="' . $poster_avatar . '" width="' . $member['user_avatar_width'] . '" height="' . $member['user_avatar_height'] . '" alt="" />'; } $template->assign_vars(show_profile($member)); @@ -398,7 +400,7 @@ switch ($mode) $profile_fields = array(); if ($config['load_cpf_viewprofile']) { - include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); + include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); $cp = new custom_profile(); $profile_fields = $cp->generate_profile_fields_template('grab', $user_id); $profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template('show', false, $profile_fields[$user_id]) : array(); @@ -423,25 +425,25 @@ switch ($mode) 'JABBER_IMG' => $user->img('btn_jabber', $user->lang['JABBER']), 'SEARCH_IMG' => $user->img('btn_search', $user->lang['SEARCH']), - 'S_PROFILE_ACTION' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=group", + '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')) ? "{$phpbb_root_path}adm/index.$phpEx?sid={$user->session_id}&i=users&mode=overview&u={$user_id}" : '', - 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? "{$phpbb_root_path}ucp.$phpEx$SID&mode=switch_perm&u={$user_id}" : '', + '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']) ? true : false, - 'U_ADD_FRIEND' => "{$phpbb_root_path}ucp.$phpEx$SID&i=zebra&add=" . urlencode($member['username']), - 'U_ADD_FOE' => "{$phpbb_root_path}ucp.$phpEx$SID&i=zebra&mode=foes&add=" . urlencode($member['username'])) + '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']))) ); - if (isset($profile_fields['row']) && sizeof($profile_fields['row'])) + if (!empty($profile_fields['row'])) { $template->assign_vars($profile_fields['row']); } - if (isset($profile_fields['blockrow']) && sizeof($profile_fields['blockrow'])) + if (!empty($profile_fields['blockrow'])) { foreach ($profile_fields['blockrow'] as $field_data) { @@ -603,7 +605,7 @@ switch ($mode) WHERE user_id = ' . $user->data['user_id']; $result = $db->sql_query($sql); - include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $messenger = new messenger(false); $email_tpl = ($user_id) ? 'profile_send_email' : 'email_notify'; @@ -653,8 +655,8 @@ switch ($mode) $messenger->send($notify_type); $messenger->save_queue(); - meta_refresh(3, "index.$phpEx$SID"); - $message = ($user_id) ? sprintf($user->lang['RETURN_INDEX'], '<a href="' . "index.$phpEx$SID" . '">', '</a>') : sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $phpbb_root_path . "viewtopic.$phpEx$SID&f={$row['forum_id']}&t=$topic_id" . '">', '</a>'); + meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); + $message = ($user_id) ? sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>') : sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$row['forum_id']}&t=$topic_id") . '">', '</a>'); trigger_error($user->lang['EMAIL_SENT'] . '<br /><br />' . $message); } } @@ -666,7 +668,7 @@ switch ($mode) 'USERNAME' => $row['username'], 'L_EMAIL_BODY_EXPLAIN' => $user->lang['EMAIL_BODY_EXPLAIN'], - 'S_POST_ACTION' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=email&u=$user_id") + 'S_POST_ACTION' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=email&u=' . $user_id)) ); } else @@ -677,7 +679,7 @@ switch ($mode) 'S_LANG_OPTIONS' => language_select($email_lang), 'L_EMAIL_BODY_EXPLAIN' => $user->lang['EMAIL_TOPIC_EXPLAIN'], - 'S_POST_ACTION' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=email&t=$topic_id") + 'S_POST_ACTION' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=email&t=' . $topic_id)) ); } @@ -716,7 +718,7 @@ switch ($mode) // Additional sorting options for user search ... if search is enabled, if not // then only admins can make use of this (for ACP functionality) $sql_select = $sql_from = $sql_where = $order_by = ''; - + $form = request_var('form', ''); $field = request_var('field', ''); @@ -775,7 +777,7 @@ switch ($mode) $sql_where .= (sizeof($joined) > 1) ? " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : ''; $sql_where .= (sizeof($active) > 1) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : ''; $sql_where .= ($search_group_id) ? " AND u.user_id = ug.user_id AND ug.group_id = $search_group_id " : ''; - + if ($search_group_id) { $sql_from = ', ' . USER_GROUP_TABLE . ' ug '; @@ -833,21 +835,24 @@ switch ($mode) LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (ug.user_id = ' . $user->data['user_id'] . " AND ug.group_id = $group_id) WHERE g.group_id = $group_id"; $result = $db->sql_query($sql); + $group_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - if (!$group_row = $db->sql_fetchrow($result)) + if (!$group_row) { trigger_error('NO_GROUP'); } - $db->sql_freeresult($result); switch ($group_row['group_type']) { case GROUP_OPEN: $group_row['l_group_type'] = 'OPEN'; - break; + break; + case GROUP_CLOSED: $group_row['l_group_type'] = 'CLOSED'; - break; + break; + case GROUP_HIDDEN: $group_row['l_group_type'] = 'HIDDEN'; @@ -856,13 +861,15 @@ switch ($mode) { trigger_error('NO_GROUP'); } - break; + break; + case GROUP_SPECIAL: $group_row['l_group_type'] = 'SPECIAL'; - break; + break; + case GROUP_FREE: $group_row['l_group_type'] = 'FREE'; - break; + break; } $avatar_img = ''; @@ -872,14 +879,15 @@ switch ($mode) { case AVATAR_UPLOAD: $avatar_img = $phpbb_root_path . $config['avatar_path'] . '/'; - break; + break; + case AVATAR_GALLERY: $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/'; - break; + break; } $avatar_img .= $group_row['group_avatar']; - $avatar_img = '<img src="' . $avatar_img . '" width="' . $group_row['group_avatar_width'] . '" height="' . $group_row['group_avatar_height'] . '" border="0" alt="" />'; + $avatar_img = '<img src="' . $avatar_img . '" width="' . $group_row['group_avatar_width'] . '" height="' . $group_row['group_avatar_height'] . '" alt="" />'; } $rank_title = $rank_img = $rank_img_src = ''; @@ -910,7 +918,7 @@ switch ($mode) 'RANK_IMG' => $rank_img, 'RANK_IMG_SRC' => $rank_img_src, - 'U_PM' => ($auth->acl_get('u_sendpm') && $group_row['group_receive_pm'] && $config['allow_mass_pm']) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=compose&g=$group_id" : '',) + 'U_PM' => ($auth->acl_get('u_sendpm') && $group_row['group_receive_pm'] && $config['allow_mass_pm']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&g=' . $group_id) : '',) ); $sql_select = ', ug.group_leader'; @@ -931,8 +939,7 @@ switch ($mode) WHERE u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ") $sql_where"; $result = $db->sql_query($sql); - - $total_users = ($row = $db->sql_fetchrow($result)) ? $row['total_users'] : 0; + $total_users = (int) $db->sql_fetchfield('total_users'); $db->sql_freeresult($result); } else @@ -947,10 +954,8 @@ switch ($mode) } $s_char_options .= '<option value="other"' . (($first_char == 'other') ? ' selected="selected"' : '') . '>Other</option>'; - // Pagination string - $pagination_url = "{$phpbb_root_path}memberlist.$phpEx$SID"; - // Build a relevant pagination_url + $params = array(); foreach (array('_POST', '_GET') as $global_var) { foreach ($$global_var as $key => $var) @@ -964,12 +969,14 @@ switch ($mode) { continue; } - $pagination_url .= '&' . $key . '=' . urlencode(htmlspecialchars($var)); + $params[] = $key . '=' . urlencode(htmlspecialchars($var)); } } - $u_hide_find_member = $pagination_url; - $pagination_url .= "&mode=$mode&first_char=$first_char"; + $u_hide_find_member = append_sid("{$phpbb_root_path}memberlist.$phpEx", implode('&', $params)); + + $params[] = "mode=$mode&first_char=$first_char"; + $pagination_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", implode('&', $params)); // Some search user specific data if ($mode == 'searchuser' && ($config['load_search'] || $auth->acl_get('a_'))) @@ -1002,15 +1009,15 @@ switch ($mode) 'COUNT' => $count, 'IP' => $ipdomain, - 'S_SEARCH_USER' => true, - 'S_FORM_NAME' => $form, - 'S_FIELD_NAME' => $field, - 'S_COUNT_OPTIONS' => $s_find_count, - 'S_SORT_OPTIONS' => $s_sort_key, - 'S_JOINED_TIME_OPTIONS' => $s_find_join_time, - 'S_ACTIVE_TIME_OPTIONS' => $s_find_active_time, + 'S_SEARCH_USER' => true, + 'S_FORM_NAME' => $form, + 'S_FIELD_NAME' => $field, + 'S_COUNT_OPTIONS' => $s_find_count, + 'S_SORT_OPTIONS' => $s_sort_key, + 'S_JOINED_TIME_OPTIONS' => $s_find_join_time, + 'S_ACTIVE_TIME_OPTIONS' => $s_find_active_time, 'S_GROUP_SELECT' => $s_group_select, - 'S_SEARCH_ACTION' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=searchuser&form=$form&field=$field") + 'S_SEARCH_ACTION' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&form=$form&field=$field")) ); } @@ -1029,7 +1036,7 @@ switch ($mode) $db->sql_freeresult($result); // Do the SQL thang - $sql = "SELECT u.username, u.user_id, u.user_colour, u.user_allow_viewemail, u.user_posts, u.user_regdate, u.user_rank, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_msnm, u.user_jabber, u.user_avatar, u.user_avatar_type, u.user_lastvisit + $sql = "SELECT u.* $sql_select FROM " . USERS_TABLE . " u $sql_from @@ -1050,13 +1057,13 @@ switch ($mode) // Load custom profile fields if ($config['load_cpf_memberlist']) { - include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); + include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); $cp = new custom_profile(); // Grab all profile fields from users in id cache for later use - similar to the poster cache $profile_fields_cache = $cp->generate_profile_fields_template('grab', array_keys($id_cache)); } - + $i = 0; foreach ($id_cache as $user_id => $row) { @@ -1071,8 +1078,8 @@ switch ($mode) 'S_CUSTOM_PROFILE' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false, 'S_GROUP_LEADER' => (isset($row['group_leader']) && $row['group_leader']) ? true : false, - - 'U_VIEWPROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=$user_id") + + 'U_VIEWPROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $user_id)) ); if (isset($cp_row['row']) && sizeof($cp_row['row'])) @@ -1096,8 +1103,8 @@ switch ($mode) // Generate page $template->assign_vars(array( - 'PAGINATION' => generate_pagination($pagination_url, $total_users, $config['topics_per_page'], $start), - 'PAGE_NUMBER' => on_page($total_users, $config['topics_per_page'], $start), + 'PAGINATION' => generate_pagination($pagination_url, $total_users, $config['topics_per_page'], $start), + 'PAGE_NUMBER' => on_page($total_users, $config['topics_per_page'], $start), 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['LIST_USER'] : sprintf($user->lang['LIST_USERS'], $total_users), 'PROFILE_IMG' => $user->img('btn_profile', $user->lang['PROFILE']), @@ -1111,22 +1118,22 @@ switch ($mode) 'JABBER_IMG' => $user->img('btn_jabber', $user->lang['JABBER']), 'SEARCH_IMG' => $user->img('btn_search', $user->lang['SEARCH']), - 'U_FIND_MEMBER' => ($config['load_search'] || $auth->acl_get('a_')) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=searchuser" : '', - 'U_HIDE_FIND_MEMBER'=> ($mode == 'searchuser') ? $u_hide_find_member : '', - 'U_SORT_USERNAME' => $pagination_url . '&sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_FROM' => $pagination_url . '&sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_JOINED' => $pagination_url . '&sk=c&sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_POSTS' => $pagination_url . '&sk=d&sd=' . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_EMAIL' => $pagination_url . '&sk=e&sd=' . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_WEBSITE' => $pagination_url . '&sk=f&sd=' . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_LOCATION' => $pagination_url . '&sk=n&sd=' . (($sort_key == 'n' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_ICQ' => $pagination_url . '&sk=g&sd=' . (($sort_key == 'g' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_AIM' => $pagination_url . '&sk=h&sd=' . (($sort_key == 'h' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_MSN' => $pagination_url . '&sk=i&sd=' . (($sort_key == 'i' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_YIM' => $pagination_url . '&sk=j&sd=' . (($sort_key == 'j' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_ACTIVE' => $pagination_url . '&sk=k&sd=' . (($sort_key == 'k' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_RANK' => $pagination_url . '&sk=m&sd=' . (($sort_key == 'm' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_LIST_CHAR' => $pagination_url . '&sk=a&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_FIND_MEMBER' => ($config['load_search'] || $auth->acl_get('a_')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser') : '', + 'U_HIDE_FIND_MEMBER' => ($mode == 'searchuser') ? $u_hide_find_member : '', + 'U_SORT_USERNAME' => $pagination_url . '&sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_FROM' => $pagination_url . '&sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_JOINED' => $pagination_url . '&sk=c&sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_POSTS' => $pagination_url . '&sk=d&sd=' . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_EMAIL' => $pagination_url . '&sk=e&sd=' . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_WEBSITE' => $pagination_url . '&sk=f&sd=' . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_LOCATION' => $pagination_url . '&sk=n&sd=' . (($sort_key == 'n' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_ICQ' => $pagination_url . '&sk=g&sd=' . (($sort_key == 'g' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_AIM' => $pagination_url . '&sk=h&sd=' . (($sort_key == 'h' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_MSN' => $pagination_url . '&sk=i&sd=' . (($sort_key == 'i' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_YIM' => $pagination_url . '&sk=j&sd=' . (($sort_key == 'j' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_ACTIVE' => $pagination_url . '&sk=k&sd=' . (($sort_key == 'k' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_RANK' => $pagination_url . '&sk=m&sd=' . (($sort_key == 'm' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_LIST_CHAR' => $pagination_url . '&sk=a&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a'), 'S_SHOW_GROUP' => ($mode == 'group') ? true : false, 'S_MODE_SELECT' => $s_sort_key, @@ -1142,7 +1149,7 @@ page_header($page_title); $template->set_filenames(array( 'body' => $template_html) ); -make_jumpbox('viewforum.'.$phpEx); +make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); page_footer(); @@ -1182,7 +1189,7 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank */ function show_profile($data) { - global $config, $auth, $template, $user, $SID, $phpEx, $phpbb_root_path; + global $config, $auth, $template, $user, $phpEx, $phpbb_root_path; $username = $data['username']; $user_id = $data['user_id']; @@ -1192,7 +1199,7 @@ function show_profile($data) if (!empty($data['user_allow_viewemail']) || $auth->acl_get('a_email')) { - $email = ($config['board_email_form'] && $config['email_enable']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=email&u=$user_id" : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $data['user_email']); + $email = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=email&u=' . $user_id) : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $data['user_email']); } else { @@ -1205,8 +1212,6 @@ function show_profile($data) $online = (time() - $update_time < $data['session_time'] && ((isset($data['session_viewonline']) && $data['user_allow_viewonline']) || $auth->acl_get('u_viewonline'))) ? true : false; // Dump it out to the template - // TODO - // Add permission check for IM clients return array( 'USERNAME' => $username, 'USER_COLOR' => (!empty($data['user_colour'])) ? $data['user_colour'] : '', @@ -1220,21 +1225,21 @@ function show_profile($data) 'S_ONLINE' => ($online) ? true : false, 'RANK_IMG' => $rank_img, 'RANK_IMG_SRC' => $rank_img_src, - 'ICQ_STATUS_IMG' => (!empty($data['user_icq'])) ? '<img src="http://web.icq.com/whitepages/online?icq=' . $data['user_icq'] . '&img=5" width="18" height="18" border="0" />' : '', + 'ICQ_STATUS_IMG' => (!empty($data['user_icq'])) ? '<img src="http://web.icq.com/whitepages/online?icq=' . $data['user_icq'] . '&img=5" width="18" height="18" />' : '', 'S_JABBER_ENABLED' => ($config['jab_enable']) ? true : false, - 'U_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=$user_id", - 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? "{$phpbb_root_path}search.$phpEx$SID&author_id=$user_id&sr=posts" : '', - 'U_NOTES' => $auth->acl_gets('m_', 'a_') ? "{$phpbb_root_path}mcp.$phpEx$SID&i=notes&mode=user_notes&u=$user_id" : '', - 'U_WARN' => $auth->acl_gets('m_', 'a_') ? "{$phpbb_root_path}mcp.$phpEx$SID&i=warn&mode=warn_user&u=$user_id" : '', - 'U_PM' => ($auth->acl_get('u_sendpm')) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=compose&u=$user_id" : '', + 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $user_id), + 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$user_id&sr=posts") : '', + 'U_NOTES' => $auth->acl_gets('m_', 'a_') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $user_id, true, $user->session_id) : '', + 'U_WARN' => $auth->acl_gets('m_', 'a_') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $user_id, true, $user->session_id) : '', + 'U_PM' => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $user_id) : '', 'U_EMAIL' => $email, 'U_WWW' => (!empty($data['user_website'])) ? $data['user_website'] : '', - 'U_ICQ' => ($data['user_icq']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=contact&action=icq&u=$user_id" : '', - 'U_AIM' => ($data['user_aim']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=contact&action=aim&u=$user_id" : '', + 'U_ICQ' => ($data['user_icq']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=icq&u=' . $user_id) : '', + 'U_AIM' => ($data['user_aim']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=aim&u=' . $user_id) : '', 'U_YIM' => ($data['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . $data['user_yim'] . '&.src=pg' : '', - 'U_MSN' => ($data['user_msnm']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=contact&action=msnm&u=$user_id" : '', - 'U_JABBER' => ($data['user_jabber']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=contact&action=jabber&u=$user_id" : '', + 'U_MSN' => ($data['user_msnm']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=msnm&u=' . $user_id) : '', + 'U_JABBER' => ($data['user_jabber']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=jabber&u=' . $user_id) : '', 'LOCATION' => ($data['user_from']) ? $data['user_from'] : '', 'L_VIEWING_PROFILE' => sprintf($user->lang['VIEWING_PROFILE'], $username), diff --git a/phpBB/posting.php b/phpBB/posting.php index 60e1411d41..f8333b5cbd 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -14,10 +14,10 @@ define('IN_PHPBB', true); $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.'.$phpEx); -include($phpbb_root_path . 'includes/functions_posting.'.$phpEx); +include($phpbb_root_path . 'common.' . $phpEx); +include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); -include($phpbb_root_path . 'includes/message_parser.'.$phpEx); +include($phpbb_root_path . 'includes/message_parser.' . $phpEx); // Start session management @@ -48,7 +48,7 @@ $current_time = time(); // Was cancel pressed? If so then redirect to the appropriate page if ($cancel || ($current_time - $lastclick < 2 && $submit)) { - $redirect = ($post_id) ? "viewtopic.$phpEx$SID&p=$post_id#p$post_id" : (($topic_id) ? "viewtopic.$phpEx$SID&t=$topic_id" : (($forum_id) ? "viewforum.$phpEx$SID&f=$forum_id" : "index.$phpEx$SID")); + $redirect = ($post_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $post_id) . '#p' . $post_id : (($topic_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id) : (($forum_id) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) : append_sid("{$phpbb_root_path}index.$phpEx"))); redirect($redirect); } @@ -57,8 +57,7 @@ if (in_array($mode, array('post', 'reply', 'quote', 'edit', 'delete')) && !$foru trigger_error('NO_FORUM'); } -// What is all this following SQL for? Well, we need to know -// some basic information in all cases before we do anything. +// We need to know some basic information in all cases before we do anything. switch ($mode) { case 'post': @@ -223,24 +222,27 @@ if ($mode == 'bump') { if ($bump_time = bump_topic_allowed($forum_id, $post_data['topic_bumped'], $post_data['topic_last_post_time'], $post_data['topic_poster'], $post_data['topic_last_poster_id'])) { - $db->sql_transaction(); + $db->sql_transaction('begin'); - $db->sql_query('UPDATE ' . POSTS_TABLE . " + $sql = 'UPDATE ' . POSTS_TABLE . " SET post_time = $current_time WHERE post_id = {$post_data['topic_last_post_id']} - AND topic_id = $topic_id"); + AND topic_id = $topic_id"; + $db->sql_query($sql); - $db->sql_query('UPDATE ' . TOPICS_TABLE . " + $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_last_post_time = $current_time, topic_bumped = 1, topic_bumper = " . $user->data['user_id'] . " - WHERE topic_id = $topic_id"); + WHERE topic_id = $topic_id"; + $db->sql_query($sql); update_post_information('forum', $forum_id); - $db->sql_query('UPDATE ' . USERS_TABLE . " + $sql = 'UPDATE ' . USERS_TABLE . " SET user_lastpost_time = $current_time - WHERE user_id = " . $user->data['user_id']); + WHERE user_id = " . $user->data['user_id']; + $db->sql_query($sql); $db->sql_transaction('commit'); @@ -248,15 +250,15 @@ if ($mode == 'bump') add_log('mod', $forum_id, $topic_id, sprintf($user->lang['LOGM_BUMP'], $post_data['topic_title'])); - $meta_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&p={$post_data['topic_last_post_id']}#p{$post_data['topic_last_post_id']}"; + $meta_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}"; meta_refresh(3, $meta_url); $message = $user->lang['TOPIC_BUMPED'] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $meta_url . '">', '</a>'); - $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $phpbb_root_path . 'viewforum.' . $phpEx . $SID .'&f=' . $forum_id . '">', '</a>'); + $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>'); trigger_error($message); } - + trigger_error('BUMP_ERROR'); } @@ -313,6 +315,7 @@ $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, comment, real_filename, extension, mimetype, filesize, filetime, thumbnail FROM ' . ATTACHMENTS_TABLE . " WHERE post_msg_id = $post_id @@ -409,13 +412,13 @@ if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts')) ); $db->sql_query($sql); - $meta_info = ($mode == 'post') ? "{$phpbb_root_path}viewforum.$phpEx$SID&f=$forum_id" : "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id"; + $meta_info = ($mode == 'post') ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) : append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"); meta_refresh(3, $meta_info); $message = $user->lang['DRAFT_SAVED'] . '<br /><br />'; $message .= ($mode != 'post') ? sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $meta_info . '">', '</a>') . '<br /><br />' : ''; - $message .= sprintf($user->lang['RETURN_FORUM'], '<a href="' . $phpbb_root_path . 'viewforum.' . $phpEx . $SID . '&f=' . $forum_id . '">', '</a>'); + $message .= sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>'); trigger_error($message); } @@ -474,7 +477,8 @@ if ($submit || $preview || $refresh) $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) - if ($post_data['post_subject'] && strcmp($post_data['post_subject'], strtoupper($post_data['post_subject'])) == 0) + // 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']); } @@ -653,7 +657,7 @@ if ($submit || $preview || $refresh) $confirm_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if (strcasecmp($confirm_row['code'], $confirm_code) !== 0) + if (empty($confirm_row['code']) || strcasecmp($confirm_row['code'], $confirm_code) !== 0) { $error[] = $user->lang['CONFIRM_CODE_WRONG']; } @@ -686,7 +690,7 @@ if ($submit || $preview || $refresh) ); $message_parser->parse_poll($poll); - + $post_data['poll_options'] = (isset($poll['poll_options'])) ? $poll['poll_options'] : ''; $post_data['poll_title'] = (isset($poll['poll_title'])) ? $poll['poll_title'] : ''; @@ -713,7 +717,7 @@ if ($submit || $preview || $refresh) case POST_STICKY: $auth_option = 'f_sticky'; break; - + default: $auth_option = ''; break; @@ -842,9 +846,9 @@ if ($submit || $preview || $refresh) meta_refresh(3, $redirect_url); - $message = ($auth->acl_get('f_moderate', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? (($mode == 'edit') ? 'POST_EDITED_MOD' : 'POST_STORED_MOD') : (($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED'); - $message = $user->lang[$message] . ((!$auth->acl_get('f_moderate', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) ? '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>') : ''); - $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $phpbb_root_path . 'viewforum.' . $phpEx . $SID .'&f=' . $data['forum_id'] . '">', '</a>'); + $message = (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? (($mode == 'edit') ? 'POST_EDITED_MOD' : 'POST_STORED_MOD') : (($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED'); + $message = $user->lang[$message] . (($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) ? '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>') : ''); + $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $data['forum_id']) . '">', '</a>'); trigger_error($message); } } @@ -877,9 +881,9 @@ if (!sizeof($error) && $preview) { $preview_signature = ''; } - + $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)))) && $auth->acl_get('f_poll', $forum_id)) @@ -889,10 +893,10 @@ if (!sizeof($error) && $preview) $parse_poll->bbcode_bitfield = $message_parser->bbcode_bitfield; $parse_poll->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies']); - + $template->assign_vars(array( - 'S_HAS_POLL_OPTIONS'=> (sizeof($post_data['poll_options'])), - 'S_IS_MULTI_CHOICE' => ($post_data['poll_max_options'] > 1) ? true : false, + 'S_HAS_POLL_OPTIONS' => (sizeof($post_data['poll_options'])), + 'S_IS_MULTI_CHOICE' => ($post_data['poll_max_options'] > 1) ? true : false, 'POLL_QUESTION' => $parse_poll->message, @@ -907,7 +911,9 @@ if (!sizeof($error) && $preview) foreach ($preview_poll_options as $option) { - $template->assign_block_vars('poll_option', array('POLL_OPTION_CAPTION' => $option)); + $template->assign_block_vars('poll_option', array( + 'POLL_OPTION_CAPTION' => $option) + ); } unset($preview_poll_options); } @@ -1017,7 +1023,7 @@ $lock_post_checked = (isset($post_lock)) ? $post_lock : $post_data['post_edit_lo $notify_checked = (isset($notify)) ? $notify : (($mode != 'edit') ? $user->data['user_notify'] : $post_data['notify_set']); // Page title & action URL, include session_id for security purpose -$s_action = "posting.$phpEx?sid=" . $user->session_id . "&mode=$mode&f=$forum_id"; +$s_action = append_sid("{$phpbb_root_path}posting.$phpEx", "mode=$mode&f=$forum_id", true, $user->session_id); $s_action .= ($topic_id) ? "&t=$topic_id" : ''; $s_action .= ($post_id) ? "&p=$post_id" : ''; @@ -1067,7 +1073,7 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'] && ($mode == $template->assign_vars(array( 'S_CONFIRM_CODE' => true, 'CONFIRM_ID' => $confirm_id, - 'CONFIRM_IMAGE' => '<img src="' . $phpbb_root_path . 'ucp.' . $phpEx . $SID . '&mode=confirm&id=' . $confirm_id . '&type=' . CONFIRM_POST . '" alt="" title="" />', + '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>'), )); } @@ -1080,18 +1086,18 @@ $form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_up // Start assigning vars for main posting page ... $template->assign_vars(array( - 'L_POST_A' => $page_title, - 'L_ICON' => ($mode == 'reply' || $mode == 'quote' || ($mode == 'edit' && $post_id != $post_data['topic_first_post_id'])) ? $user->lang['POST_ICON'] : $user->lang['TOPIC_ICON'], - 'L_MESSAGE_BODY_EXPLAIN'=> (intval($config['max_post_chars'])) ? sprintf($user->lang['MESSAGE_BODY_EXPLAIN'], intval($config['max_post_chars'])) : '', + 'L_POST_A' => $page_title, + 'L_ICON' => ($mode == 'reply' || $mode == 'quote' || ($mode == 'edit' && $post_id != $post_data['topic_first_post_id'])) ? $user->lang['POST_ICON'] : $user->lang['TOPIC_ICON'], + 'L_MESSAGE_BODY_EXPLAIN' => (intval($config['max_post_chars'])) ? sprintf($user->lang['MESSAGE_BODY_EXPLAIN'], intval($config['max_post_chars'])) : '', - 'FORUM_NAME' => $post_data['forum_name'], + 'FORUM_NAME' => $post_data['forum_name'], 'FORUM_DESC' => ($post_data['forum_desc']) ? generate_text_for_display($post_data['forum_desc'], $post_data['forum_desc_uid'], $post_data['forum_desc_bitfield']) : '', - 'TOPIC_TITLE' => $post_data['topic_title'], - 'MODERATORS' => (sizeof($moderators)) ? implode(', ', $moderators[$forum_id]) : '', + 'TOPIC_TITLE' => $post_data['topic_title'], + 'MODERATORS' => (sizeof($moderators)) ? implode(', ', $moderators[$forum_id]) : '', '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="' . "{$phpbb_root_path}faq.$phpEx$SID&mode=bbcode" . '" onclick="target=\'_phpbbcode\';">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . "{$phpbb_root_path}faq.$phpEx$SID&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') . '" 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>'), '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'], @@ -1100,10 +1106,10 @@ $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', 'TOPIC_TIME_LIMIT' => (int) $post_data['topic_time_limit'], 'EDIT_REASON' => $post_data['post_edit_reason'], - 'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=$forum_id", - 'U_VIEWTOPIC' => ($mode != 'post') ? "{$phpbb_root_path}viewtopic.$phpEx$SID&$forum_id&t=$topic_id" : '', - 'U_PROGRESS_BAR' => "{$phpbb_root_path}posting.$phpEx$SID&f=$forum_id&mode=popup", - 'UA_PROGRESS_BAR' => "{$phpbb_root_path}posting.$phpEx$SID&f=$forum_id&mode=popup", + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id"), + 'U_VIEWTOPIC' => ($mode != 'post') ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id") : '', + 'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&mode=popup"), + 'UA_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&mode=popup", false), 'S_PRIVMSGS' => false, 'S_CLOSE_PROGRESS_WINDOW' => (isset($_POST['add_file'])) ? true : false, @@ -1111,15 +1117,15 @@ $template->assign_vars(array( 'S_EDIT_REASON' => ($mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? true : false, 'S_DISPLAY_USERNAME' => (!$user->data['is_registered'] || ($mode == 'edit' && $post_data['post_username'])) ? true : false, 'S_SHOW_TOPIC_ICONS' => $s_topic_icons, - 'S_DELETE_ALLOWED' => ($mode == 'edit' && (($post_id == $post_data['topic_last_post_id'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))) ? true : false, + 'S_DELETE_ALLOWED' => ($mode == 'edit' && (($post_id == $post_data['topic_last_post_id'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))) ? true : false, 'S_BBCODE_ALLOWED' => $bbcode_status, - 'S_BBCODE_CHECKED' => ($bbcode_checked) ? ' checked="checked"' : '', + 'S_BBCODE_CHECKED' => ($bbcode_checked) ? ' checked="checked"' : '', 'S_SMILIES_ALLOWED' => $smilies_status, 'S_SMILIES_CHECKED' => ($smilies_checked) ? ' checked="checked"' : '', 'S_SIG_ALLOWED' => ($auth->acl_get('f_sigs', $forum_id) && $config['allow_sig'] && $user->data['is_registered']) ? true : false, '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_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_CHECKED' => ($lock_topic_checked) ? ' checked="checked"' : '', 'S_LOCK_POST_ALLOWED' => ($mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? true : false, @@ -1134,7 +1140,7 @@ $template->assign_vars(array( 'S_BBCODE_FLASH' => $flash_status, 'S_BBCODE_QUOTE' => $quote_status, - 'S_POST_ACTION' => $s_action, + 'S_POST_ACTION' => $s_action, 'S_HIDDEN_FIELDS' => $s_hidden_fields) ); @@ -1166,13 +1172,13 @@ if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_ '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))), - 'L_POLL_OPTIONS_EXPLAIN'=> sprintf($user->lang['POLL_OPTIONS_EXPLAIN'], $config['max_poll_options']), + 'L_POLL_OPTIONS_EXPLAIN' => sprintf($user->lang['POLL_OPTIONS_EXPLAIN'], $config['max_poll_options']), 'VOTE_CHANGE_CHECKED' => (!empty($post_data['poll_vote_change'])) ? ' checked="checked"' : '', - 'POLL_TITLE' => (isset($post_data['poll_title'])) ? $post_data['poll_title'] : '', + 'POLL_TITLE' => (isset($post_data['poll_title'])) ? $post_data['poll_title'] : '', 'POLL_OPTIONS' => (!empty($post_data['poll_options'])) ? implode("\n", $post_data['poll_options']) : '', 'POLL_MAX_OPTIONS' => (isset($post_data['poll_max_options'])) ? (int) $post_data['poll_max_options'] : 1, - 'POLL_LENGTH' => $post_data['poll_length']) + 'POLL_LENGTH' => $post_data['poll_length']) ); } @@ -1190,7 +1196,7 @@ $template->set_filenames(array( 'body' => 'posting_body.html') ); -make_jumpbox('viewforum.' . $phpEx); +make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); // Topic review if ($mode == 'reply' || $mode == 'quote') @@ -1231,8 +1237,8 @@ function upload_popup($forum_style = 0) function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data) { global $user, $db, $auth; - global $phpbb_root_path, $phpEx, $SID; - + global $phpbb_root_path, $phpEx; + // If moderator removing post or user itself removing post, present a confirmation screen if ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id) && $post_id == $post_data['topic_last_post_id'])) { @@ -1260,19 +1266,19 @@ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data) { add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_TOPIC', $post_data['topic_title']); - $meta_info = "{$phpbb_root_path}viewforum.$phpEx$SID&f=$forum_id"; + $meta_info = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id"); $message = $user->lang['POST_DELETED']; } else { add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_POST', $post_data['post_subject']); - $meta_info = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&p=$next_post_id#p$next_post_id"; + $meta_info = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p=$next_post_id") . "#p$next_post_id"; $message = $user->lang['POST_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $meta_info . '">', '</a>'); } meta_refresh(3, $meta_info); - $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $phpbb_root_path . 'viewforum.' . $phpEx . $SID . '&f=' . $forum_id . '">', '</a>'); + $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>'); trigger_error($message); } else diff --git a/phpBB/report.php b/phpBB/report.php index 29998c2a97..37efec3208 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -14,8 +14,8 @@ define('IN_PHPBB', true); $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 . 'common.' . $phpEx); +include($phpbb_root_path . 'includes/functions_display.' . $phpEx); // Start session management $user->session_begin(); @@ -26,13 +26,14 @@ $post_id = request_var('p', 0); $reason_id = request_var('reason_id', 0); $report_text = request_var('report_text', '', true); $user_notify = (isset($_POST['notify']) && $user->data['is_registered']) ? true : false; +$submit = (isset($_POST['submit'])) ? true : false; if (!$post_id) { trigger_error('INVALID_MODE'); } -$redirect_url = "viewtopic.$phpEx$SID&p=$post_id#p$post_id"; +$redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "p=$post_id") . "#p$post_id"; // Has the report been cancelled? if (isset($_POST['cancel'])) @@ -73,12 +74,12 @@ unset($acl_check_ary); if ($report_data['post_reported']) { $message = $user->lang['ALREADY_REPORTED']; - $message .= '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $phpbb_root_path . $redirect_url . '">', '</a>'); + $message .= '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>'); trigger_error($message); } // Submit report? -if (isset($_POST['submit']) && $reason_id) +if ($submit && $reason_id) { $sql = 'SELECT * FROM ' . REASONS_TABLE . " @@ -124,7 +125,7 @@ if (isset($_POST['submit']) && $reason_id) meta_refresh(3, $redirect_url); - $message = $user->lang['POST_REPORTED_SUCCESS'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $phpbb_root_path . $redirect_url . '">', '</a>'); + $message = $user->lang['POST_REPORTED_SUCCESS'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>'); trigger_error($message); } @@ -133,7 +134,7 @@ display_reasons($reason_id); $template->assign_vars(array( 'REPORT_TEXT' => $report_text, - 'S_REPORT_ACTION' => "{$phpbb_root_path}report.$phpEx$SID&p=$post_id", + 'S_REPORT_ACTION' => append_sid("{$phpbb_root_path}report.$phpEx", 'p=' . $post_id), 'S_NOTIFY' => $user_notify, 'S_CAN_NOTIFY' => ($user->data['is_registered']) ? true : false) diff --git a/phpBB/search.php b/phpBB/search.php index ae0513239e..393d8ba46d 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -14,7 +14,7 @@ define('IN_PHPBB', true); $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.'.$phpEx); +include($phpbb_root_path . 'common.' . $phpEx); // Start session management $user->session_begin(); @@ -90,6 +90,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $ex_fid_ary = array_unique(array_merge(array_keys($auth->acl_getf('!f_read', true)), array_keys($auth->acl_getf('!f_search', true)))); $not_in_fid = (sizeof($ex_fid_ary)) ? 'f.forum_id NOT IN (' . implode(', ', $ex_fid_ary) . ') OR ' : ''; + $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, fa.user_id FROM ' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id @@ -165,7 +166,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) { $author_id_ary[] = $author_id; } - elseif ($author) + else if ($author) { if ((strpos($author, '*') !== false) && (str_replace(array('*', '%'), '', $author) < $config['min_search_author_chars'])) { @@ -183,7 +184,6 @@ if ($keywords || $author || $author_id || $search_id || $submit) { $author_id_ary[] = (int) $row['user_id']; } - $db->sql_freeresult($result); if (!sizeof($author_id_ary)) @@ -208,7 +208,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) } // Select which method we'll use to obtain the post_id or topic_id information - $search_type = $config['search_type']; + $search_type = basename($config['search_type']); if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) { @@ -290,6 +290,7 @@ 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 ($show_results == 'posts') { if ($sort_key == 'a') @@ -297,6 +298,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $sort_join = USERS_TABLE . ' u, '; $sql_sort = ' AND u.user_id = p.poster_id ' . $sql_sort; } + $sql = "SELECT p.post_id FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t WHERE t.topic_replies = 0 @@ -328,6 +330,7 @@ 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 ($show_results == 'posts') { if ($sort_key == 'i') @@ -335,7 +338,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $sort_join = TOPICS_TABLE . ' t, '; $sql_sort = ' AND t.topic_id = p.topic_id ' . $sql_sort; } - elseif ($sort_key == 'a') + else if ($sort_key == 'a') { $sort_join = USERS_TABLE . ' u, '; $sql_sort = ' AND u.user_id = p.poster_id ' . $sql_sort; @@ -444,19 +447,17 @@ if ($keywords || $author || $author_id || $search_id || $submit) $u_show_results = ($show_results != 'posts') ? '&sr=' . $show_results : ''; $u_search_forum = implode('&fid%5B%5D=', $search_forum); - $u_search = "{$phpbb_root_path}search.$phpEx$SID"; + $u_search = append_sid("{$phpbb_root_path}search.$phpEx", $u_sort_param . $u_show_results); $u_search .= ($search_id) ? '&search_id=' . $search_id : ''; $u_search .= ($u_hilit) ? '&keywords=' . $u_hilit : ''; - $u_search .= ($topic_id) ? '&ch=' . $topic_id : ''; + $u_search .= ($topic_id) ? '&t=' . $topic_id : ''; $u_search .= ($author) ? '&author=' . urlencode($author) : ''; $u_search .= ($author_id) ? '&author_id=' . $author_id : ''; $u_search .= ($u_search_forum) ? '&fid%5B%5D=' . $u_search_forum : ''; $u_search .= (!$search_child) ? '&sc=0' : ''; $u_search .= ($search_fields != 'all') ? '&sf=' . $search_fields : ''; - $u_search .= '&' . $u_sort_param . $u_show_results; $u_search .= ($return_chars != 200) ? '&ch=' . $return_chars : ''; - $template->assign_vars(array( 'SEARCH_MATCHES' => $l_search_matches, 'SEARCH_WORDS' => $split_words, @@ -477,7 +478,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) 'REPORTED_IMG' => $user->img('icon_reported', 'TOPIC_REPORTED'), 'UNAPPROVED_IMG' => $user->img('icon_unapproved', 'TOPIC_UNAPPROVED'), - 'U_SEARCH_WORDS' => "{$phpbb_root_path}search.$phpEx$SID$u_show_results&keywords=$u_hilit" . (($author) ? '&author=' . urlencode($author) : '') . (($author_id) ? '&author_id=' . $author_id : '')) + 'U_SEARCH_WORDS' => append_sid("{$phpbb_root_path}search.$phpEx", "keywords=$u_hilit" . (($author) ? '&author=' . urlencode($author) : '') . (($author_id) ? '&author_id=' . $author_id : '') . $u_show_results)) ); if ($sql_where) @@ -512,6 +513,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) LEFT JOIN ' . FORUMS_TABLE . ' f ON (f.forum_id = t.forum_id) ' . (($sort_key == 'a') ? ' LEFT JOIN ' . USERS_TABLE . ' u ON (u.user_id = t.topic_poster) ' : ''); $sql_select = 't.*, f.forum_id, f.forum_name'; + if ($user->data['is_registered']) { if ($config['load_db_track']) @@ -533,7 +535,8 @@ if ($keywords || $author || $author_id || $search_id || $submit) if (!$user->data['is_registered'] || !$config['load_db_lastread']) { - $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array(); + $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : ''; + $tracking_topics = ($tracking_topics) ? unserialize($tracking_topics) : array(); } $sql = "SELECT $sql_select @@ -572,7 +575,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) if (!$user->data['is_registered']) { - $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate'] : 0; + $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0; } } } @@ -607,7 +610,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $u_forum_id = $forum_id; } - $view_topic_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$u_forum_id&t=$result_topic_id&hilit=$u_hilit"; + $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$u_forum_id&t=$result_topic_id&hilit=$u_hilit"); $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies']; @@ -620,20 +623,20 @@ if ($keywords || $author || $author_id || $search_id || $submit) $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; - $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&i=queue&mode=" . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$result_topic_id" : ''; + $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']), + '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, $view_topic_url), - 'TOPIC_TYPE' => $topic_type, + 'LAST_POST_AUTHOR' => ($row['topic_last_poster_name'] != '') ? $row['topic_last_poster_name'] : $user->lang['GUEST'], + 'PAGINATION' => topic_generate_pagination($replies, $view_topic_url), + 'TOPIC_TYPE' => $topic_type, 'LAST_POST_IMG' => $user->img('icon_post_latest', 'VIEW_LATEST_POST'), 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), - 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), + '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'] : '', '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'] : '', @@ -649,11 +652,11 @@ if ($keywords || $author || $author_id || $search_id || $submit) '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']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['topic_last_poster_id']}" : '', - 'U_NEWEST_POST' => $view_topic_url . '&view=unread#unread', - 'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&i=reports&mode=reports&t=$result_topic_id", - 'U_MCP_QUEUE' => $u_mcp_queue, + '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_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, ); } else @@ -697,26 +700,26 @@ if ($keywords || $author || $author_id || $search_id || $submit) $tpl_ary = array( 'POSTER_NAME' => ($row['poster_id'] == ANONYMOUS) ? ((!empty($row['post_username'])) ? $row['post_username'] : $user->lang['GUEST']) : $row['username'], - 'U_PROFILE' => ($row['poster_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['poster_id']}" : '', + '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' => $row['post_text'] ); } $template->assign_block_vars('searchresults', array_merge($tpl_ary, array( - 'FORUM_ID' => $forum_id, - 'TOPIC_ID' => $result_topic_id, + 'FORUM_ID' => $forum_id, + 'TOPIC_ID' => $result_topic_id, 'POST_ID' => ($show_results == 'posts') ? $row['post_id'] : false, 'FORUM_TITLE' => $row['forum_name'], - 'TOPIC_TITLE' => $topic_title, - 'TOPIC_REPLIES' => $replies, - 'TOPIC_VIEWS' => $row['topic_views'], + 'TOPIC_TITLE' => $topic_title, + 'TOPIC_REPLIES' => $replies, + 'TOPIC_VIEWS' => $row['topic_views'], 'U_VIEW_TOPIC' => $view_topic_url, - 'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=$forum_id", - 'U_VIEW_POST' => (!empty($row['post_id'])) ? "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=" . $row['topic_id'] . '&p=' . $row['post_id'] . '&hilit=' . $u_hilit . '#p' . $row['post_id'] : '') + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), + 'U_VIEW_POST' => (!empty($row['post_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=" . $row['topic_id'] . '&p=' . $row['post_id'] . '&hilit=' . $u_hilit) . '#p' . $row['post_id'] : '') )); } @@ -735,7 +738,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $template->set_filenames(array( 'body' => 'search_results.html') ); - make_jumpbox('viewforum.'.$phpEx); + make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); page_footer(); } @@ -851,7 +854,7 @@ while ($row = $db->sql_fetchrow($result)) 'KEYWORDS' => $keywords, 'TIME' => $user->format_date($row['search_time']), - 'U_KEYWORDS' => "{$phpbb_root_path}search.$phpEx$SID&keywords=" . urlencode($keywords)) + 'U_KEYWORDS' => append_sid("{$phpbb_root_path}search.$phpEx", 'keywords=' . urlencode($keywords))) ); } $db->sql_freeresult($result); @@ -862,7 +865,7 @@ page_header($user->lang['SEARCH']); $template->set_filenames(array( 'body' => 'search_body.html') ); -make_jumpbox('viewforum.'.$phpEx); +make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); page_footer(); diff --git a/phpBB/style.php b/phpBB/style.php index 341fea13c5..dbc400c134 100644 --- a/phpBB/style.php +++ b/phpBB/style.php @@ -14,7 +14,7 @@ define('IN_PHPBB', true); $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -require($phpbb_root_path . 'config.'.$phpEx); +require($phpbb_root_path . 'config.' . $phpEx); set_magic_quotes_runtime(0); @@ -45,10 +45,15 @@ if (!preg_match('/^[A-Za-z0-9]*$/', $sid)) // server a little if ($id && $sid) { + if (empty($acm_type) || empty($dbms)) + { + die('Hacking attempt'); + } + // Include files - require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.'.$phpEx); + require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx); require($phpbb_root_path . 'includes/acm/acm_main.' . $phpEx); - require($phpbb_root_path . 'includes/db/' . $dbms . '.'.$phpEx); + require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); $db = new $sql_db(); $cache = new cache(); @@ -84,6 +89,12 @@ if ($id && $sid) exit; } + /** + * 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')) + */ + 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/editor.js b/phpBB/styles/subSilver/template/editor.js index 5ccc210a3c..ef52b65998 100644 --- a/phpBB/styles/subSilver/template/editor.js +++ b/phpBB/styles/subSilver/template/editor.js @@ -1,5 +1,7 @@ -// bbCode control by subBlue design [ www.subBlue.com ] -// Includes unixsafe colour palette selector by SHS` +/** +* bbCode control by subBlue design [ www.subBlue.com ] +* Includes unixsafe colour palette selector by SHS` +*/ // Startup variables var imageTag = false; @@ -10,51 +12,74 @@ var theSelection = false; var clientPC = navigator.userAgent.toLowerCase(); // Get client info var clientVer = parseInt(navigator.appVersion); // Get browser version -var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1)); -var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1) - && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1) - && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1)); +var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1)); +var is_nav = ((clientPC.indexOf('mozilla') != -1) && (clientPC.indexOf('spoofer') == -1) && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera') == -1) && (clientPC.indexOf('webtv') == -1) && (clientPC.indexOf('hotjava') == -1)); -var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1)); -var is_mac = (clientPC.indexOf("mac")!=-1); +var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1)); +var is_mac = (clientPC.indexOf('mac') != -1); -// Shows the help messages in the helpline window -function helpline(help) { - document.forms[form_name].helpbox.value = eval(help + "_help"); +/** +* Shows the help messages in the helpline window +*/ +function helpline(help) +{ + document.forms[form_name].helpbox.value = eval(help + '_help'); } -// Replacement for arrayname.length property -function getarraysize(thearray) { - for (i = 0; i < thearray.length; i++) { - if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null)) +/** +* Replacement for arrayname.length property +*/ +function getarraysize(thearray) +{ + for (i = 0; i < thearray.length; i++) + { + if (thearray[i] == 'undefined' || thearray[i] == '' || thearray[i] == null) + { return i; } + } + return thearray.length; } -// Replacement for arrayname.push(value) not implemented in IE until version 5.5 -// Appends element to the array -function arraypush(thearray,value) { - thearray[ getarraysize(thearray) ] = value; +/** +* Replacement for arrayname.push(value) not implemented in IE until version 5.5 +* Appends element to the array +*/ +function arraypush(thearray,value) +{ + thearray[getarraysize(thearray)] = value; } -// Replacement for arrayname.pop() not implemented in IE until version 5.5 -// Removes and returns the last element of an array -function arraypop(thearray) { +/** +* Replacement for arrayname.pop() not implemented in IE until version 5.5 +* Removes and returns the last element of an array +*/ +function arraypop(thearray) +{ thearraysize = getarraysize(thearray); retval = thearray[thearraysize - 1]; delete thearray[thearraysize - 1]; + return retval; } -function smiley(text) { +/** +* Insert emoticon +*/ +function smiley(text) +{ text = ' ' + text + ' '; - if (document.forms[form_name].elements[text_name].createTextRange && document.forms[form_name].elements[text_name].caretPos) { + + 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 { + } + else + { var selStart = document.forms[form_name].elements[text_name].selectionStart; var selEnd = document.forms[form_name].elements[text_name].selectionEnd; @@ -65,15 +90,21 @@ function smiley(text) { } } -function bbfontstyle(bbopen, bbclose) { - +/** +* Apply bbcodes +*/ +function bbfontstyle(bbopen, bbclose) +{ theSelection = false; document.forms[form_name].elements[text_name].focus(); if ((clientVer >= 4) && is_ie && is_win) { - theSelection = document.selection.createRange().text; // Get text selection - if (theSelection) { + // Get text selection + theSelection = document.selection.createRange().text; + + if (theSelection) + { // Add tags around selection document.selection.createRange().text = bbopen + theSelection + bbclose; document.forms[form_name].elements[text_name].focus(); @@ -89,11 +120,16 @@ function bbfontstyle(bbopen, bbclose) { return; } - if (imageTag) { // Close image tag before adding + // Close image tag before adding + if (imageTag) + { insert_text(bbtags[15]); - lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list - document.forms[form_name].addbbcode14.value = "Img"; // Return button back to normal state + // Remove the close image tag from the list + lastValue = arraypop(bbcode) - 1; + + // Return button back to normal state + document.forms[form_name].addbbcode14.value = 'Img'; imageTag = false; } @@ -106,6 +142,9 @@ function bbfontstyle(bbopen, bbclose) { return; } +/** +* Insert text at position +*/ function insert_text(text) { if (document.forms[form_name].elements[text_name].createTextRange && document.forms[form_name].elements[text_name].caretPos) @@ -128,20 +167,27 @@ function insert_text(text) } } -function attach_inline() { +/** +* Add inline attachment at position +*/ +function attach_inline() +{ insert_text('[attachment=' + document.forms[form_name].elements['attachments'].value + ']' + document.forms[form_name].elements['attachments'].options[document.forms[form_name].elements['attachments'].selectedIndex].text + '[/attachment]'); document.forms[form_name].elements[text_name].focus(); } -function addquote(post_id, username) { - +/** +* Add quote text to message +*/ +function addquote(post_id, username) +{ var message_name = 'message_' + post_id; var theSelection = ''; var divarea = false; if (document.all) { - eval("divarea = document.all." + message_name + ";"); + eval('divarea = document.all.' + message_name + ';'); } else { @@ -177,7 +223,7 @@ function addquote(post_id, username) { theSelection = divarea.firstChild.nodeValue; } } - + if (theSelection) { insert_text('[quote="' + username + '"]' + theSelection + '[/quote]'); @@ -186,39 +232,54 @@ function addquote(post_id, username) { return; } -function bbstyle(bbnumber) { - +/** +* bbstyle +*/ +function bbstyle(bbnumber) +{ donotinsert = false; theSelection = false; bblast = 0; document.forms[form_name].elements[text_name].focus(); - if (bbnumber == -1) { // Close all open tags & default button names - while (bbcode[0]) { + // Close all open tags & default button names + if (bbnumber == -1) + { + while (bbcode[0]) + { butnumber = arraypop(bbcode) - 1; document.forms[form_name].elements[text_name].value += bbtags[butnumber + 1]; buttext = eval('document.forms[form_name].addbbcode' + butnumber + '.value'); - if (buttext != "[*]") + + if (buttext != '[*]') { eval('document.forms[form_name].addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); } } - document.forms[form_name].addbbcode10.value = "List"; - bbtags[10] = "[list]"; - document.forms[form_name].addbbcode12.value = "List="; - bbtags[12] = "[list=]"; - imageTag = false; // All tags are closed including image tags :D + + document.forms[form_name].addbbcode10.value = 'List'; + bbtags[10] = '[list]'; + + document.forms[form_name].addbbcode12.value = 'List='; + bbtags[12] = '[list=]'; + + // All tags are closed including image tags :D + imageTag = false; document.forms[form_name].elements[text_name].focus(); + return; } // [*] doesn't have an end tag - noEndTag = (bbtags[bbnumber] == "[*]") + noEndTag = (bbtags[bbnumber] == '[*]') if ((clientVer >= 4) && is_ie && is_win) { - theSelection = document.selection.createRange().text; // Get text selection - if (theSelection) { + // Get text selection + theSelection = document.selection.createRange().text; + + if (theSelection) + { // Add tags around selection document.selection.createRange().text = bbtags[bbnumber] + theSelection + ((!noEndTag) ? bbtags[bbnumber+1] : ''); document.forms[form_name].elements[text_name].focus(); @@ -235,92 +296,114 @@ function bbstyle(bbnumber) { } // Find last occurance of an open tag the same as the one just clicked - for (i = 0; i < bbcode.length; i++) { - if (bbcode[i] == bbnumber+1) { + for (i = 0; i < bbcode.length; i++) + { + if (bbcode[i] == bbnumber+1) + { bblast = i; donotinsert = true; } } - if ((bbnumber == 10) && (bbtags[10] != "[*]")) + if (bbnumber == 10 && bbtags[10] != '[*]') { if (donotinsert) { - document.forms[form_name].addbbcode12.value = "List="; + document.forms[form_name].addbbcode12.value = 'List='; tmp_help = o_help; o_help = e_help; e_help = tmp_help; - bbtags[12] = "[list=]"; + bbtags[12] = '[list=]'; } else { - document.forms[form_name].addbbcode12.value = "[*]"; + document.forms[form_name].addbbcode12.value = '[*]'; tmp_help = o_help; o_help = e_help; e_help = tmp_help; - bbtags[12] = "[*]"; + bbtags[12] = '[*]'; } } - if ((bbnumber == 12) && (bbtags[12] != "[*]")) + if (bbnumber == 12 && bbtags[12] != '[*]') { if (donotinsert) { - document.forms[form_name].addbbcode10.value = "List"; + document.forms[form_name].addbbcode10.value = 'List'; tmp_help = l_help; l_help = e_help; e_help = tmp_help; - bbtags[10] = "[list]"; + bbtags[10] = '[list]'; } else { - document.forms[form_name].addbbcode10.value = "[*]"; + document.forms[form_name].addbbcode10.value = '[*]'; tmp_help = l_help; l_help = e_help; e_help = tmp_help; - bbtags[10] = "[*]"; + bbtags[10] = '[*]'; } } - if (donotinsert) { // Close all open tags up to the one just clicked & default button names - while (bbcode[bblast]) { - butnumber = arraypop(bbcode) - 1; - if (bbtags[butnumber] != "[*]") - { - insert_text(bbtags[butnumber + 1]); - } - else - { - insert_text(bbtags[butnumber]); - } - buttext = eval('document.forms[form_name].addbbcode' + butnumber + '.value'); - if (bbtags[butnumber] != "[*]") - { - eval('document.forms[form_name].addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); - } - imageTag = false; + // Close all open tags up to the one just clicked & default button names + if (donotinsert) + { + while (bbcode[bblast]) + { + butnumber = arraypop(bbcode) - 1; + + if (bbtags[butnumber] != '[*]') + { + insert_text(bbtags[butnumber + 1]); } - document.forms[form_name].elements[text_name].focus(); - return; - } else { // Open tags + else + { + insert_text(bbtags[butnumber]); + } + + buttext = eval('document.forms[form_name].addbbcode' + butnumber + '.value'); - if (imageTag && (bbnumber != 14)) { // Close image tag before adding another + if (bbtags[butnumber] != '[*]') + { + eval('document.forms[form_name].addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"'); + } + imageTag = false; + } + document.forms[form_name].elements[text_name].focus(); + return; + } + else + { + // Open tags + + // Close image tag before adding another + if (imageTag && (bbnumber != 14)) + { insert_text(bbtags[15]); - lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list - document.forms[form_name].addbbcode14.value = "Img"; // Return button back to normal state + // Remove the close image tag from the list + lastValue = arraypop(bbcode) - 1; + + // Return button back to normal state + document.forms[form_name].addbbcode14.value = 'Img'; imageTag = false; } // Open tag insert_text(bbtags[bbnumber]); - if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag - if (bbtags[bbnumber] != "[*]") + // Check to stop additional tags after an unclosed image tag + if (bbnumber == 14 && imageTag == false) { - arraypush(bbcode,bbnumber+1); + imageTag = 1; + } + + if (bbtags[bbnumber] != '[*]') + { + arraypush(bbcode, bbnumber + 1); eval('document.forms[form_name].addbbcode'+bbnumber+'.value += "*"'); } + document.forms[form_name].elements[text_name].focus(); return; } @@ -328,67 +411,90 @@ function bbstyle(bbnumber) { storeCaret(document.forms[form_name].elements[text_name]); } -// From http://www.massless.org/mozedit/ +/** +* From http://www.massless.org/mozedit/ +*/ function mozWrap(txtarea, open, close) { var selLength = txtarea.textLength; var selStart = txtarea.selectionStart; var selEnd = txtarea.selectionEnd; var scrollTop = txtarea.scrollTop; + if (selEnd == 1 || selEnd == 2) + { selEnd = selLength; + } var s1 = (txtarea.value).substring(0,selStart); var s2 = (txtarea.value).substring(selStart, selEnd) var s3 = (txtarea.value).substring(selEnd, selLength); + txtarea.value = s1 + open + s2 + close + s3; txtarea.selectionStart = selEnd + open.length + close.length; txtarea.selectionEnd = txtarea.selectionStart; txtarea.focus(); txtarea.scrollTop = scrollTop; + return; } -// Insert at Claret position. Code from -// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130 -function storeCaret(textEl) { - if (textEl.createTextRange) { textEl.caretPos = document.selection.createRange().duplicate(); } +/** +* Insert at Claret position. Code from +* http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130 +*/ +function storeCaret(textEl) +{ + if (textEl.createTextRange) + { + textEl.caretPos = document.selection.createRange().duplicate(); + } } +/** +* Color pallette +*/ function colorPalette(dir, width, height) { var r = 0, g = 0, b = 0; var numberList = new Array(6); - numberList[0] = "00"; - numberList[1] = "40"; - numberList[2] = "80"; - numberList[3] = "BF"; - numberList[4] = "FF"; + + numberList[0] = '00'; + numberList[1] = '40'; + numberList[2] = '80'; + numberList[3] = 'BF'; + numberList[4] = 'FF'; + document.writeln('<table cellspacing="1" cellpadding="0" border="0">'); - for(r = 0; r < 5; r++) + + for (r = 0; r < 5; r++) { if (dir == 'h') { document.writeln('<tr>'); } - for(g = 0; g < 5; g++) + + for (g = 0; g < 5; g++) { if (dir == 'v') { document.writeln('<tr>'); } - for(b = 0; b < 5; b++) + + for (b = 0; b < 5; b++) { 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.writeln('</td>'); } + if (dir == 'v') { document.writeln('</tr>'); } } + if (dir == 'h') { document.writeln('</tr>'); @@ -396,4 +502,3 @@ function colorPalette(dir, width, height) } document.writeln('</table>'); } - diff --git a/phpBB/styles/subSilver/template/faq_body.html b/phpBB/styles/subSilver/template/faq_body.html index 251123990f..b00ff8a3a4 100644 --- a/phpBB/styles/subSilver/template/faq_body.html +++ b/phpBB/styles/subSilver/template/faq_body.html @@ -1,60 +1,57 @@ <!-- INCLUDE overall_header.html --> - <a name="top"></a> - <div id="pagecontent"> +<a name="faqtop"></a> +<div id="pagecontent"> - <table class="tablebg" width="100%" cellspacing="1"> - <tr> - <th>{L_FAQ_TITLE}</th> - </tr> - <tr> - <td class="row1"> - <!-- BEGIN faq_block_link --> - <span class="gen"><b>{faq_block_link.BLOCK_TITLE}</b></span><br /> - <!-- BEGIN faq_row_link --> - <span class="gen"><a class="postlink" href="{faq_block_link.faq_row_link.U_FAQ_LINK}">{faq_block_link.faq_row_link.FAQ_LINK}</a></span><br /> - <!-- END faq_row_link --> - <br /> - <!-- END faq_block_link --> - </td> - </tr> - <tr> - <td class="cat"> </td> - </tr> - </table> + <table class="tablebg" width="100%" cellspacing="1"> + <tr> + <th>{L_FAQ_TITLE}</th> + </tr> + <tr> + <td class="row1"> + <!-- BEGIN faq_block --> + <span class="gen"><b>{faq_block.BLOCK_TITLE}</b></span><br /> + <!-- BEGIN faq_row --> + <span class="gen"><a class="postlink" href="#f{faq_block.S_ROW_COUNT}{faq_block.faq_row.S_ROW_COUNT}">{faq_block.faq_row.FAQ_QUESTION}</a></span><br /> + <!-- END faq_row --> + <br /> + <!-- END faq_block --> + </td> + </tr> + <tr> + <td class="cat"> </td> + </tr> + </table> - <br clear="all" /> + <br clear="all" /> - <!-- BEGIN faq_block --> + <!-- BEGIN faq_block --> <table class="tablebg" width="100%" cellspacing="1"> - <tr> - <td class="cat" align="center"><h4>{faq_block.BLOCK_TITLE}</h4></td> - </tr> - <!-- BEGIN faq_row --> - <tr> - + <tr> + <td class="cat" align="center"><h4>{faq_block.BLOCK_TITLE}</h4></td> + </tr> + <!-- BEGIN faq_row --> + <tr> <!-- IF faq_block.faq_row.S_ROW_COUNT is even --> <td class="row1" valign="top"> <!-- ELSE --> <td class="row2" valign="top"> <!-- ENDIF --> - <p class="postbody"><a name="{faq_block.faq_row.U_FAQ_ID}"></a><b>» {faq_block.faq_row.FAQ_QUESTION}</b></p> - - <p class="postbody">{faq_block.faq_row.FAQ_ANSWER}</p> - - <p class="gensmall"><a href="#top">{L_BACK_TO_TOP}</a></p> - </td> - </tr> - <tr> - <td class="spacer" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td> - </tr> - <!-- END faq_row --> + <p class="postbody"><a name="f{faq_block.S_ROW_COUNT}{faq_block.faq_row.S_ROW_COUNT}"></a><b>» {faq_block.faq_row.FAQ_QUESTION}</b></p> + <p class="postbody">{faq_block.faq_row.FAQ_ANSWER}</p> + <p class="gensmall"><a href="#faqtop">{L_BACK_TO_TOP}</a></p> + </td> + </tr> + <tr> + <td class="spacer" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td> + </tr> + <!-- END faq_row --> </table> <br clear="all" /> - <!-- END faq_block --> + <!-- END faq_block --> - </div> +</div> <table class="tablebg" width="100%" cellspacing="1" cellpadding="0"> <tr> diff --git a/phpBB/styles/subSilver/template/index_body.html b/phpBB/styles/subSilver/template/index_body.html index 3cb928bb40..028e5141ac 100644 --- a/phpBB/styles/subSilver/template/index_body.html +++ b/phpBB/styles/subSilver/template/index_body.html @@ -1,44 +1,41 @@ <!-- INCLUDE overall_header.html --> - <!-- IF U_MCP --> +<!-- IF U_MCP --> <div id="pageheader"> <p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p> </div> <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 --> +<!-- 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 --> + <!-- 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 --> + <!-- 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> + <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> + <td class="row2" colspan="3" align="center"><span class="genmed">{L_REDIRECTS}: {forumrow.CLICKS}</span></td> <!-- ENDIF --> </tr> - <!-- ELSE --> + <!-- ELSE --> <tr> <td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td> <td class="row1" width="100%"> @@ -69,101 +66,106 @@ <!-- 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> - <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> - - <!-- IF S_DISPLAY_ONLINE_LIST --> + <!-- ENDIF --> +<!-- BEGINELSE --> + <tr> + <td class="row1" colspan="5" align="center"><p class="gensmall">{L_NO_FORUMS}</p></td> + </tr> +<!-- END forumrow --> +</table> + +<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> + +<!-- IF S_DISPLAY_ONLINE_LIST --> <br clear="all" /> <table class="tablebg" width="100%" cellspacing="1"> - <tr> - <td class="cat" colspan="2"><h4><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h4></td> - </tr> - <tr> - <!-- IF LEGEND --> - <td class="row1" rowspan="2" align="center" valign="middle"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td> - <!-- ELSE --> - <td class="row1" align="center" valign="middle"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td> - <!-- ENDIF --> - <td class="row1" width="100%"><span class="genmed">{TOTAL_USERS_ONLINE}<br />{RECORD_USERS}<br /><br />{LOGGED_IN_USER_LIST}<br /><br />{L_ONLINE_EXPLAIN}</span></td> - </tr> - <!-- IF LEGEND --> + <tr> + <td class="cat" colspan="2"><h4><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h4></td> + </tr> + <tr> + <!-- IF LEGEND --> + <td class="row1" rowspan="2" align="center" valign="middle"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td> + <!-- ELSE --> + <td class="row1" align="center" valign="middle"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td> + <!-- ENDIF --> + <td class="row1" width="100%"><span class="genmed">{TOTAL_USERS_ONLINE}<br />{RECORD_USERS}<br /><br />{LOGGED_IN_USER_LIST}<br /><br />{L_ONLINE_EXPLAIN}</span></td> + </tr> + <!-- IF LEGEND --> <tr> <td class="row1"><b class="gensmall">{L_LEGEND} :: {LEGEND}</b></td> </tr> - <!-- ENDIF --> - </table> <!-- ENDIF --> - - <!-- IF S_DISPLAY_BIRTHDAY_LIST --> - <br clear="all" /> - - <table class="tablebg" width="100%" cellspacing="1"> - <tr> - <td class="cat" colspan="2"><h4>{L_BIRTHDAYS}</h4></td> - </tr> - <tr> - <td class="row1" align="center" valign="middle"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_BIRTHDAYS}" /></td> - <td class="row1" width="100%"><p class="genmed"><!-- IF BIRTHDAY_LIST -->{L_CONGRATULATIONS}: <b>{BIRTHDAY_LIST}</b><!-- ELSE -->{L_NO_BIRTHDAYS}<!-- ENDIF --></p></td> - </tr> </table> - <!-- ENDIF --> +<!-- ENDIF --> +<!-- IF S_DISPLAY_BIRTHDAY_LIST --> <br clear="all" /> <table class="tablebg" width="100%" cellspacing="1"> - <tr> - <td class="cat" colspan="2"><h4>{L_STATISTICS}</h4></td> - </tr> - <tr> - <td class="row1"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_STATISTICS}" /></td> - <td class="row1" width="100%" valign="middle"><p class="genmed">{TOTAL_POSTS} | {TOTAL_TOPICS} | {TOTAL_USERS} | {NEWEST_USER}</p></td> - </tr> + <tr> + <td class="cat" colspan="2"><h4>{L_BIRTHDAYS}</h4></td> + </tr> + <tr> + <td class="row1" align="center" valign="middle"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_BIRTHDAYS}" /></td> + <td class="row1" width="100%"><p class="genmed"><!-- IF BIRTHDAY_LIST -->{L_CONGRATULATIONS}: <b>{BIRTHDAY_LIST}</b><!-- ELSE -->{L_NO_BIRTHDAYS}<!-- ENDIF --></p></td> + </tr> </table> +<!-- ENDIF --> - <!-- IF not S_USER_LOGGED_IN --> - <br clear="all" /> +<br clear="all" /> - <form method="post" action="{S_LOGIN_ACTION}"><table class="tablebg" width="100%" cellspacing="1"> - <tr> - <td class="cat"><h4><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a></h4></td> - </tr> - <tr> - <td class="row1" align="center"><span class="genmed">{L_USERNAME}:</span> <input class="post" type="text" name="username" size="10" /> <span class="genmed">{L_PASSWORD}:</span> <input class="post" type="password" name="password" size="10" /> <span class="gensmall">{L_LOG_ME_IN}</span> <input class="text" type="checkbox" name="autologin" /> <input type="submit" class="btnmain" name="login" value="{L_LOGIN}" /></td> - </tr> - </table></form> - <!-- ENDIF --> +<table class="tablebg" width="100%" cellspacing="1"> +<tr> + <td class="cat" colspan="2"><h4>{L_STATISTICS}</h4></td> +</tr> +<tr> + <td class="row1"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_STATISTICS}" /></td> + <td class="row1" width="100%" valign="middle"><p class="genmed">{TOTAL_POSTS} | {TOTAL_TOPICS} | {TOTAL_USERS} | {NEWEST_USER}</p></td> +</tr> +</table> +<!-- IF not S_USER_LOGGED_IN --> <br clear="all" /> - <table class="legend"> - <tr> - <td width="20" align="center">{FORUM_NEW_IMG}</td> - <td><span class="gensmall">{L_NEW_POSTS}</span></td> - <td> </td> - <td width="20" align="center">{FORUM_IMG}</td> - <td><span class="gensmall">{L_NO_NEW_POSTS}</span></td> - <td> </td> - <td width="20" align="center">{FORUM_LOCKED_IMG}</td> - <td><span class="gensmall">{L_FORUM_LOCKED}</span></td> - </tr> + <form method="post" action="{S_LOGIN_ACTION}"> + + <table class="tablebg" width="100%" cellspacing="1"> + <tr> + <td class="cat"><h4><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a></h4></td> + </tr> + <tr> + <td class="row1" align="center"><span class="genmed">{L_USERNAME}:</span> <input class="post" type="text" name="username" size="10" /> <span class="genmed">{L_PASSWORD}:</span> <input class="post" type="password" name="password" size="10" /> <span class="gensmall">{L_LOG_ME_IN}</span> <input class="text" type="checkbox" name="autologin" /> <input type="submit" class="btnmain" name="login" value="{L_LOGIN}" /></td> + </tr> </table> + + </form> +<!-- ENDIF --> + +<br clear="all" /> + +<table class="legend"> +<tr> + <td width="20" align="center">{FORUM_NEW_IMG}</td> + <td><span class="gensmall">{L_NEW_POSTS}</span></td> + <td> </td> + <td width="20" align="center">{FORUM_IMG}</td> + <td><span class="gensmall">{L_NO_NEW_POSTS}</span></td> + <td> </td> + <td width="20" align="center">{FORUM_LOCKED_IMG}</td> + <td><span class="gensmall">{L_FORUM_LOCKED}</span></td> +</tr> +</table> <!-- INCLUDE overall_footer.html -->
\ No newline at end of file diff --git a/phpBB/styles/subSilver/template/memberlist_body.html b/phpBB/styles/subSilver/template/memberlist_body.html index ea4e4019d3..b513586035 100644 --- a/phpBB/styles/subSilver/template/memberlist_body.html +++ b/phpBB/styles/subSilver/template/memberlist_body.html @@ -19,7 +19,7 @@ </form> <!-- ENDIF --> - <!-- IF S_SEARCH_USER --> + <!-- IF S_SEARCH_USER and S_FORM_NAME --> <form method="post" name="results" action="{S_MODE_ACTION}" onsubmit="insert_marked(this.user);return false"> <!-- ELSE --> <form method="post" action="{S_MODE_ACTION}"> @@ -35,7 +35,7 @@ <th nowrap="nowrap" width="11%">{L_SEND_MESSAGE}</th> <th nowrap="nowrap" width="11%"><a href="{U_SORT_EMAIL}">{L_EMAIL}</a></th> <th nowrap="nowrap" width="11%"><a href="{U_SORT_WEBSITE}">{L_WEBSITE}</a></th> - <!-- IF S_SEARCH_USER --><th width="2%" nowrap="nowrap">{L_MARK}</th><!-- ENDIF --> + <!-- IF S_SEARCH_USER and S_FORM_NAME --><th width="2%" nowrap="nowrap">{L_MARK}</th><!-- ENDIF --> </tr> <!-- BEGIN memberrow --> <!-- IF S_SHOW_GROUP --> @@ -64,19 +64,19 @@ <!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. --> <td class="gen" align="center"> {memberrow.PROFILE_FIELD1_VALUE}</td> <!-- ENDIF --> - <!-- IF S_SEARCH_USER --><td align="center"><input type="checkbox" name="user" value="{memberrow.USERNAME}" /></td><!-- ENDIF --> + <!-- IF S_SEARCH_USER and S_FORM_NAME --><td align="center"><input type="checkbox" name="user" value="{memberrow.USERNAME}" /></td><!-- ENDIF --> </tr> <!-- BEGINELSE --> <tr> - <td class="row1" colspan="<!-- IF S_SEARCH_USER -->9<!-- ELSE -->8<!-- ENDIF -->" height="28" align="center"><span class="gen">{L_NO_MEMBERS}</span></td> + <td class="row1" colspan="<!-- IF S_SEARCH_USER and S_FORM_NAME -->9<!-- ELSE -->8<!-- ENDIF -->" height="28" align="center"><span class="gen">{L_NO_MEMBERS}</span></td> </tr> <!-- END memberrow --> <tr> - <td class="cat" colspan="<!-- IF S_SEARCH_USER -->9<!-- ELSE -->8<!-- ENDIF -->" align="center"><!-- IF S_SEARCH_USER --><input class="btnlite" type="submit" value="{L_SELECT_MARKED}" /><!-- ELSE --><span class="gensmall">{L_SELECT_SORT_METHOD}:</span> <select name="sk">{S_MODE_SELECT}</select> <span class="gensmall">{L_ORDER}</span> <select name="sd">{S_ORDER_SELECT}</select> <input type="submit" name="submit" value="{L_SUBMIT}" class="btnlite" /><!-- ENDIF --></td> + <td class="cat" colspan="<!-- IF S_SEARCH_USER and S_FORM_NAME -->9<!-- ELSE -->8<!-- ENDIF -->" align="center"><!-- IF S_SEARCH_USER and S_FORM_NAME --><input class="btnlite" type="submit" value="{L_SELECT_MARKED}" /><!-- ELSE --><span class="gensmall">{L_SELECT_SORT_METHOD}:</span> <select name="sk">{S_MODE_SELECT}</select> <span class="gensmall">{L_ORDER}</span> <select name="sd">{S_ORDER_SELECT}</select> <input type="submit" name="submit" value="{L_SUBMIT}" class="btnlite" /><!-- ENDIF --></td> </tr> </table> @@ -85,7 +85,7 @@ <table width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pagination">{PAGE_NUMBER} [ {TOTAL_USERS} ]</td> - <td align="right"><!-- IF S_SEARCH_USER --><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="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> </tr> </table> diff --git a/phpBB/styles/subSilver/template/viewtopic_body.html b/phpBB/styles/subSilver/template/viewtopic_body.html index f866bd04e9..e27f37c2b7 100644 --- a/phpBB/styles/subSilver/template/viewtopic_body.html +++ b/phpBB/styles/subSilver/template/viewtopic_body.html @@ -64,7 +64,7 @@ <td align="center"><span class="gen"><b>{POLL_QUESTION}</b></span><br /><span class="gensmall">{L_POLL_LENGTH}</span></td> </tr> <tr> - <td align="center"><table cellspacing="0" cellpadding="2" border="0"> + <td align="left"><table cellspacing="0" cellpadding="2" border="0"> <!-- BEGIN poll_option --> <tr> <!-- IF S_CAN_VOTE --> @@ -79,7 +79,7 @@ <td><span class="gen">{poll_option.POLL_OPTION_CAPTION}</span></td> <!-- IF S_DISPLAY_RESULTS --> <td>{POLL_LEFT_CAP_IMG}{poll_option.POLL_OPTION_IMG}{POLL_RIGHT_CAP_IMG}</td> - <td class="gen" align="center"><b> {poll_option.POLL_OPTION_PERCENT} </b></td> + <td class="gen" align="right"><b> {poll_option.POLL_OPTION_PERCENT} </b></td> <td class="gen" align="center">[ {poll_option.POLL_OPTION_RESULT} ]</td> <!-- IF poll_option.POLL_OPTION_VOTED --> <td class="gensmall" valign="top"><b title="{L_POLL_VOTED_OPTION}">x</b></td> diff --git a/phpBB/ucp.php b/phpBB/ucp.php index e038f42ddd..c8a318589b 100755 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -14,9 +14,9 @@ define('IN_PHPBB', true); $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -require($phpbb_root_path . 'common.'.$phpEx); -require($phpbb_root_path . 'includes/functions_user.'.$phpEx); -require($phpbb_root_path . 'includes/functions_module.'.$phpEx); +require($phpbb_root_path . 'common.' . $phpEx); +require($phpbb_root_path . 'includes/functions_user.' . $phpEx); +require($phpbb_root_path . 'includes/functions_module.' . $phpEx); // Basic parameter data $id = request_var('i', ''); @@ -41,7 +41,7 @@ switch ($mode) $module->load('ucp', 'activate'); $module->display($user->lang['UCP_ACTIVATE']); - redirect("index.$phpEx$SID"); + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); break; case 'resend_act': @@ -57,7 +57,7 @@ switch ($mode) case 'register': if ($user->data['is_registered'] || isset($_REQUEST['not_agreed'])) { - redirect("index.$phpEx$SID"); + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } $module->load('ucp', 'register'); @@ -72,7 +72,7 @@ switch ($mode) case 'login': if ($user->data['is_registered']) { - redirect("index.$phpEx$SID"); + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } login_box("index.$phpEx"); @@ -85,9 +85,9 @@ switch ($mode) $user->session_begin(); } - meta_refresh(3, "index.$phpEx$SID"); + meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); - $message = $user->lang['LOGOUT_REDIRECT'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . "{$phpbb_root_path}index.$phpEx$SID" . '">', '</a> '); + $message = $user->lang['LOGOUT_REDIRECT'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a> '); trigger_error($message); break; @@ -101,9 +101,9 @@ switch ($mode) { if ($user->data['is_registered']) { - redirect("index.$phpEx$SID"); + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } - + login_box(); } @@ -117,10 +117,10 @@ switch ($mode) 'S_AGREEMENT' => true, 'AGREEMENT_TITLE' => $user->lang[$title], 'AGREEMENT_TEXT' => sprintf($user->lang[$message], $config['sitename'], generate_board_url()), - 'U_BACK' => "{$phpbb_root_path}ucp.$phpEx$SID&mode=login", + 'U_BACK' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'), 'L_BACK' => $user->lang['BACK_TO_LOGIN']) ); - + page_footer(); break; @@ -131,6 +131,7 @@ switch ($mode) if (confirm_box(true)) { $set_time = time() - 31536000; + foreach ($_COOKIE as $cookie_name => $cookie_data) { $cookie_name = str_replace($config['cookie_name'] . '_', '', $cookie_name); @@ -139,6 +140,7 @@ switch ($mode) $user->set_cookie($cookie_name, '', $set_time); } } + $user->set_cookie('track', '', $set_time); $user->set_cookie('u', '', $set_time); $user->set_cookie('k', '', $set_time); @@ -148,17 +150,17 @@ switch ($mode) $user->session_kill(); $user->session_begin(); - meta_refresh(3, "{$phpbb_root_path}index.$phpEx$SID"); + meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); - $message = $user->lang['COOKIES_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], "<a href=\"{$phpbb_root_path}index.$phpEx$SID\">", '</a>'); + $message = $user->lang['COOKIES_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>'); trigger_error($message); } else { confirm_box(false, 'DELETE_COOKIES', ''); } - - redirect("index.$phpEx$SID"); + + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); break; @@ -175,7 +177,7 @@ switch ($mode) if (!$auth->acl_get('a_switchperm') || !$user_row || $user_id == $user->data['user_id']) { - redirect("index.$phpEx$SID"); + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } include($phpbb_root_path . 'includes/acp/auth.' . $phpEx); @@ -183,19 +185,12 @@ switch ($mode) $auth_admin = new auth_admin(); if (!$auth_admin->ghost_permissions($user_id, $user->data['user_id'])) { - redirect("index.$phpEx$SID"); + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } - $sql = 'SELECT username - FROM ' . USERS_TABLE . ' - WHERE user_id = ' . $user_id; - $result = $db->sql_query($sql); - $username = $db->sql_fetchfield('username'); - $db->sql_freeresult($result); - - add_log('admin', 'LOG_ACL_TRANSFER_PERMISSIONS', $username); + add_log('admin', 'LOG_ACL_TRANSFER_PERMISSIONS', $user_row['username']); - $message = sprintf($user->lang['PERMISSIONS_TRANSFERED'], $user_row['username']) . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], "<a href=\"{$phpbb_root_path}index.$phpEx$SID\">", '</a>'); + $message = sprintf($user->lang['PERMISSIONS_TRANSFERED'], $user_row['username']) . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>'); trigger_error($message); break; @@ -204,7 +199,7 @@ switch ($mode) if (!$user->data['user_perm_from'] || !$auth->acl_get('a_switchperm')) { - redirect("index.$phpEx$SID"); + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } $auth->acl_cache($user->data); @@ -223,7 +218,7 @@ switch ($mode) add_log('admin', 'LOG_ACL_RESTORE_PERMISSIONS', $username); - $message = $user->lang['PERMISSIONS_RESTORED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], "<a href=\"{$phpbb_root_path}index.$phpEx$SID\">", '</a>'); + $message = $user->lang['PERMISSIONS_RESTORED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>'); trigger_error($message); break; @@ -234,7 +229,7 @@ if (!$user->data['is_registered']) { if ($user->data['is_bot']) { - redirect("index.$phpEx$SID"); + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } login_box('', $user->lang['LOGIN_EXPLAIN_UCP']); @@ -260,8 +255,8 @@ $sql = $db->sql_build_query('SELECT_DISTINCT', array( ), 'WHERE' => 'z.user_id = ' . $user->data['user_id'] . ' - AND z.friend = 1 - AND u.user_id = z.zebra_id', + 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', @@ -275,7 +270,7 @@ while ($row = $db->sql_fetchrow($result)) $which = (time() - $update_time < $row['online_time'] && $row['viewonline'] && $row['user_allow_viewonline']) ? 'online' : 'offline'; $template->assign_block_vars("friends_{$which}", array( - 'U_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'], + 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), 'USER_ID' => $row['user_id'], 'USERNAME' => $row['username']) @@ -307,7 +302,7 @@ if ($mode == 'compose' && request_var('action', '') != 'edit') 'S_SHOW_PM_BOX' => true, 'S_ALLOW_MASS_PM' => ($config['allow_mass_pm']), 'S_GROUP_OPTIONS' => ($config['allow_mass_pm']) ? $group_options : '', - 'U_SEARCH_USER' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=searchuser&form=post&field=username_list") + 'U_SEARCH_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=post&field=username_list')) ); } @@ -321,7 +316,7 @@ $module->set_active($id, $mode); $module->load_active(); // Assign data to the template engine for the list of modules -$module->assign_tpl_vars("ucp.$phpEx$SID"); +$module->assign_tpl_vars(append_sid("{$phpbb_root_path}ucp.$phpEx")); // Generate the page page_header($user->lang['UCP_MAIN']); diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 23fd6ab727..41e4b0257f 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -49,7 +49,6 @@ if ($config['load_db_lastread'] && $user->data['is_registered']) else { $lastread_select = ''; - $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? unserialize(stripslashes($_COOKIE[$config['cookie_name'] . '_track'])) : array(); } if ($user->data['is_registered']) @@ -62,12 +61,14 @@ $sql = "SELECT f.* $lastread_select FROM $sql_from WHERE f.forum_id = $forum_id"; $result = $db->sql_query($sql); +$forum_data = $db->sql_fetchrow($result); +$db->sql_freeresult($result); -if (!($forum_data = $db->sql_fetchrow($result))) +if (!$forum_data) { trigger_error('NO_FORUM'); } -$db->sql_freeresult($result); + // Configure style, language, etc. $user->setup('viewforum', $forum_data['forum_style']); @@ -138,7 +139,7 @@ $template->set_filenames(array( 'body' => 'viewforum_body.html') ); -make_jumpbox("{$phpbb_root_path}viewforum.$phpEx$SID", $forum_id); +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))) @@ -151,7 +152,7 @@ if ($mark_read == 'topics') { markread('topics', $forum_id); - $redirect_url = "{$phpbb_root_path}viewforum.$phpEx$SID&f=$forum_id"; + $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); meta_refresh(3, $redirect_url); trigger_error($user->lang['TOPICS_MARKED'] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>')); @@ -234,7 +235,7 @@ $post_alt = ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['FORUM_LO $s_display_active = ($forum_data['forum_type'] == FORUM_CAT && ($forum_data['forum_flags'] & 16)) ? true : false; $template->assign_vars(array( - 'PAGINATION' => generate_pagination("{$phpbb_root_path}viewforum.$phpEx$SID&f=$forum_id&$u_sort_param", $topics_count, $config['topics_per_page'], $start), + 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&$u_sort_param"), $topics_count, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start), 'TOTAL_TOPICS' => ($s_display_active) ? false : (($topics_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count)), 'MODERATORS' => (!empty($moderators[$forum_id])) ? implode(', ', $moderators[$forum_id]) : '', @@ -267,14 +268,14 @@ $template->assign_vars(array( 'S_TOPIC_ICONS' => ($s_display_active && sizeof($active_forum_ary)) ? max($active_forum_ary['enable_icons']) : (($forum_data['enable_icons']) ? true : false), 'S_WATCH_FORUM_LINK' => $s_watching_forum['link'], 'S_WATCH_FORUM_TITLE' => $s_watching_forum['title'], - 'S_FORUM_ACTION' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=$forum_id&start=$start", + 'S_FORUM_ACTION' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&start=$start"), 'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('f_search', $forum_id)) ? true : false, - 'S_SEARCHBOX_ACTION' => "{$phpbb_root_path}search.$phpEx$SID&fid[]=$forum_id", + 'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 'fid[]=' . $forum_id), - 'U_MCP' => ($auth->acl_gets('m_', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx?sid=$user->session_id&f=$forum_id&i=main&mode=forum_view" : '', - 'U_POST_NEW_TOPIC' => "{$phpbb_root_path}posting.$phpEx$SID&mode=post&f=$forum_id", - 'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=$forum_id&$u_sort_param&start=$start", - 'U_MARK_TOPICS' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=$forum_id&mark=topics") + 'U_MCP' => ($auth->acl_gets('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&i=main&mode=forum_view", true, $user->session_id) : '', + 'U_POST_NEW_TOPIC' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&f=' . $forum_id), + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&$u_sort_param&start=$start"), + 'U_MARK_TOPICS' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&mark=topics")) ); // Grab icons @@ -438,9 +439,9 @@ if (sizeof($topic_list)) if (!$user->data['is_registered']) { - $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate'] : 0; + $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0; } - $mark_time_forum = (isset($tracking_topics['f'][$forum_id])) ? base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate'] : $user->data['user_lastmark']; + $mark_time_forum = (isset($tracking_topics['f'][$forum_id])) ? (int) (base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate']) : $user->data['user_lastmark']; } } @@ -471,11 +472,11 @@ if (sizeof($topic_list)) topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type); // Generate all the URIs ... - $view_topic_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=" . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . "&t=$topic_id"; + $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&t=' . $topic_id); $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; - $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&i=queue&mode=" . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$topic_id" : ''; + $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$topic_id", true, $user->session_id) : ''; // Send vars to template $template->assign_block_vars('topicrow', array( @@ -514,9 +515,9 @@ 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']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['topic_last_poster_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_VIEW_TOPIC' => $view_topic_url, - 'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&i=reports&mode=reports&t=$topic_id", + 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&t=' . $topic_id, true, $user->session_id), 'U_MCP_QUEUE' => $u_mcp_queue, 'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test) diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 164b1bf12d..60339ce8ad 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -14,7 +14,7 @@ define('IN_PHPBB', true); $phpbb_root_path = './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -include($phpbb_root_path . 'common.'.$phpEx); +include($phpbb_root_path . 'common.' . $phpEx); // Start session management $user->session_begin(); @@ -65,7 +65,7 @@ if ($mode == 'whois') $template->set_filenames(array( 'body' => 'viewonline_whois.html') ); - make_jumpbox('viewforum.'.$phpEx); + make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); page_footer(); } @@ -87,7 +87,8 @@ $guest_counter = 0; // Get number of online guests (if we do not display them) if (!$show_guests) { - $sql = 'SELECT COUNT(DISTINCT session_ip) as num_guests FROM ' . SESSIONS_TABLE . ' + $sql = 'SELECT COUNT(DISTINCT session_ip) as num_guests + FROM ' . SESSIONS_TABLE . ' WHERE session_user_id = ' . ANONYMOUS . ' AND session_time >= ' . (time() - ($config['load_online_time'] * 60)); $result = $db->sql_query($sql); @@ -112,7 +113,7 @@ while ($row = $db->sql_fetchrow($result)) if ($row['user_id'] != ANONYMOUS && !isset($prev_id[$row['user_id']])) { $view_online = false; - + if ($row['user_colour']) { $row['username'] = '<b style="color:#' . $row['user_colour'] . '">' . $row['username'] . '</b>'; @@ -171,12 +172,12 @@ while ($row = $db->sql_fetchrow($result)) { case 'index': $location = $user->lang['INDEX']; - $location_url = "index.$phpEx$SID"; + $location_url = append_sid("{$phpbb_root_path}index.$phpEx"); break; case 'adm/index': $location = $user->lang['ACP']; - $location_url = "index.$phpEx$SID"; + $location_url = append_sid("{$phpbb_root_path}index.$phpEx"); break; case 'posting': @@ -214,33 +215,33 @@ while ($row = $db->sql_fetchrow($result)) break; } - $location_url = "viewforum.$phpEx$SID&f=$forum_id"; + $location_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); } else { $location = $user->lang['INDEX']; - $location_url = "index.$phpEx$SID"; + $location_url = append_sid("{$phpbb_root_path}index.$phpEx"); } break; case 'search': $location = $user->lang['SEARCHING_FORUMS']; - $location_url = "search.$phpEx$SID"; + $location_url = append_sid("{$phpbb_root_path}search.$phpEx"); break; case 'faq': $location = $user->lang['VIEWING_FAQ']; - $location_url = "faq.$phpEx$SID"; + $location_url = append_sid("{$phpbb_root_path}faq.$phpEx"); break; case 'viewonline': $location = $user->lang['VIEWING_ONLINE']; - $location_url = "viewonline.$phpEx$SID"; + $location_url = append_sid("{$phpbb_root_path}viewonline.$phpEx"); break; case 'memberlist': $location = (strpos($row['session_page'], 'mode=viewprofile') !== false) ? $user->lang['VIEWING_MEMBER_PROFILE'] : $user->lang['VIEWING_MEMBERS']; - $location_url = "memberlist.$phpEx$SID"; + $location_url = append_sid("{$phpbb_root_path}memberlist.$phpEx"); break; case 'mcp': @@ -255,22 +256,22 @@ while ($row = $db->sql_fetchrow($result)) $location = 'Composing PM'; }*/ - $location_url = "index.$phpEx$SID"; + $location_url = append_sid("{$phpbb_root_path}index.$phpEx"); break; case 'download': $location = $user->lang['DOWNLOADING_FILE']; - $location_url = "index.$phpEx$SID"; + $location_url = append_sid("{$phpbb_root_path}index.$phpEx"); break; case 'report': $location = $user->lang['REPORTING_POST']; - $location_url = "index.$phpEx$SID"; + $location_url = append_sid("{$phpbb_root_path}index.$phpEx"); break; default: $location = $user->lang['INDEX']; - $location_url = "index.$phpEx$SID"; + $location_url = append_sid("{$phpbb_root_path}index.$phpEx"); break; } @@ -280,10 +281,10 @@ while ($row = $db->sql_fetchrow($result)) 'FORUM_LOCATION' => $location, 'USER_IP' => ($auth->acl_get('a_')) ? (($mode == 'lookup' && $session_id == $row['session_id']) ? gethostbyaddr($row['session_ip']) : $row['session_ip']) : '', - 'U_USER_PROFILE' => (($row['user_type'] == USER_NORMAL || $row['user_type'] == USER_FOUNDER) && $row['user_id'] != ANONYMOUS) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'] : '', - 'U_USER_IP' => "{$phpbb_root_path}viewonline.$phpEx$SID" . (($mode != 'lookup' || $row['session_id'] != $session_id) ? '&s=' . $row['session_id'] : '') . "&mode=lookup&sg=$show_guests&start=$start&sk=$sort_key&sd=$sort_dir", - 'U_WHOIS' => "{$phpbb_root_path}viewonline.$phpEx$SID&mode=whois&s=" . $row['session_id'], - 'U_FORUM_LOCATION' => $phpbb_root_path . $location_url, + 'U_USER_PROFILE' => (($row['user_type'] == USER_NORMAL || $row['user_type'] == USER_FOUNDER) && $row['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']) : '', + 'U_USER_IP' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'mode=lookup' . (($mode != 'lookup' || $row['session_id'] != $session_id) ? '&s=' . $row['session_id'] : '') . "&sg=$show_guests&start=$start&sk=$sort_key&sd=$sort_dir"), + 'U_WHOIS' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'mode=whois&s=' . $row['session_id']), + 'U_FORUM_LOCATION' => $location_url, 'S_GUEST' => ($row['user_id'] == ANONYMOUS) ? true : false, 'S_USER_TYPE' => $row['user_type']) @@ -305,20 +306,20 @@ foreach ($vars_online as $l_prefix => $var_ary) { case 0: $$var_ary[1] = $user->lang[$l_prefix . '_USERS_ZERO_ONLINE']; - break; + break; case 1: $$var_ary[1] = $user->lang[$l_prefix . '_USER_ONLINE']; - break; + break; default: $$var_ary[1] = $user->lang[$l_prefix . '_USERS_ONLINE']; - break; + break; } } unset($vars_online); -$pagination = generate_pagination("{$phpbb_root_path}viewonline.$phpEx$SID&sg=$show_guests&sk=$sort_key&sd=$sort_dir", $counter, $config['topics_per_page'], $start); +$pagination = generate_pagination(append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir"), $counter, $config['topics_per_page'], $start); // Grab group details for legend display $sql = 'SELECT group_id, group_name, group_colour, group_type @@ -329,26 +330,26 @@ $result = $db->sql_query($sql); $legend = ''; while ($row = $db->sql_fetchrow($result)) { - $legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . "{$phpbb_root_path}memberlist.$phpEx$SID" . '&mode=group&g=' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>'; + $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); // Refreshing the page every 60 seconds... -meta_refresh(60, "{$phpbb_root_path}viewonline.$phpEx$SID&sg=$show_guests&sk=$sort_key&sd=$sort_dir&start=$start"); +meta_refresh(60, append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir&start=$start")); // Send data to template $template->assign_vars(array( 'TOTAL_REGISTERED_USERS_ONLINE' => sprintf($l_r_user_s, $logged_visible_online) . sprintf($l_h_user_s, $logged_hidden_online), 'TOTAL_GUEST_USERS_ONLINE' => sprintf($l_g_user_s, $guest_counter), - 'LEGEND' => $legend, - 'PAGINATION' => $pagination, - 'PAGE_NUMBER' => on_page($counter, $config['topics_per_page'], $start), + 'LEGEND' => $legend, + 'PAGINATION' => $pagination, + 'PAGE_NUMBER' => on_page($counter, $config['topics_per_page'], $start), - 'U_SORT_USERNAME' => "{$phpbb_root_path}viewonline.$phpEx$SID&sk=a&sd=" . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_UPDATED' => "{$phpbb_root_path}viewonline.$phpEx$SID&sk=b&sd=" . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_LOCATION' => "{$phpbb_root_path}viewonline.$phpEx$SID&sk=c&sd=" . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_USERNAME' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a')), + 'U_SORT_UPDATED' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a')), + 'U_SORT_LOCATION' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=c&sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a')), - 'U_SWITCH_GUEST_DISPLAY' => "{$phpbb_root_path}viewonline.$phpEx$SID&sg=" . ((int) !$show_guests), + 'U_SWITCH_GUEST_DISPLAY' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sg=' . ((int) !$show_guests)), 'L_SWITCH_GUEST_DISPLAY' => ($show_guests) ? $user->lang['HIDE_GUESTS'] : $user->lang['DISPLAY_GUESTS'], 'S_SWITCH_GUEST_DISPLAY' => ($config['load_online_guests']) ? true : false) ); @@ -362,7 +363,7 @@ page_header($user->lang['WHO_IS_ONLINE']); $template->set_filenames(array( 'body' => 'viewonline_body.html') ); -make_jumpbox('viewforum.'.$phpEx); +make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx")); page_footer(); diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 9738a22dfa..b4c76d33ab 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -86,7 +86,7 @@ if ($view && !$post_id) // Setup user environment so we can process lang string $user->setup('viewtopic'); - $redirect = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id"; + $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>')); @@ -215,7 +215,7 @@ if (!$topic_data) // If post_id was submitted, we try at least to display the topic as a last resort... if ($post_id && $forum_id && $topic_id) { - redirect("{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id"); + redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id")); } trigger_error('NO_TOPIC'); @@ -286,7 +286,7 @@ if (isset($_GET['e'])) { $jump_to = request_var('e', 0); - $redirect_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id"; + $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"); if ($user->data['user_id'] == ANONYMOUS) { @@ -296,7 +296,7 @@ if (isset($_GET['e'])) if ($jump_to > 0) { // We direct the already logged in user to the correct post... - redirect($redirect_url . ((!$post_id) ? "&p=$jump_to" : "&p=$post_id") . "#p$jump_to"); + redirect($redirect_url . ((!$post_id) ? "&p=$jump_to" : "&p=$post_id") . "#p$jump_to"); } } @@ -375,7 +375,7 @@ if ($hilit_words) } // General Viewtopic URL for return links -$viewtopic_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&start=$start&$u_sort_param" . (($highlight_match) ? "&hilit=$highlight" : ''); +$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start&$u_sort_param" . (($highlight_match) ? "&hilit=$highlight" : '')); // Are we watching this topic? $s_watching_topic = $s_watching_topic_img = array(); @@ -461,7 +461,7 @@ $topic_mod .= ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_mod .= ($auth->acl_get('m_', $forum_id)) ? '<option value="topic_logs">' . $user->lang['VIEW_TOPIC_LOGS'] . '</option>' : ''; // If we've got a hightlight set pass it on to pagination. -$pagination = generate_pagination("{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&$u_sort_param" . (($highlight_match) ? "&hilit=$highlight" : ''), $total_posts, $config['posts_per_page'], $start); +$pagination = generate_pagination(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&$u_sort_param" . (($highlight_match) ? "&hilit=$highlight" : '')), $total_posts, $config['posts_per_page'], $start); // Navigation links generate_forum_nav($topic_data); @@ -489,7 +489,7 @@ $template->assign_vars(array( 'PAGINATION' => $pagination, 'PAGE_NUMBER' => on_page($total_posts, $config['posts_per_page'], $start), 'TOTAL_POSTS' => ($total_posts == 1) ? $user->lang['VIEW_TOPIC_POST'] : sprintf($user->lang['VIEW_TOPIC_POSTS'], $total_posts), - 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx?sid=" . $user->session_id . "&i=main&mode=topic_view&f=$forum_id&t=$topic_id&start=$start&$u_sort_param" : '', + 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=topic_view&f=$forum_id&t=$topic_id&start=$start&$u_sort_param", true, $user->session_id) : '', 'MODERATORS' => (isset($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id])) ? implode(', ', $forum_moderators[$forum_id]) : '', 'POST_IMG' => ($topic_data['forum_status'] == ITEM_LOCKED) ? $user->img('btn_locked', 'FORUM_LOCKED') : $user->img('btn_post', 'POST_NEW_TOPIC'), @@ -516,22 +516,22 @@ $template->assign_vars(array( 'S_SELECT_SORT_DIR' => $s_sort_dir, 'S_SELECT_SORT_KEY' => $s_sort_key, 'S_SELECT_SORT_DAYS' => $s_limit_days, - 'S_TOPIC_ACTION' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&start=$start", + 'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start"), 'S_TOPIC_MOD' => ($topic_mod != '') ? '<select name="action">' . $topic_mod . '</select>' : '', - 'S_MOD_ACTION' => "{$phpbb_root_path}mcp.$phpEx?sid=" . $user->session_id . "&t=$topic_id&f=$forum_id&quickmod=1", + 'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "t=$topic_id&f=$forum_id&quickmod=1", true, $user->session_id), 'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('f_search', $forum_id)) ? true : false, - 'S_SEARCHBOX_ACTION' => "{$phpbb_root_path}search.$phpEx$SID&t=$topic_id", + 'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 't=' . $topic_id), 'U_TOPIC' => "{$server_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id", 'U_FORUM' => $server_path, - 'U_VIEW_UNREAD_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&view=unread#unread", + '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' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=$forum_id", - 'U_VIEW_OLDER_TOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&view=previous", - 'U_VIEW_NEWER_TOPIC' => "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&view=next", + '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"), + 'U_VIEW_NEWER_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=next"), 'U_PRINT_TOPIC' => ($auth->acl_get('f_print', $forum_id)) ? $viewtopic_url . '&view=print' : '', - 'U_EMAIL_TOPIC' => ($auth->acl_get('f_email', $forum_id) && $config['email_enable']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=email&t=$topic_id" : '', + 'U_EMAIL_TOPIC' => ($auth->acl_get('f_email', $forum_id) && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&t=$topic_id") : '', 'U_WATCH_TOPIC' => $s_watching_topic['link'], 'L_WATCH_TOPIC' => $s_watching_topic['title'], @@ -539,9 +539,9 @@ $template->assign_vars(array( 'U_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks']) ? $viewtopic_url . '&bookmark=1' : '', 'L_BOOKMARK_TOPIC' => ($user->data['is_registered'] && $config['allow_bookmarks'] && $topic_data['bookmarked']) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'], - 'U_POST_NEW_TOPIC' => "{$phpbb_root_path}posting.$phpEx$SID&mode=post&f=$forum_id", - 'U_POST_REPLY_TOPIC' => "{$phpbb_root_path}posting.$phpEx$SID&mode=reply&f=$forum_id&t=$topic_id", - 'U_BUMP_TOPIC' => (bump_topic_allowed($forum_id, $topic_data['topic_bumped'], $topic_data['topic_last_post_time'], $topic_data['topic_poster'], $topic_data['topic_last_poster_id'])) ? "{$phpbb_root_path}posting.$phpEx$SID&mode=bump&f=$forum_id&t=$topic_id" : '') + 'U_POST_NEW_TOPIC' => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=post&f=$forum_id"), + 'U_POST_REPLY_TOPIC' => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&f=$forum_id&t=$topic_id"), + 'U_BUMP_TOPIC' => (bump_topic_allowed($forum_id, $topic_data['topic_bumped'], $topic_data['topic_last_post_time'], $topic_data['topic_poster'], $topic_data['topic_last_poster_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=bump&f=$forum_id&t=$topic_id") : '') ); // Does this topic contain a poll? @@ -600,7 +600,7 @@ if (!empty($topic_data['poll_start'])) { if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options']) { - $redirect_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id"; + $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"); meta_refresh(5, $redirect_url); @@ -668,7 +668,7 @@ if (!empty($topic_data['poll_start'])) //, topic_last_post_time = ' . time() . " -- for bumping topics with new votes, ignore for now $db->sql_query($sql); - $redirect_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id"; + $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"); meta_refresh(5, $redirect_url); trigger_error($user->lang['VOTE_SUBMITTED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>')); @@ -961,13 +961,13 @@ while ($row = $db->sql_fetchrow($result)) 'avatar' => '', 'online' => false, - 'profile' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u=$poster_id", + 'profile' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$poster_id"), 'www' => $row['user_website'], - 'aim' => ($row['user_aim']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=contact&action=aim&u=$poster_id" : '', - 'msn' => ($row['user_msnm']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=contact&action=msnm&u=$poster_id" : '', + 'aim' => ($row['user_aim']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=aim&u=$poster_id") : '', + 'msn' => ($row['user_msnm']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=msnm&u=$poster_id") : '', 'yim' => ($row['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&.src=pg' : '', - 'jabber' => ($row['user_jabber']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=contact&action=jabber&u=$poster_id" : '', - 'search' => ($auth->acl_get('u_search')) ? "{$phpbb_root_path}search.$phpEx$SID&search_author=" . urlencode($row['username']) .'&showresults=posts' : '', + 'jabber' => ($row['user_jabber']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=jabber&u=$poster_id") : '', + 'search' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", 'search_author=' . urlencode($row['username']) .'&showresults=posts') : '', 'username' => ($row['user_colour']) ? '<span style="color:#' . $row['user_colour'] . '">' . $poster . '</span>' : $poster ); @@ -1020,7 +1020,7 @@ while ($row = $db->sql_fetchrow($result)) if (!empty($row['user_allow_viewemail']) || $auth->acl_get('a_email')) { - $user_cache[$poster_id]['email'] = ($config['board_email_form'] && $config['email_enable']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=email&u=$poster_id" : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $row['user_email']); + $user_cache[$poster_id]['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&u=$poster_id") : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $row['user_email']); } else { @@ -1029,7 +1029,7 @@ while ($row = $db->sql_fetchrow($result)) if (!empty($row['user_icq'])) { - $user_cache[$poster_id]['icq'] = "{$phpbb_root_path}memberlist.$phpEx$SID&mode=contact&action=icq&u=$poster_id"; + $user_cache[$poster_id]['icq'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=icq&u=$poster_id"); $user_cache[$poster_id]['icq_status_img'] = '<img src="http://web.icq.com/whitepages/online?icq=' . $row['user_icq'] . '&img=5" width="18" height="18" alt="" />'; } else @@ -1338,14 +1338,14 @@ 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('btn_online', 'ONLINE') : $user->img('btn_offline', 'OFFLINE')), 'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false), - 'U_EDIT' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - $config['edit_time'] || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? "{$phpbb_root_path}posting.$phpEx$SID&mode=edit&f=$forum_id&p={$row['post_id']}" : '', - 'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? "{$phpbb_root_path}posting.$phpEx$SID&mode=quote&f=$forum_id&p={$row['post_id']}" : '', - 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=main&mode=post_details&p={$row['post_id']}" : '', - 'U_DELETE' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && ($row['post_time'] > time() - $config['edit_time'] || !$config['edit_time'])) || $auth->acl_get('m_delete', $forum_id)) ? "{$phpbb_root_path}posting.$phpEx$SID&mode=delete&f=$forum_id&p={$row['post_id']}" : '', + 'U_EDIT' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - $config['edit_time'] || !$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&p=' . $row['post_id'], true, $user->session_id) : '', + 'U_DELETE' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && ($row['post_time'] > time() - $config['edit_time'] || !$config['edit_time'])) || $auth->acl_get('m_delete', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&f=$forum_id&p={$row['post_id']}") : '', 'U_PROFILE' => $user_cache[$poster_id]['profile'], 'U_SEARCH' => $user_cache[$poster_id]['search'], - 'U_PM' => ($poster_id != ANONYMOUS) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=compose&action=quotepost&p={$row['post_id']}" : '', + 'U_PM' => ($poster_id != ANONYMOUS) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&action=quotepost&p=' . $row['post_id']) : '', 'U_EMAIL' => $user_cache[$poster_id]['email'], 'U_WWW' => $user_cache[$poster_id]['www'], 'U_ICQ' => $user_cache[$poster_id]['icq'], @@ -1354,14 +1354,14 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'U_YIM' => $user_cache[$poster_id]['yim'], 'U_JABBER' => $user_cache[$poster_id]['jabber'], - 'U_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? "{$phpbb_root_path}report.$phpEx$SID&p=" . $row['post_id'] : '', - 'U_MCP_REPORT' => ($auth->acl_gets('m_report', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=reports&mode=report_details&p=" . $row['post_id'] : '', - 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=queue&mode=unapproved_posts&action=approve&post_id_list[]=" . $row['post_id'] : '', - 'U_MINI_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&p=" . $row['post_id'] . '#p' . $row['post_id'], + 'U_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? append_sid("{$phpbb_root_path}report.$phpEx", 'p=' . $row['post_id']) : '', + 'U_MCP_REPORT' => ($auth->acl_gets('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&p=' . $row['post_id'], true, $user->session_id) : '', + 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=unapproved_posts&action=approve&post_id_list[]=' . $row['post_id'], true, $user->session_id) : '', + 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'], 'U_NEXT_POST_ID' => ($i < $i_total && isset($rowset[$post_list[$i + 1]])) ? $rowset[$post_list[$i + 1]]['post_id'] : '', 'U_PREV_POST_ID' => $prev_post_id, - 'U_NOTES' => ($auth->acl_gets('m_', 'a_', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=notes&mode=user_notes&u=" . $poster_id : '', - 'U_WARN' => ($auth->acl_gets('m_', 'a_', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=warn&mode=warn_post&p=" . $row['post_id'] : '', + 'U_NOTES' => ($auth->acl_gets('m_', 'a_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $poster_id, true, $user->session_id) : '', + 'U_WARN' => ($auth->acl_gets('m_', 'a_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_post&p=' . $row['post_id'], true, $user->session_id) : '', 'POST_ID' => $row['post_id'], @@ -1445,7 +1445,7 @@ page_header($user->lang['VIEW_TOPIC'] .' - ' . $topic_data['topic_title']); $template->set_filenames(array( 'body' => ($view == 'print') ? 'viewtopic_print.html' : 'viewtopic_body.html') ); -make_jumpbox('viewforum.' . $phpEx, $forum_id); +make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"), $forum_id); page_footer(); |