mirror of
https://github.com/phpbb/phpbb.git
synced 2025-09-10 08:10:44 +02:00
Compare commits
1 Commits
release-3.
...
release-3.
Author | SHA1 | Date | |
---|---|---|---|
|
e2ef990121 |
@@ -131,7 +131,7 @@ function adm_page_header($page_title)
|
||||
'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
|
||||
'ICON_MOVE_UP_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
|
||||
'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
||||
'ICON_MOVE_DOWN_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
||||
'ICON_MOVE_DOWN_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
||||
'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
|
||||
'ICON_EDIT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
|
||||
'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
|
||||
@@ -301,9 +301,8 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
|
||||
break;
|
||||
|
||||
case 'select':
|
||||
case 'select_multiple':
|
||||
case 'custom':
|
||||
|
||||
|
||||
$return = '';
|
||||
|
||||
if (isset($vars['method']))
|
||||
@@ -340,21 +339,12 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($tpl_type[0] == 'select_multiple')
|
||||
{
|
||||
$new[$config_key] = @unserialize(trim($new[$config_key]));
|
||||
}
|
||||
|
||||
$args = array($new[$config_key], $key);
|
||||
}
|
||||
|
||||
|
||||
$return = call_user_func_array($call, $args);
|
||||
|
||||
if ($tpl_type[0] == 'select_multiple')
|
||||
{
|
||||
$tpl = '<select id="' . $key . '" name="' . $name . '[]" multiple="multiple">' . $return . '</select>';
|
||||
}
|
||||
else if ($tpl_type[0] == 'select')
|
||||
if ($tpl_type[0] == 'select')
|
||||
{
|
||||
$tpl = '<select id="' . $key . '" name="' . $name . '">' . $return . '</select>';
|
||||
}
|
||||
@@ -387,19 +377,19 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
||||
$type = 0;
|
||||
$min = 1;
|
||||
$max = 2;
|
||||
|
||||
|
||||
foreach ($config_vars as $config_name => $config_definition)
|
||||
{
|
||||
if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!isset($config_definition['validate']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$validator = explode(':', $config_definition['validate']);
|
||||
|
||||
// Validate a bit. ;) (0 = type, 1 = min, 2= max)
|
||||
@@ -558,14 +548,14 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
||||
function validate_range($value_ary, &$error)
|
||||
{
|
||||
global $user;
|
||||
|
||||
|
||||
$column_types = array(
|
||||
'BOOL' => array('php_type' => 'int', 'min' => 0, 'max' => 1),
|
||||
'USINT' => array('php_type' => 'int', 'min' => 0, 'max' => 65535),
|
||||
'UINT' => array('php_type' => 'int', 'min' => 0, 'max' => (int) 0x7fffffff),
|
||||
'INT' => array('php_type' => 'int', 'min' => (int) 0x80000000, 'max' => (int) 0x7fffffff),
|
||||
'TINT' => array('php_type' => 'int', 'min' => -128, 'max' => 127),
|
||||
|
||||
|
||||
'VCHAR' => array('php_type' => 'string', 'min' => 0, 'max' => 255),
|
||||
);
|
||||
foreach ($value_ary as $value)
|
||||
@@ -592,7 +582,7 @@ function validate_range($value_ary, &$error)
|
||||
}
|
||||
break;
|
||||
|
||||
case 'int':
|
||||
case 'int':
|
||||
$min = (isset($column[1])) ? max($column[1],$type['min']) : $type['min'];
|
||||
$max = (isset($column[2])) ? min($column[2],$type['max']) : $type['max'];
|
||||
if ($value['value'] < $min)
|
||||
|
@@ -97,11 +97,11 @@
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="unbanreason">{L_BAN_REASON}:</label></dt>
|
||||
<dd><textarea style="border: 0;" class="text full" disabled="disabled" name="unbanreason" id="unbanreason" rows="5" cols="80"> </textarea></dd>
|
||||
<dd><input style="border: 0;" type="text" class="text full" disabled="disabled" name="unbanreason" id="unbanreason" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="unbangivereason">{L_BAN_GIVE_REASON}:</label></dt>
|
||||
<dd><textarea style="border: 0;" class="text full" disabled="disabled" name="unbangivereason" id="unbangivereason" rows="5" cols="80"> </textarea></dd>
|
||||
<dd><input style="border: 0;" type="text" class="text full" disabled="disabled" name="unbangivereason" id="unbangivereason" /></dd>
|
||||
</dl>
|
||||
|
||||
<p class="submit-buttons">
|
||||
|
@@ -22,11 +22,6 @@
|
||||
<dd><label><input type="radio" class="radio" id="enable_post_confirm" name="enable_post_confirm" value="1"<!-- IF POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label>
|
||||
<label><input type="radio" class="radio" name="enable_post_confirm" value="0"<!-- IF not POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="confirm_refresh">{L_VISUAL_CONFIRM_REFRESH}:</label><br /><span>{L_VISUAL_CONFIRM_REFRESH_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" id="confirm_refresh" name="confirm_refresh" value="1"<!-- IF CONFIRM_REFRESH --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label>
|
||||
<label><input type="radio" class="radio" name="confirm_refresh" value="0"<!-- IF not CONFIRM_REFRESH --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd>
|
||||
</dl>
|
||||
<!-- IF GD -->
|
||||
<dl>
|
||||
<dt><label for="captcha_gd">{L_CAPTCHA_GD}:</label><br /><span>{L_CAPTCHA_GD_EXPLAIN}</span></dt>
|
||||
@@ -46,26 +41,6 @@
|
||||
<dt><label for="captcha_gd_y_grid">{L_CAPTCHA_GD_Y_GRID}:</label><br /><span>{L_CAPTCHA_GD_Y_GRID_EXPLAIN}</span></dt>
|
||||
<dd><input id="captcha_gd_y_grid" name="captcha_gd_y_grid" value="{CAPTCHA_GD_Y_GRID}" type="text" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="captcha_gd_wave">{L_CAPTCHA_GD_WAVE}:</label><br /><span>{L_CAPTCHA_GD_WAVE_EXPLAIN}</span></dt>
|
||||
<dd><label><input id="captcha_gd_wave" name="captcha_gd_wave" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_WAVE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input name="captcha_gd_wave" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_WAVE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="captcha_gd_3d_noise">{L_CAPTCHA_GD_3D_NOISE}:</label><br /><span>{L_CAPTCHA_GD_3D_NOISE_EXPLAIN}</span></dt>
|
||||
<dd><label><input id="captcha_gd_3d_noise" name="captcha_gd_3d_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_3D_NOISE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input name="captcha_gd_3d_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_3D_NOISE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="captcha_gd_fonts">{L_CAPTCHA_GD_FONTS}:</label><br /><span>{L_CAPTCHA_GD_FONTS_EXPLAIN}</span></dt>
|
||||
<dd><label><input id="captcha_gd_fonts" name="captcha_gd_fonts" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_FONTS == 1 --> checked="checked"<!-- ENDIF --> /> {L_CAPTCHA_FONT_DEFAULT}</label>
|
||||
<label><input name="captcha_gd_fonts" value="2" class="radio" type="radio"<!-- IF CAPTCHA_GD_FONTS == 2 --> checked="checked"<!-- ENDIF --> /> {L_CAPTCHA_FONT_NEW}</label>
|
||||
<label><input name="captcha_gd_fonts" value="3" class="radio" type="radio"<!-- IF CAPTCHA_GD_FONTS == 3 --> checked="checked"<!-- ENDIF --> /> {L_CAPTCHA_FONT_LOWER}</label>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
|
||||
</fieldset>
|
||||
|
@@ -70,8 +70,8 @@
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="where">{L_ACTION}:</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" class="radio" name="where" value="store" checked="checked" /> {L_STORE_LOCAL}</label>
|
||||
<dd><label><input type="radio" class="radio" name="where" value="store_and_download" id="where" checked="checked" /> {L_STORE_AND_DOWNLOAD}</label>
|
||||
<label><input type="radio" class="radio" name="where" value="store" /> {L_STORE_LOCAL}</label>
|
||||
<label><input type="radio" class="radio" name="where" value="download" /> {L_DOWNLOAD}</label></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
|
@@ -44,7 +44,7 @@
|
||||
</dl>
|
||||
|
||||
<p class="submit-buttons">
|
||||
<input class="button1" type="submit" id="submit" name="submit" value="{L_SEND_EMAIL}" />
|
||||
<input class="button1" type="submit" id="submit" name="submit" value="{L_EMAIL}" />
|
||||
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
|
||||
</p>
|
||||
{S_FORM_TOKEN}
|
||||
|
@@ -444,7 +444,7 @@
|
||||
<!-- IF forums.FORUM_IMAGE --><div style="float: {S_CONTENT_FLOW_BEGIN}; margin-right: 5px;">{forums.FORUM_IMAGE}</div><!-- ENDIF -->
|
||||
<strong><!-- IF forums.S_FORUM_LINK -->{forums.FORUM_NAME}<!-- ELSE --><a href="{forums.U_FORUM}">{forums.FORUM_NAME}</a><!-- ENDIF --></strong>
|
||||
<!-- IF forums.FORUM_DESCRIPTION --><br /><span>{forums.FORUM_DESCRIPTION}</span><!-- ENDIF -->
|
||||
<!-- IF forums.S_FORUM_POST --><br /><br /><span>{L_TOPICS}: <strong>{forums.FORUM_TOPICS}</strong> / {L_POSTS}: <strong>{forums.FORUM_POSTS}</strong></span><!-- ENDIF -->
|
||||
<!-- IF forums.S_FORUM_POST --><br /><br /><span>{L_TOPICS}: <strong>{forums.FORUM_TOPICS}</strong> / {L_POSTS}: <b>{forums.FORUM_POSTS}</b></span><!-- ENDIF -->
|
||||
</td>
|
||||
<td style="vertical-align: top; width: 100px; text-align: right; white-space: nowrap;">
|
||||
<!-- IF forums.S_FIRST_ROW && not forums.S_LAST_ROW -->
|
||||
|
@@ -74,10 +74,6 @@
|
||||
<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_max_recipients">{L_GROUP_MAX_RECIPIENTS}:</label><br /><span>{L_GROUP_MAX_RECIPIENTS_EXPLAIN}</span></dt>
|
||||
<dd><input name="group_max_recipients" type="text" id="group_max_recipients" maxlength="10" size="4" value="{GROUP_MAX_RECIPIENTS}" /></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="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd>
|
||||
|
@@ -21,12 +21,6 @@
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_WRITABLE_CONFIG -->
|
||||
<div class="errorbox notice">
|
||||
<p>{L_WRITABLE_CONFIG}</p>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<table cellspacing="1">
|
||||
<caption>{L_FORUM_STATS}</caption>
|
||||
<col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" />
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<a name="maincontent"></a>
|
||||
|
||||
<!-- IF S_INTRO -->
|
||||
|
||||
|
||||
<h1>{L_ACP_PERMISSIONS}</h1>
|
||||
|
||||
{L_ACP_PERMISSIONS_EXPLAIN}
|
||||
@@ -12,12 +12,10 @@
|
||||
|
||||
<!-- IF S_SELECT_VICTIM -->
|
||||
|
||||
<!-- IF U_BACK --><a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">« {L_BACK}</a><!-- ENDIF -->
|
||||
|
||||
<h1>{L_TITLE}</h1>
|
||||
|
||||
<p>{L_EXPLAIN}</p>
|
||||
|
||||
|
||||
<!-- IF S_FORUM_NAMES -->
|
||||
<p><strong>{L_FORUMS}:</strong> {FORUM_NAMES}</p>
|
||||
<!-- ENDIF -->
|
||||
@@ -64,7 +62,7 @@
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- ELSEIF S_SELECT_USER and S_CAN_SELECT_USER -->
|
||||
@@ -125,7 +123,7 @@
|
||||
<!-- IF S_ALLOW_ALL_SELECT --><dd class="full" style="text-align: right;"><label><input type="checkbox" class="radio" name="all_users" value="1" /> {L_ALL_USERS}</label></dd><!-- ENDIF -->
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset class="quick">
|
||||
{S_HIDDEN_FIELDS}
|
||||
{S_FORM_TOKEN}
|
||||
@@ -156,7 +154,7 @@
|
||||
</div>
|
||||
|
||||
<div style="float: {S_CONTENT_FLOW_END}; width: 48%">
|
||||
|
||||
|
||||
<!-- IF S_CAN_SELECT_GROUP -->
|
||||
|
||||
<h1>{L_USERGROUPS}</h1>
|
||||
@@ -170,7 +168,7 @@
|
||||
<!-- IF S_ALLOW_ALL_SELECT --><dd class="full" style="text-align: right;"><label><input type="checkbox" class="radio" name="all_groups" value="1" /> {L_ALL_GROUPS}</label></dd><!-- ENDIF -->
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset class="quick">
|
||||
{S_HIDDEN_FIELDS}
|
||||
{S_FORM_TOKEN}
|
||||
@@ -179,7 +177,7 @@
|
||||
</form>
|
||||
|
||||
<form id="add_groups" method="post" action="{U_ACTION}">
|
||||
|
||||
|
||||
<fieldset>
|
||||
<legend>{L_ADD_GROUPS}</legend>
|
||||
<dl>
|
||||
@@ -201,7 +199,7 @@
|
||||
<!-- ELSEIF S_SELECT_USERGROUP_VIEW -->
|
||||
|
||||
<div style="float: {S_CONTENT_FLOW_BEGIN}; width: 48%;">
|
||||
|
||||
|
||||
<h1>{L_USERS}</h1>
|
||||
|
||||
<form id="users" method="post" action="{U_ACTION}">
|
||||
@@ -212,7 +210,7 @@
|
||||
<dd class="full"><select style="width: 100%;" name="user_id[]" multiple="multiple" size="5">{S_DEFINED_USER_OPTIONS}</select></dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset class="quick">
|
||||
{S_HIDDEN_FIELDS}
|
||||
{S_FORM_TOKEN}
|
||||
@@ -242,7 +240,7 @@
|
||||
</div>
|
||||
|
||||
<div style="float: {S_CONTENT_FLOW_END}; width: 48%">
|
||||
|
||||
|
||||
<h1>{L_USERGROUPS}</h1>
|
||||
|
||||
<form id="groups" method="post" action="{U_ACTION}">
|
||||
@@ -253,7 +251,7 @@
|
||||
<dd class="full"><select style="width: 100%;" name="group_id[]" multiple="multiple" size="5">{S_DEFINED_GROUP_OPTIONS}</select></dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset class="quick">
|
||||
{S_HIDDEN_FIELDS}
|
||||
{S_FORM_TOKEN}
|
||||
@@ -313,11 +311,11 @@
|
||||
|
||||
<!-- IF S_PERMISSION_DROPDOWN -->
|
||||
<form id="pselect" method="post" action="{U_ACTION}">
|
||||
|
||||
|
||||
<fieldset class="quick" style="float: {S_CONTENT_FLOW_BEGIN};">
|
||||
{S_HIDDEN_FIELDS}
|
||||
{S_FORM_TOKEN}
|
||||
{L_SELECT_TYPE}: <select name="type">{S_PERMISSION_DROPDOWN}</select>
|
||||
{L_SELECT_TYPE}: <select name="type">{S_PERMISSION_DROPDOWN}</select>
|
||||
|
||||
<input class="button2" type="submit" name="submit" value="{L_GO}" />
|
||||
</fieldset>
|
||||
@@ -349,7 +347,7 @@
|
||||
</fieldset>
|
||||
|
||||
<br /><br />
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
@@ -48,20 +48,20 @@
|
||||
<fieldset>
|
||||
<legend>{L_VISIBILITY_OPTION}</legend>
|
||||
<dl>
|
||||
<dt><label for="field_show_profile">{L_DISPLAY_AT_PROFILE}:</label><br /><span>{L_DISPLAY_AT_PROFILE_EXPLAIN}</span></dt>
|
||||
<dd><input type="checkbox" class="radio" id="field_show_profile" name="field_show_profile" value="1"<!-- IF S_SHOW_PROFILE --> checked="checked"<!-- ENDIF --> /></dd>
|
||||
<dt><label for="field_option_none">{L_DISPLAY_AT_PROFILE}:</label><br /><span>{L_DISPLAY_AT_PROFILE_EXPLAIN}</span></dt>
|
||||
<dd><input type="radio" class="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="checkbox" class="radio" id="field_show_on_reg" name="field_show_on_reg" value="1"<!-- IF S_SHOW_ON_REG --> checked="checked"<!-- ENDIF --> /></dd>
|
||||
<dd><input type="radio" class="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="checkbox" class="radio" id="field_required" name="field_required" value="1"<!-- IF S_FIELD_REQUIRED --> checked="checked"<!-- ENDIF --> /></dd>
|
||||
<dd><input type="radio" class="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="checkbox" class="radio" id="field_hide" name="field_hide" value="1"<!-- IF S_FIELD_HIDE --> checked="checked"<!-- ENDIF --> /></dd>
|
||||
<dd><input type="radio" class="radio" id="field_hide" name="field_option" value="field_hide"<!-- IF S_FIELD_HIDE --> checked="checked"<!-- ENDIF --> /></dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
||||
|
@@ -32,10 +32,6 @@
|
||||
<dt><label for="min_search_author_chars">{L_MIN_SEARCH_AUTHOR_CHARS}:</label><br /><span>{L_MIN_SEARCH_AUTHOR_CHARS_EXPLAIN}</span></dt>
|
||||
<dd><input id="min_search_author_chars" type="text" size="4" maxlength="4" name="config[min_search_author_chars]" value="{MIN_SEARCH_AUTHOR_CHARS}" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="max_num_search_keywords">{L_MAX_NUM_SEARCH_KEYWORDS}:</label><br /><span>{L_MAX_NUM_SEARCH_KEYWORDS_EXPLAIN}</span></dt>
|
||||
<dd><input id="max_num_search_keywords" type="text" size="4" maxlength="4" name="config[max_num_search_keywords]" value="{MAX_NUM_SEARCH_KEYWORDS}" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<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}" /> {L_SECONDS}</dd>
|
||||
@@ -134,9 +130,9 @@
|
||||
<!-- END data -->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
||||
|
||||
<p class="quick">
|
||||
<!-- IF backend.S_INDEXED -->
|
||||
<input class="button2" type="submit" name="action[delete]" value="{L_DELETE_INDEX}" onclick="popup_progress_bar('delete');" />
|
||||
@@ -146,7 +142,7 @@
|
||||
</p>
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
|
||||
|
||||
</form>
|
||||
<!-- END backend -->
|
||||
|
||||
|
@@ -54,7 +54,7 @@
|
||||
// <![CDATA[
|
||||
function update_image(newimage)
|
||||
{
|
||||
document.getElementById('newimg').src = (newimage) ? '../styles/{A_PATH}/imageset/' + encodeURI(newimage) : 'images/no_image.png';
|
||||
document.getElementById('newimg').src = (newimage) ? '../styles/{A_NAME}/imageset/' + encodeURI(newimage) : 'images/no_image.png';
|
||||
}
|
||||
// ]]>
|
||||
</script>
|
||||
@@ -261,11 +261,11 @@
|
||||
<!-- ELSEIF S_CACHE -->
|
||||
|
||||
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">« {L_BACK}</a>
|
||||
|
||||
|
||||
<h1>{L_TEMPLATE_CACHE}</h1>
|
||||
|
||||
|
||||
<p>{L_TEMPLATE_CACHE_EXPLAIN}</p>
|
||||
|
||||
|
||||
<form name="acp_styles" method="post" action="{U_ACTION}">
|
||||
<fieldset class="tabulated">
|
||||
<legend>{L_TEMPLATE_CACHE}</legend>
|
||||
@@ -283,7 +283,7 @@
|
||||
<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="popup(this.href, 750, 550, '_source'); return false;">{file.FILENAME_PATH}</a></td>
|
||||
<td><a href="{file.U_VIEWSOURCE}" onclick="popup(this.href, 750, 550, '_source'); return false;">{file.FILENAME}</a></td>
|
||||
<td>{file.FILESIZE}</td>
|
||||
<td>{file.CACHED}</td>
|
||||
<td>{file.MODIFIED}</td>
|
||||
@@ -361,7 +361,7 @@
|
||||
</p>
|
||||
</fieldset>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
<!-- ELSEIF S_FRONTEND -->
|
||||
@@ -455,37 +455,31 @@
|
||||
<legend>{L_TITLE}</legend>
|
||||
<dl>
|
||||
<dt><label for="name">{L_NAME}:</label></dt>
|
||||
<dd><!-- IF S_INSTALL --><strong id="name">{NAME}</strong><!-- ELSE --><input type="text" id="name" name="name" value="{NAME}" /><!-- ENDIF --></dd>
|
||||
<dd><!-- IF S_INSTALL --><b id="name">{NAME}</b><!-- ELSE --><input type="text" id="name" name="name" value="{NAME}" /><!-- ENDIF --></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="copyright">{L_COPYRIGHT}:</label></dt>
|
||||
<dd><!-- IF S_INSTALL --><strong id="copyright">{COPYRIGHT}</strong><!-- ELSE --><input type="text" id="copyright" name="copyright" value="{COPYRIGHT}" /><!-- ENDIF --></dd>
|
||||
<dd><!-- IF S_INSTALL --><b id="copyright">{COPYRIGHT}</b><!-- ELSE --><input type="text" id="copyright" name="copyright" value="{COPYRIGHT}" /><!-- ENDIF --></dd>
|
||||
</dl>
|
||||
<!-- IF S_SUPERTEMPLATE -->
|
||||
<dl>
|
||||
<dt><label for="inheriting">{L_INHERITING_FROM}:</label></dt>
|
||||
<dd><strong id="inheriting">{S_SUPERTEMPLATE}</strong></dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF S_STYLE and not S_BASIS -->
|
||||
<dl>
|
||||
<dt><label for="template_id">{L_STYLE_TEMPLATE}:</label></dt>
|
||||
<dd><!-- IF S_INSTALL --><strong id="template_id">{TEMPLATE_NAME}</strong><!-- ELSE --><select id="template_id" name="template_id">{S_TEMPLATE_OPTIONS}</select><!-- ENDIF --></dd>
|
||||
<dd><!-- IF S_INSTALL --><b id="template_id">{TEMPLATE_NAME}</b><!-- ELSE --><select id="template_id" name="template_id">{S_TEMPLATE_OPTIONS}</select><!-- ENDIF --></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="theme_id">{L_STYLE_THEME}:</label></dt>
|
||||
<dd><!-- IF S_INSTALL --><strong id="theme_id">{THEME_NAME}</strong><!-- ELSE --><select id="theme_id" name="theme_id">{S_THEME_OPTIONS}</select><!-- ENDIF --></dd>
|
||||
<dd><!-- IF S_INSTALL --><b id="theme_id">{THEME_NAME}</b><!-- ELSE --><select id="theme_id" name="theme_id">{S_THEME_OPTIONS}</select><!-- ENDIF --></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="imageset_id">{L_STYLE_IMAGESET}:</label></dt>
|
||||
<dd><!-- IF S_INSTALL --><strong id="imageset_id">{IMAGESET_NAME}</strong><!-- ELSE --><select id="imageset_id" name="imageset_id">{S_IMAGESET_OPTIONS}</select><!-- ENDIF --></dd>
|
||||
<dd><!-- IF S_INSTALL --><b id="imageset_id">{IMAGESET_NAME}</b><!-- ELSE --><select id="imageset_id" name="imageset_id">{S_IMAGESET_OPTIONS}</select><!-- ENDIF --></dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF (S_TEMPLATE or S_THEME) and (S_LOCATION or not S_INSTALL) -->
|
||||
<!-- IF S_TEMPLATE or S_THEME -->
|
||||
<dl>
|
||||
<dt><label for="store_db">{L_LOCATION}:</label><br /><span><!-- IF S_STORE_DB_DISABLED -->{L_LOCATION_DISABLED_EXPLAIN}<!-- ELSE -->{L_LOCATION_EXPLAIN}<!-- ENDIF --></span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="store_db" value="0"<!-- IF not S_STORE_DB --> id="store_db" checked="checked"<!-- ENDIF --> <!-- IF S_STORE_DB_DISABLED -->disabled="disabled" <!-- ENDIF --> />{L_STORE_FILESYSTEM}</label>
|
||||
<label><input type="radio" class="radio" name="store_db" value="1"<!-- IF S_STORE_DB --> id="store_db" checked="checked"<!-- ENDIF --> <!-- IF S_STORE_DB_DISABLED -->disabled="disabled" <!-- ENDIF -->/> {L_STORE_DATABASE}</label></dd>
|
||||
<dt><label for="store_db">{L_LOCATION}:</label><br /><span>{L_LOCATION_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="store_db" value="0"<!-- IF not S_STORE_DB --> id="store_db" checked="checked"<!-- ENDIF --> /> {L_STORE_FILESYSTEM}</label>
|
||||
<label><input type="radio" class="radio" name="store_db" value="1"<!-- IF S_STORE_DB --> id="store_db" checked="checked"<!-- ENDIF --> /> {L_STORE_DATABASE}</label></dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF S_STYLE -->
|
||||
@@ -513,7 +507,7 @@
|
||||
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
@@ -197,7 +197,7 @@
|
||||
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
|
||||
<fieldset class="quick">
|
||||
<input class="button2" type="submit" name="delmarked" value="{L_DELETE_MARKED}" />
|
||||
<p class="small"><a href="#" onclick="marklist('user_attachments', 'mark', true);">{L_MARK_ALL}</a> • <a href="#" onclick="marklist('user_attachments', 'mark', false);">{L_UNMARK_ALL}</a></p>
|
||||
@@ -215,7 +215,7 @@
|
||||
<form id="select_forum" method="post" action="{U_ACTION}">
|
||||
|
||||
<fieldset class="quick" style="text-align: left;">
|
||||
{L_SELECT_FORUM}: <select name="f">{S_FORUM_OPTIONS}</select>
|
||||
{L_SELECT_FORUM}: <select name="f">{S_FORUM_OPTIONS}</select>
|
||||
<input class="button2" type="submit" value="{L_GO}" name="select" />
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
|
@@ -30,7 +30,7 @@
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label>{L_POSTS}:</label></dt>
|
||||
<dd><strong>{USER_POSTS}</strong><!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --> (<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>)<!-- ELSEIF POSTS_IN_QUEUE --> ({L_POSTS_IN_QUEUE})<!-- ENDIF --></dd>
|
||||
<dd><strong>{USER_POSTS}</strong></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label>{L_WARNINGS}:</label></dt>
|
||||
@@ -138,7 +138,7 @@
|
||||
</p>
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
@@ -1175,10 +1175,6 @@ input.disabled {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.notice {
|
||||
background-color: #62A5CC;
|
||||
}
|
||||
|
||||
/* Special cases for the error page */
|
||||
#errorpage #page-header a {
|
||||
font-weight: bold;
|
||||
@@ -1337,21 +1333,18 @@ fieldset.permissions .permissions-switch {
|
||||
fieldset.permissions .padding {
|
||||
}
|
||||
|
||||
.permissions-switch {
|
||||
margin-top: -6px;
|
||||
font-size: .9em;
|
||||
}
|
||||
|
||||
.permissions-switch a {
|
||||
text-decoration: underline;
|
||||
font-size: 0.90em;
|
||||
}
|
||||
|
||||
.permissions-reset {
|
||||
margin-top: -6px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.permissions-reset a {
|
||||
font-size: .85em;
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
/* Tabbed menu */
|
||||
|
@@ -63,7 +63,7 @@
|
||||
<p>{L_UPDATE_SUCCESS_EXPLAIN}</p>
|
||||
|
||||
<fieldset class="submit-buttons">
|
||||
<input class="button1" type="submit" name="check_again" value="{L_CONTINUE_UPDATE}" />
|
||||
<input class="button1" type="submit" name="check_again" value="{L_CHECK_FILES_AGAIN}" />
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
@@ -186,176 +186,100 @@
|
||||
<p>{L_NO_UPDATE_FILES_EXPLAIN}</p><br />
|
||||
|
||||
<strong>{NO_UPDATE_FILES}</strong>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<form id="install_update" method="post" action="{U_UPDATE_ACTION}">
|
||||
|
||||
<!-- IF .up_to_date -->
|
||||
<h2>{L_FILES_UP_TO_DATE}</h2>
|
||||
<p>{L_FILES_UP_TO_DATE_EXPLAIN}</p>
|
||||
|
||||
<fieldset>
|
||||
<legend><img src="{T_IMAGE_PATH}file_up_to_date.gif" alt="{L_STATUS_UP_TO_DATE}" /></legend>
|
||||
<!-- BEGIN up_to_date -->
|
||||
<dl>
|
||||
<dd class="full" style="text-align: left;"><strong>{up_to_date.FILENAME}</strong></dd>
|
||||
</dl>
|
||||
<!-- END up_to_date -->
|
||||
</fieldset>
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF .new -->
|
||||
<h2>{L_FILES_NEW}</h2>
|
||||
<p>{L_FILES_NEW_EXPLAIN}</p>
|
||||
|
||||
<fieldset>
|
||||
<legend><img src="{T_IMAGE_PATH}file_new.gif" alt="{L_STATUS_NEW}" /></legend>
|
||||
<!-- BEGIN new -->
|
||||
<dl>
|
||||
<dt style="width: 60%;"><strong><!-- IF new.DIR_PART -->{new.DIR_PART}<br /><!-- ENDIF -->{new.FILE_PART}</strong>
|
||||
<!-- IF new.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{new.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
|
||||
</dt>
|
||||
<dd style="margin-left: 60%;">
|
||||
<!-- IF not new.S_BINARY -->[ <a href="{new.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new.L_SHOW_DIFF}</a>
|
||||
<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
|
||||
</dd>
|
||||
<!-- IF new.S_CUSTOM -->
|
||||
<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{new.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
|
||||
<!-- ENDIF -->
|
||||
</dl>
|
||||
<!-- END new -->
|
||||
</fieldset>
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF .not_modified -->
|
||||
<h2>{L_FILES_NOT_MODIFIED}</h2>
|
||||
<div style="float: {S_CONTENT_FLOW_END};">» <a href="#" onclick="dE('not_modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
|
||||
<p>{L_FILES_NOT_MODIFIED_EXPLAIN}</p>
|
||||
|
||||
<fieldset id="not_modified" style="display: none;">
|
||||
<legend><img src="{T_IMAGE_PATH}file_not_modified.gif" alt="{L_STATUS_NOT_MODIFIED}" /></legend>
|
||||
<!-- BEGIN not_modified -->
|
||||
<dl>
|
||||
<dt style="width: 60%;"><strong><!-- IF not_modified.DIR_PART -->{not_modified.DIR_PART}<br /><!-- ENDIF -->{not_modified.FILE_PART}</strong>
|
||||
<!-- IF not_modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{not_modified.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
|
||||
</dt>
|
||||
<dd style="margin-left: 60%;"><!-- IF not not_modified.S_BINARY -->[ <a href="{not_modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{not_modified.L_SHOW_DIFF}</a> ]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
|
||||
<!-- IF not_modified.S_CUSTOM -->
|
||||
<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{not_modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
|
||||
<!-- IF .files -->
|
||||
<!-- BEGIN files -->
|
||||
<!-- IF files.S_STATUS -->
|
||||
<!-- IF not files.S_FIRST_ROW -->
|
||||
</fieldset></div>
|
||||
<!-- ENDIF -->
|
||||
</dl>
|
||||
<!-- END not_modified -->
|
||||
</fieldset>
|
||||
|
||||
<!-- ENDIF -->
|
||||
<h2>{files.TITLE}</h2>
|
||||
|
||||
<!-- IF .modified -->
|
||||
<h2>{L_FILES_MODIFIED}</h2>
|
||||
<p>{L_FILES_MODIFIED_EXPLAIN}</p>
|
||||
<!-- IF files.STATUS eq 'not_modified' --><div style="float: {S_CONTENT_FLOW_END};">» <a href="#" onclick="dE('not_modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div><!-- ENDIF -->
|
||||
<p>{files.EXPLAIN}</p>
|
||||
|
||||
<!-- BEGIN modified -->
|
||||
<fieldset>
|
||||
<legend><img src="{T_IMAGE_PATH}file_modified.gif" alt="{L_STATUS_MODIFIED}" /></legend>
|
||||
<dl>
|
||||
<dt style="width: 60%;"><strong><!-- IF modified.DIR_PART -->{modified.DIR_PART}<br /><!-- ENDIF -->{modified.FILE_PART}</strong>
|
||||
<!-- IF modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{modified.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
|
||||
</dt>
|
||||
<dd style="margin-left: 60%;"> </dd>
|
||||
<!-- IF modified.S_CUSTOM -->
|
||||
<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
|
||||
<!-- ENDIF -->
|
||||
</dl>
|
||||
<dl>
|
||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="0" checked="checked" /> {L_MERGE_MODIFICATIONS_OPTION}</label></dt>
|
||||
<dd style="margin-left: 60%;"><!-- IF not modified.S_BINARY -->[ <a href="{modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{modified.L_SHOW_DIFF}</a> ]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
|
||||
<dd style="margin-left: 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE --> <!-- ENDIF --></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt>
|
||||
<dd style="margin-left: 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE --> <!-- ENDIF --></dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
<!-- END modified -->
|
||||
<div style="display: <!-- IF files.STATUS neq 'not_modified' -->block<!-- ELSE -->none<!-- ENDIF -->;" id="{files.STATUS}">
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF .new_conflict -->
|
||||
<h2>{L_FILES_NEW_CONFLICT}</h2>
|
||||
<p>{L_FILES_NEW_CONFLICT_EXPLAIN}</p>
|
||||
|
||||
<fieldset>
|
||||
<legend><img src="{T_IMAGE_PATH}file_new_conflict.gif" alt="{L_STATUS_NEW_CONFLICT}" /></legend>
|
||||
<!-- BEGIN new_conflict -->
|
||||
<dl>
|
||||
<dt style="width: 60%;"><strong><!-- IF new_conflict.DIR_PART -->{new_conflict.DIR_PART}<br /><!-- ENDIF -->{new_conflict.FILE_PART}</strong>
|
||||
<!-- IF new_conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{new_conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
|
||||
</dt>
|
||||
<dd style="margin-left: 60%;">
|
||||
<!-- IF not new_conflict.S_BINARY -->[ <a href="{new_conflict.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new_conflict.L_SHOW_DIFF}</a>
|
||||
<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
|
||||
</dd>
|
||||
<!-- IF new_conflict.S_CUSTOM -->
|
||||
<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{new_conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
|
||||
<!-- ENDIF -->
|
||||
</dl>
|
||||
<!-- END new_conflict -->
|
||||
</fieldset>
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF .conflict -->
|
||||
<h2>{L_FILES_CONFLICT}</h2>
|
||||
<p>{L_FILES_CONFLICT_EXPLAIN}</p>
|
||||
|
||||
<!-- BEGIN conflict -->
|
||||
<fieldset>
|
||||
<legend><img src="{T_IMAGE_PATH}file_conflict.gif" alt="{L_STATUS_CONFLICT}" /></legend>
|
||||
<dl>
|
||||
<dt style="width: 60%;"><strong><!-- IF conflict.DIR_PART -->{conflict.DIR_PART}<br /><!-- ENDIF -->{conflict.FILE_PART}</strong>
|
||||
<!-- IF conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
|
||||
<!-- IF conflict.NUM_CONFLICTS --><br /><span>{L_NUM_CONFLICTS}: {conflict.NUM_CONFLICTS}</span><!-- ENDIF -->
|
||||
</dt>
|
||||
<dd style="margin-left: 60%;">
|
||||
<!-- IF not conflict.S_BINARY -->[ <a href="{conflict.U_SHOW_DIFF}">{L_DOWNLOAD_CONFLICTS}</a> ]<br />{L_DOWNLOAD_CONFLICTS_EXPLAIN}
|
||||
<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
|
||||
</dd>
|
||||
<!-- IF conflict.S_CUSTOM -->
|
||||
<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
|
||||
<!-- ENDIF -->
|
||||
</dl>
|
||||
<!-- IF conflict.S_BINARY -->
|
||||
<dl>
|
||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" checked="checked" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
|
||||
<dd style="margin-left: 60%;"> </dd>
|
||||
</dl>
|
||||
<fieldset>
|
||||
<legend><img src="{T_IMAGE_PATH}file_{files.STATUS}.gif" alt="{files.L_STATUS}" /></legend>
|
||||
<!-- ELSE -->
|
||||
<dl>
|
||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="3" checked="checked" /> {L_MERGE_NEW_FILE_OPTION}</label></dt>
|
||||
<dd style="margin-left: 60%;">[<a href="{conflict.U_VIEW_NEW_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="4" /> {L_MERGE_MOD_FILE_OPTION}</label></dt>
|
||||
<dd style="margin-left: 60%;">[<a href="{conflict.U_VIEW_MOD_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
|
||||
<dd style="margin-left: 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt>
|
||||
<dd style="margin-left: 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
</fieldset>
|
||||
<!-- END conflict -->
|
||||
<!-- IF files.STATUS eq 'up_to_date' -->
|
||||
<dd class="full" style="text-align: left;"><strong>{files.FILENAME}</strong></dd>
|
||||
<!-- ELSE -->
|
||||
<dt style="width: 60%;">
|
||||
<strong><!-- IF files.DIR_PART -->{files.DIR_PART}<br /><!-- ENDIF -->{files.FILE_PART}</strong>
|
||||
<!-- IF files.S_CUSTOM -->
|
||||
<br /><span><em>{L_FILE_USED}: </em>{files.CUSTOM_ORIGINAL}</span>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF files.NUM_CONFLICTS -->
|
||||
<br /><span>{L_NUM_CONFLICTS}: {files.NUM_CONFLICTS}</span>
|
||||
<!-- ENDIF -->
|
||||
</dt>
|
||||
<dd style="margin-left: 60%;"><!-- IF files.STATUS eq 'modified' --> <!-- ELSE --><!-- IF not files.S_BINARY -->[ <a href="{files.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{files.L_SHOW_DIFF}</a> ]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --><!-- ENDIF --></dd>
|
||||
<!-- IF files.S_CUSTOM -->
|
||||
<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{files.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF files.STATUS eq 'modified' -->
|
||||
</dl>
|
||||
<dl>
|
||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{files.FILENAME}]" value="0" checked="checked" /> {L_MERGE_MODIFICATIONS_OPTION}</label></dt>
|
||||
<dd style="margin-left: 60%;"><!-- IF not files.S_BINARY -->[ <a href="{files.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{files.L_SHOW_DIFF}</a> ]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{files.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
|
||||
<dd style="margin-left: 60%;"><!-- IF not files.S_BINARY -->[<a href="{files.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE --> <!-- ENDIF --></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{files.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt>
|
||||
<dd style="margin-left: 60%;"><!-- IF not files.S_BINARY -->[<a href="{files.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE --> <!-- ENDIF --></dd>
|
||||
</dl>
|
||||
<!-- IF not files.S_LAST_ROW -->
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><img src="{T_IMAGE_PATH}file_{files.STATUS}.gif" alt="{files.L_STATUS}" /></legend>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF files.STATUS eq 'conflict' -->
|
||||
</dl>
|
||||
<dl>
|
||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{files.FILENAME}]" value="1" checked="checked" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
|
||||
<dd style="margin-left: 60%;"><!-- IF not files.S_BINARY -->[<a href="{files.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE --> <!-- ENDIF --></dd>
|
||||
</dl>
|
||||
<!-- IF not files.S_BINARY -->
|
||||
<dl>
|
||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{files.FILENAME}]" value="3" /> {L_MERGE_NEW_FILE_OPTION}</label></dt>
|
||||
<dd style="margin-left: 60%;">[<a href="{files.U_VIEW_NEW_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{files.FILENAME}]" value="4" /> {L_MERGE_MOD_FILE_OPTION}</label></dt>
|
||||
<dd style="margin-left: 60%;">[<a href="{files.U_VIEW_MOD_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF not files.S_LAST_ROW -->
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><img src="{T_IMAGE_PATH}file_{files.STATUS}.gif" alt="{files.L_STATUS}" /></legend>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
<!-- IF files.STATUS neq 'conflict' and files.STATUS neq 'modified' --></dl><!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
<!-- END files -->
|
||||
|
||||
</fieldset></div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<br />
|
||||
@@ -371,7 +295,7 @@
|
||||
<p>{L_UPDATE_METHOD_EXPLAIN}</p>
|
||||
|
||||
<fieldset class="submit-buttons">
|
||||
<input class="button1" type="submit" name="ftp_upload" value="{L_FTP_UPDATE_METHOD}" /> <input class="button1" type="submit" name="download" value="{L_DOWNLOAD_UPDATE_METHOD_BUTTON}" />
|
||||
<input class="button1" type="submit" name="ftp_upload" value="{L_FTP_UPDATE_METHOD}" /> <input class="button1" type="submit" name="download" value="{L_DOWNLOAD_UPDATE_METHOD}" />
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
@@ -436,14 +360,6 @@
|
||||
<p>{L_CONNECTION_SUCCESS}</p>
|
||||
</div>
|
||||
<!-- ELSEIF S_CONNECTION_FAILED -->
|
||||
<div class="successbox">
|
||||
<p>{L_TRY_DOWNLOAD_METHOD}</p>
|
||||
|
||||
<fieldset class="quick">
|
||||
<input class="button1" type="submit" name="download" value="{L_TRY_DOWNLOAD_METHOD_BUTTON}" />
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="errorbox">
|
||||
<p>{L_CONNECTION_FAILED}<br />{ERROR_MSG}</p>
|
||||
</div>
|
||||
|
@@ -28,16 +28,9 @@ function jumpto()
|
||||
{
|
||||
var page = prompt(jump_page, on_page);
|
||||
|
||||
if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
|
||||
if (page !== null && !isNaN(page) && page > 0)
|
||||
{
|
||||
if (base_url.indexOf('?') == -1)
|
||||
{
|
||||
document.location.href = base_url + '?start=' + ((page - 1) * per_page);
|
||||
}
|
||||
else
|
||||
{
|
||||
document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
|
||||
}
|
||||
document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,7 +185,7 @@ function switch_menu()
|
||||
<a id="toggle-handle" accesskey="m" title="{L_MENU_TOGGLE}" onclick="switch_menu(); return false;" href="#"></a></div>
|
||||
<!-- ENDIF -->
|
||||
<div id="menu">
|
||||
<p>{L_LOGGED_IN_AS}<br /><strong>{USERNAME}</strong> [ <a href="{U_LOGOUT}">{L_LOGOUT}</a> ][ <a href="{U_ADM_LOGOUT}">{L_ADM_LOGOUT}</a> ] </p>
|
||||
<p>{L_LOGGED_IN_AS}<br /><strong>{USERNAME}</strong> [ <a href="{U_LOGOUT}">{L_LOGOUT}</a> ][ <a href="{U_ADM_LOGOUT}">{L_ADM_LOGOUT}</a> ]</p>
|
||||
<ul>
|
||||
<!-- BEGIN l_block1 -->
|
||||
<!-- IF l_block1.S_SELECTED -->
|
||||
|
@@ -68,7 +68,7 @@
|
||||
<!-- ELSE -->
|
||||
<li class="permissions-preset-custom<!-- IF p_mask.S_FIRST_ROW and p_mask.f_mask.S_FIRST_ROW and p_mask.f_mask.category.S_FIRST_ROW --> activetab<!-- ENDIF -->" id="tab{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}">
|
||||
<!-- ENDIF -->
|
||||
<a href="#" onclick="swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '{p_mask.f_mask.category.S_ROW_COUNT}', false<!-- IF p_mask.S_VIEW -->, true<!-- ENDIF -->); return false;"><span class="tabbg"><span class="colour"></span>{p_mask.f_mask.category.CAT_NAME}</span></a></li>
|
||||
<a href="#" onclick="swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '{p_mask.f_mask.category.S_ROW_COUNT}', false<!-- IF p_mask.S_VIEW -->, true<!-- ENDIF -->); return false;"><span class="tabbg"><span class="colour"></span>{category.CAT_NAME}</span></a></li>
|
||||
<!-- END category -->
|
||||
</ul>
|
||||
</div>
|
||||
|
@@ -39,16 +39,9 @@ function jumpto()
|
||||
{
|
||||
var page = prompt(jump_page, on_page);
|
||||
|
||||
if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
|
||||
if (page !== null && !isNaN(page) && page > 0)
|
||||
{
|
||||
if (base_url.indexOf('?') == -1)
|
||||
{
|
||||
document.location.href = base_url + '?start=' + ((page - 1) * per_page);
|
||||
}
|
||||
else
|
||||
{
|
||||
document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
|
||||
}
|
||||
document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -103,7 +103,7 @@ if (version_compare(PHP_VERSION, '6.0.0-dev', '>='))
|
||||
}
|
||||
else
|
||||
{
|
||||
@set_magic_quotes_runtime(0);
|
||||
set_magic_quotes_runtime(0);
|
||||
|
||||
// Be paranoid with passed vars
|
||||
if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on' || !function_exists('ini_get'))
|
||||
|
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
DIR=$(dirname "$0")/../cache;
|
||||
cat "$DIR/sql_*.php" | grep '/* SELECT' | sed 's,/\* ,,;s, \*/,,' | sort
|
@@ -674,7 +674,7 @@ foreach ($supported_dbms as $dbms)
|
||||
}
|
||||
|
||||
$line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : '';
|
||||
|
||||
|
||||
$line .= " {$table_name}_{$key_name} ON {$table_name} (" . implode(', ', $key_data[1]) . ")\n";
|
||||
$line .= "/\n";
|
||||
break;
|
||||
@@ -855,7 +855,7 @@ function get_schema_struct()
|
||||
),
|
||||
'PRIMARY_KEY' => 'auth_option_id',
|
||||
'KEYS' => array(
|
||||
'auth_option' => array('UNIQUE', 'auth_option'),
|
||||
'auth_option' => array('INDEX', 'auth_option'),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1005,7 +1005,7 @@ function get_schema_struct()
|
||||
'topic_id' => array('UINT', 0),
|
||||
'forum_id' => array('UINT', 0),
|
||||
'save_time' => array('TIMESTAMP', 0),
|
||||
'draft_subject' => array('STEXT_UNI', ''),
|
||||
'draft_subject' => array('XSTEXT_UNI', ''),
|
||||
'draft_message' => array('MTEXT_UNI', ''),
|
||||
),
|
||||
'PRIMARY_KEY' => 'draft_id',
|
||||
@@ -1052,7 +1052,7 @@ function get_schema_struct()
|
||||
'forum_desc_uid' => array('VCHAR:8', ''),
|
||||
'forum_link' => array('VCHAR_UNI', ''),
|
||||
'forum_password' => array('VCHAR_UNI:40', ''),
|
||||
'forum_style' => array('UINT', 0),
|
||||
'forum_style' => array('USINT', 0),
|
||||
'forum_image' => array('VCHAR', ''),
|
||||
'forum_rules' => array('TEXT_UNI', ''),
|
||||
'forum_rules_link' => array('VCHAR_UNI', ''),
|
||||
@@ -1067,7 +1067,7 @@ function get_schema_struct()
|
||||
'forum_topics_real' => array('UINT', 0),
|
||||
'forum_last_post_id' => array('UINT', 0),
|
||||
'forum_last_poster_id' => array('UINT', 0),
|
||||
'forum_last_post_subject' => array('STEXT_UNI', ''),
|
||||
'forum_last_post_subject' => array('XSTEXT_UNI', ''),
|
||||
'forum_last_post_time' => array('TIMESTAMP', 0),
|
||||
'forum_last_poster_name'=> array('VCHAR_UNI', ''),
|
||||
'forum_last_poster_colour'=> array('VCHAR:6', ''),
|
||||
@@ -1140,7 +1140,6 @@ function get_schema_struct()
|
||||
'group_sig_chars' => array('UINT', 0),
|
||||
'group_receive_pm' => array('BOOL', 0),
|
||||
'group_message_limit' => array('UINT', 0),
|
||||
'group_max_recipients' => array('UINT', 0),
|
||||
'group_legend' => array('BOOL', 1),
|
||||
),
|
||||
'PRIMARY_KEY' => 'group_id',
|
||||
@@ -1282,7 +1281,7 @@ function get_schema_struct()
|
||||
'enable_magic_url' => array('BOOL', 1),
|
||||
'enable_sig' => array('BOOL', 1),
|
||||
'post_username' => array('VCHAR_UNI:255', ''),
|
||||
'post_subject' => array('STEXT_UNI', '', 'true_sort'),
|
||||
'post_subject' => array('XSTEXT_UNI', '', 'true_sort'),
|
||||
'post_text' => array('MTEXT_UNI', ''),
|
||||
'post_checksum' => array('VCHAR:32', ''),
|
||||
'post_attachment' => array('BOOL', 0),
|
||||
@@ -1318,7 +1317,7 @@ function get_schema_struct()
|
||||
'enable_smilies' => array('BOOL', 1),
|
||||
'enable_magic_url' => array('BOOL', 1),
|
||||
'enable_sig' => array('BOOL', 1),
|
||||
'message_subject' => array('STEXT_UNI', ''),
|
||||
'message_subject' => array('XSTEXT_UNI', ''),
|
||||
'message_text' => array('MTEXT_UNI', ''),
|
||||
'message_edit_reason' => array('STEXT_UNI', ''),
|
||||
'message_edit_user' => array('UINT', 0),
|
||||
@@ -1404,7 +1403,6 @@ function get_schema_struct()
|
||||
'field_validation' => array('VCHAR_UNI:20', ''),
|
||||
'field_required' => array('BOOL', 0),
|
||||
'field_show_on_reg' => array('BOOL', 0),
|
||||
'field_show_profile' => array('BOOL', 0),
|
||||
'field_hide' => array('BOOL', 0),
|
||||
'field_no_view' => array('BOOL', 0),
|
||||
'field_active' => array('BOOL', 0),
|
||||
@@ -1538,7 +1536,7 @@ function get_schema_struct()
|
||||
'KEYS' => array(
|
||||
'session_time' => array('INDEX', 'session_time'),
|
||||
'session_user_id' => array('INDEX', 'session_user_id'),
|
||||
'session_fid' => array('INDEX', 'session_forum_id'),
|
||||
'session_forum_id' => array('INDEX', 'session_forum_id'),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1585,13 +1583,13 @@ function get_schema_struct()
|
||||
|
||||
$schema_data['phpbb_styles'] = array(
|
||||
'COLUMNS' => array(
|
||||
'style_id' => array('UINT', NULL, 'auto_increment'),
|
||||
'style_id' => array('USINT', NULL, 'auto_increment'),
|
||||
'style_name' => array('VCHAR_UNI:255', ''),
|
||||
'style_copyright' => array('VCHAR_UNI', ''),
|
||||
'style_active' => array('BOOL', 1),
|
||||
'template_id' => array('UINT', 0),
|
||||
'theme_id' => array('UINT', 0),
|
||||
'imageset_id' => array('UINT', 0),
|
||||
'template_id' => array('USINT', 0),
|
||||
'theme_id' => array('USINT', 0),
|
||||
'imageset_id' => array('USINT', 0),
|
||||
),
|
||||
'PRIMARY_KEY' => 'style_id',
|
||||
'KEYS' => array(
|
||||
@@ -1604,14 +1602,12 @@ function get_schema_struct()
|
||||
|
||||
$schema_data['phpbb_styles_template'] = array(
|
||||
'COLUMNS' => array(
|
||||
'template_id' => array('UINT', NULL, 'auto_increment'),
|
||||
'template_id' => array('USINT', NULL, 'auto_increment'),
|
||||
'template_name' => array('VCHAR_UNI:255', ''),
|
||||
'template_copyright' => array('VCHAR_UNI', ''),
|
||||
'template_path' => array('VCHAR:100', ''),
|
||||
'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
|
||||
'template_storedb' => array('BOOL', 0),
|
||||
'template_inherits_id' => array('UINT:4', 0),
|
||||
'template_inherit_path' => array('VCHAR', ''),
|
||||
),
|
||||
'PRIMARY_KEY' => 'template_id',
|
||||
'KEYS' => array(
|
||||
@@ -1621,7 +1617,7 @@ function get_schema_struct()
|
||||
|
||||
$schema_data['phpbb_styles_template_data'] = array(
|
||||
'COLUMNS' => array(
|
||||
'template_id' => array('UINT', 0),
|
||||
'template_id' => array('USINT', 0),
|
||||
'template_filename' => array('VCHAR:100', ''),
|
||||
'template_included' => array('TEXT', ''),
|
||||
'template_mtime' => array('TIMESTAMP', 0),
|
||||
@@ -1635,7 +1631,7 @@ function get_schema_struct()
|
||||
|
||||
$schema_data['phpbb_styles_theme'] = array(
|
||||
'COLUMNS' => array(
|
||||
'theme_id' => array('UINT', NULL, 'auto_increment'),
|
||||
'theme_id' => array('USINT', NULL, 'auto_increment'),
|
||||
'theme_name' => array('VCHAR_UNI:255', ''),
|
||||
'theme_copyright' => array('VCHAR_UNI', ''),
|
||||
'theme_path' => array('VCHAR:100', ''),
|
||||
@@ -1651,7 +1647,7 @@ function get_schema_struct()
|
||||
|
||||
$schema_data['phpbb_styles_imageset'] = array(
|
||||
'COLUMNS' => array(
|
||||
'imageset_id' => array('UINT', NULL, 'auto_increment'),
|
||||
'imageset_id' => array('USINT', NULL, 'auto_increment'),
|
||||
'imageset_name' => array('VCHAR_UNI:255', ''),
|
||||
'imageset_copyright' => array('VCHAR_UNI', ''),
|
||||
'imageset_path' => array('VCHAR:100', ''),
|
||||
@@ -1664,13 +1660,13 @@ function get_schema_struct()
|
||||
|
||||
$schema_data['phpbb_styles_imageset_data'] = array(
|
||||
'COLUMNS' => array(
|
||||
'image_id' => array('UINT', NULL, 'auto_increment'),
|
||||
'image_id' => array('USINT', NULL, 'auto_increment'),
|
||||
'image_name' => array('VCHAR:200', ''),
|
||||
'image_filename' => array('VCHAR:200', ''),
|
||||
'image_lang' => array('VCHAR:30', ''),
|
||||
'image_height' => array('USINT', 0),
|
||||
'image_width' => array('USINT', 0),
|
||||
'imageset_id' => array('UINT', 0),
|
||||
'imageset_id' => array('USINT', 0),
|
||||
),
|
||||
'PRIMARY_KEY' => 'image_id',
|
||||
'KEYS' => array(
|
||||
@@ -1686,7 +1682,7 @@ function get_schema_struct()
|
||||
'topic_attachment' => array('BOOL', 0),
|
||||
'topic_approved' => array('BOOL', 1),
|
||||
'topic_reported' => array('BOOL', 0),
|
||||
'topic_title' => array('STEXT_UNI', '', 'true_sort'),
|
||||
'topic_title' => array('XSTEXT_UNI', '', 'true_sort'),
|
||||
'topic_poster' => array('UINT', 0),
|
||||
'topic_time' => array('TIMESTAMP', 0),
|
||||
'topic_time_limit' => array('TIMESTAMP', 0),
|
||||
@@ -1702,7 +1698,7 @@ function get_schema_struct()
|
||||
'topic_last_poster_id' => array('UINT', 0),
|
||||
'topic_last_poster_name' => array('VCHAR_UNI', ''),
|
||||
'topic_last_poster_colour' => array('VCHAR:6', ''),
|
||||
'topic_last_post_subject' => array('STEXT_UNI', ''),
|
||||
'topic_last_post_subject' => array('XSTEXT_UNI', ''),
|
||||
'topic_last_post_time' => array('TIMESTAMP', 0),
|
||||
'topic_last_view_time' => array('TIMESTAMP', 0),
|
||||
'topic_moved_id' => array('UINT', 0),
|
||||
@@ -1808,7 +1804,7 @@ function get_schema_struct()
|
||||
'user_timezone' => array('DECIMAL', 0),
|
||||
'user_dst' => array('BOOL', 0),
|
||||
'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'),
|
||||
'user_style' => array('UINT', 0),
|
||||
'user_style' => array('USINT', 0),
|
||||
'user_rank' => array('UINT', 0),
|
||||
'user_colour' => array('VCHAR:6', ''),
|
||||
'user_new_privmsg' => array('INT:4', 0),
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
/**
|
||||
*
|
||||
* @package phpBB3
|
||||
* @version $Id$
|
||||
* @copyright (c) 2006 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
* @copyright (c) 2006 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
* This file creates SQL statements to upgrade phpBB on MySQL 3.x/4.0.x to 4.1.x/5.x
|
||||
*
|
||||
@@ -127,7 +127,7 @@ foreach ($schema_data as $table_name => $table_data)
|
||||
$line = "ALTER TABLE {$table_name} $newline";
|
||||
|
||||
// Table specific so we don't get overlap
|
||||
$modded_array = array();
|
||||
$modded_array = array();
|
||||
|
||||
// Write columns one by one...
|
||||
foreach ($table_data['COLUMNS'] as $column_name => $column_data)
|
||||
@@ -327,7 +327,7 @@ function get_schema_struct()
|
||||
),
|
||||
'PRIMARY_KEY' => 'auth_option_id',
|
||||
'KEYS' => array(
|
||||
'auth_option' => array('UNIQUE', 'auth_option'),
|
||||
'auth_option' => array('INDEX', 'auth_option'),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -477,7 +477,7 @@ function get_schema_struct()
|
||||
'topic_id' => array('UINT', 0),
|
||||
'forum_id' => array('UINT', 0),
|
||||
'save_time' => array('TIMESTAMP', 0),
|
||||
'draft_subject' => array('STEXT_UNI', ''),
|
||||
'draft_subject' => array('XSTEXT_UNI', ''),
|
||||
'draft_message' => array('MTEXT_UNI', ''),
|
||||
),
|
||||
'PRIMARY_KEY' => 'draft_id',
|
||||
@@ -524,7 +524,7 @@ function get_schema_struct()
|
||||
'forum_desc_uid' => array('VCHAR:8', ''),
|
||||
'forum_link' => array('VCHAR_UNI', ''),
|
||||
'forum_password' => array('VCHAR_UNI:40', ''),
|
||||
'forum_style' => array('UINT', 0),
|
||||
'forum_style' => array('USINT', 0),
|
||||
'forum_image' => array('VCHAR', ''),
|
||||
'forum_rules' => array('TEXT_UNI', ''),
|
||||
'forum_rules_link' => array('VCHAR_UNI', ''),
|
||||
@@ -539,12 +539,11 @@ function get_schema_struct()
|
||||
'forum_topics_real' => array('UINT', 0),
|
||||
'forum_last_post_id' => array('UINT', 0),
|
||||
'forum_last_poster_id' => array('UINT', 0),
|
||||
'forum_last_post_subject' => array('STEXT_UNI', ''),
|
||||
'forum_last_post_subject' => array('XSTEXT_UNI', ''),
|
||||
'forum_last_post_time' => array('TIMESTAMP', 0),
|
||||
'forum_last_poster_name'=> array('VCHAR_UNI', ''),
|
||||
'forum_last_poster_colour'=> array('VCHAR:6', ''),
|
||||
'forum_flags' => array('TINT:4', 32),
|
||||
'display_subforum_list' => array('BOOL', 1),
|
||||
'display_on_index' => array('BOOL', 1),
|
||||
'enable_indexing' => array('BOOL', 1),
|
||||
'enable_icons' => array('BOOL', 1),
|
||||
@@ -612,12 +611,11 @@ function get_schema_struct()
|
||||
'group_sig_chars' => array('UINT', 0),
|
||||
'group_receive_pm' => array('BOOL', 0),
|
||||
'group_message_limit' => array('UINT', 0),
|
||||
'group_max_recipients' => array('UINT', 0),
|
||||
'group_legend' => array('BOOL', 1),
|
||||
),
|
||||
'PRIMARY_KEY' => 'group_id',
|
||||
'KEYS' => array(
|
||||
'group_legend_name' => array('INDEX', array('group_legend', 'group_name')),
|
||||
'group_legend' => array('INDEX', 'group_legend'),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -754,8 +752,8 @@ function get_schema_struct()
|
||||
'enable_magic_url' => array('BOOL', 1),
|
||||
'enable_sig' => array('BOOL', 1),
|
||||
'post_username' => array('VCHAR_UNI:255', ''),
|
||||
'post_subject' => array('STEXT_UNI', '', 'true_sort'),
|
||||
'post_text' => array('MTEXT_UNI', ''),
|
||||
'post_subject' => array('XSTEXT_UNI', '', 'true_sort'),
|
||||
'post_text' => array('MTEXT_UNI', '', ($GLOBALS['mysql_indexer']) ? 'true_sort' : 'no_sort'),
|
||||
'post_checksum' => array('VCHAR:32', ''),
|
||||
'post_attachment' => array('BOOL', 0),
|
||||
'bbcode_bitfield' => array('VCHAR:255', ''),
|
||||
@@ -790,7 +788,7 @@ function get_schema_struct()
|
||||
'enable_smilies' => array('BOOL', 1),
|
||||
'enable_magic_url' => array('BOOL', 1),
|
||||
'enable_sig' => array('BOOL', 1),
|
||||
'message_subject' => array('STEXT_UNI', ''),
|
||||
'message_subject' => array('XSTEXT_UNI', ''),
|
||||
'message_text' => array('MTEXT_UNI', ''),
|
||||
'message_edit_reason' => array('STEXT_UNI', ''),
|
||||
'message_edit_user' => array('UINT', 0),
|
||||
@@ -876,7 +874,6 @@ function get_schema_struct()
|
||||
'field_validation' => array('VCHAR_UNI:20', ''),
|
||||
'field_required' => array('BOOL', 0),
|
||||
'field_show_on_reg' => array('BOOL', 0),
|
||||
'field_show_profile' => array('BOOL', 0),
|
||||
'field_hide' => array('BOOL', 0),
|
||||
'field_no_view' => array('BOOL', 0),
|
||||
'field_active' => array('BOOL', 0),
|
||||
@@ -994,7 +991,6 @@ function get_schema_struct()
|
||||
'COLUMNS' => array(
|
||||
'session_id' => array('CHAR:32', ''),
|
||||
'session_user_id' => array('UINT', 0),
|
||||
'session_forum_id' => array('UINT', 0),
|
||||
'session_last_visit' => array('TIMESTAMP', 0),
|
||||
'session_start' => array('TIMESTAMP', 0),
|
||||
'session_time' => array('TIMESTAMP', 0),
|
||||
@@ -1010,7 +1006,6 @@ function get_schema_struct()
|
||||
'KEYS' => array(
|
||||
'session_time' => array('INDEX', 'session_time'),
|
||||
'session_user_id' => array('INDEX', 'session_user_id'),
|
||||
'session_fid' => array('INDEX', 'session_forum_id'),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1057,13 +1052,13 @@ function get_schema_struct()
|
||||
|
||||
$schema_data['phpbb_styles'] = array(
|
||||
'COLUMNS' => array(
|
||||
'style_id' => array('UINT', NULL, 'auto_increment'),
|
||||
'style_id' => array('USINT', NULL, 'auto_increment'),
|
||||
'style_name' => array('VCHAR_UNI:255', ''),
|
||||
'style_copyright' => array('VCHAR_UNI', ''),
|
||||
'style_active' => array('BOOL', 1),
|
||||
'template_id' => array('UINT', 0),
|
||||
'theme_id' => array('UINT', 0),
|
||||
'imageset_id' => array('UINT', 0),
|
||||
'template_id' => array('USINT', 0),
|
||||
'theme_id' => array('USINT', 0),
|
||||
'imageset_id' => array('USINT', 0),
|
||||
),
|
||||
'PRIMARY_KEY' => 'style_id',
|
||||
'KEYS' => array(
|
||||
@@ -1076,14 +1071,12 @@ function get_schema_struct()
|
||||
|
||||
$schema_data['phpbb_styles_template'] = array(
|
||||
'COLUMNS' => array(
|
||||
'template_id' => array('UINT', NULL, 'auto_increment'),
|
||||
'template_id' => array('USINT', NULL, 'auto_increment'),
|
||||
'template_name' => array('VCHAR_UNI:255', ''),
|
||||
'template_copyright' => array('VCHAR_UNI', ''),
|
||||
'template_path' => array('VCHAR:100', ''),
|
||||
'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
|
||||
'template_storedb' => array('BOOL', 0),
|
||||
'template_inherits_id' => array('UINT:4', 0),
|
||||
'template_inherit_path' => array('VCHAR', ''),
|
||||
),
|
||||
'PRIMARY_KEY' => 'template_id',
|
||||
'KEYS' => array(
|
||||
@@ -1093,7 +1086,7 @@ function get_schema_struct()
|
||||
|
||||
$schema_data['phpbb_styles_template_data'] = array(
|
||||
'COLUMNS' => array(
|
||||
'template_id' => array('UINT', 0),
|
||||
'template_id' => array('USINT', 0),
|
||||
'template_filename' => array('VCHAR:100', ''),
|
||||
'template_included' => array('TEXT', ''),
|
||||
'template_mtime' => array('TIMESTAMP', 0),
|
||||
@@ -1107,7 +1100,7 @@ function get_schema_struct()
|
||||
|
||||
$schema_data['phpbb_styles_theme'] = array(
|
||||
'COLUMNS' => array(
|
||||
'theme_id' => array('UINT', NULL, 'auto_increment'),
|
||||
'theme_id' => array('USINT', NULL, 'auto_increment'),
|
||||
'theme_name' => array('VCHAR_UNI:255', ''),
|
||||
'theme_copyright' => array('VCHAR_UNI', ''),
|
||||
'theme_path' => array('VCHAR:100', ''),
|
||||
@@ -1123,7 +1116,7 @@ function get_schema_struct()
|
||||
|
||||
$schema_data['phpbb_styles_imageset'] = array(
|
||||
'COLUMNS' => array(
|
||||
'imageset_id' => array('UINT', NULL, 'auto_increment'),
|
||||
'imageset_id' => array('USINT', NULL, 'auto_increment'),
|
||||
'imageset_name' => array('VCHAR_UNI:255', ''),
|
||||
'imageset_copyright' => array('VCHAR_UNI', ''),
|
||||
'imageset_path' => array('VCHAR:100', ''),
|
||||
@@ -1136,13 +1129,13 @@ function get_schema_struct()
|
||||
|
||||
$schema_data['phpbb_styles_imageset_data'] = array(
|
||||
'COLUMNS' => array(
|
||||
'image_id' => array('UINT', NULL, 'auto_increment'),
|
||||
'image_id' => array('USINT', NULL, 'auto_increment'),
|
||||
'image_name' => array('VCHAR:200', ''),
|
||||
'image_filename' => array('VCHAR:200', ''),
|
||||
'image_lang' => array('VCHAR:30', ''),
|
||||
'image_height' => array('USINT', 0),
|
||||
'image_width' => array('USINT', 0),
|
||||
'imageset_id' => array('UINT', 0),
|
||||
'imageset_id' => array('USINT', 0),
|
||||
),
|
||||
'PRIMARY_KEY' => 'image_id',
|
||||
'KEYS' => array(
|
||||
@@ -1158,7 +1151,7 @@ function get_schema_struct()
|
||||
'topic_attachment' => array('BOOL', 0),
|
||||
'topic_approved' => array('BOOL', 1),
|
||||
'topic_reported' => array('BOOL', 0),
|
||||
'topic_title' => array('STEXT_UNI', '', 'true_sort'),
|
||||
'topic_title' => array('XSTEXT_UNI', '', 'true_sort'),
|
||||
'topic_poster' => array('UINT', 0),
|
||||
'topic_time' => array('TIMESTAMP', 0),
|
||||
'topic_time_limit' => array('TIMESTAMP', 0),
|
||||
@@ -1174,7 +1167,7 @@ function get_schema_struct()
|
||||
'topic_last_poster_id' => array('UINT', 0),
|
||||
'topic_last_poster_name' => array('VCHAR_UNI', ''),
|
||||
'topic_last_poster_colour' => array('VCHAR:6', ''),
|
||||
'topic_last_post_subject' => array('STEXT_UNI', ''),
|
||||
'topic_last_post_subject' => array('XSTEXT_UNI', ''),
|
||||
'topic_last_post_time' => array('TIMESTAMP', 0),
|
||||
'topic_last_view_time' => array('TIMESTAMP', 0),
|
||||
'topic_moved_id' => array('UINT', 0),
|
||||
@@ -1280,7 +1273,7 @@ function get_schema_struct()
|
||||
'user_timezone' => array('DECIMAL', 0),
|
||||
'user_dst' => array('BOOL', 0),
|
||||
'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'),
|
||||
'user_style' => array('UINT', 0),
|
||||
'user_style' => array('USINT', 0),
|
||||
'user_rank' => array('UINT', 0),
|
||||
'user_colour' => array('VCHAR:6', ''),
|
||||
'user_new_privmsg' => array('INT:4', 0),
|
||||
|
@@ -22,15 +22,13 @@ involved in phpBB.
|
||||
|
||||
phpBB Lead Developer : Acyd Burn (Meik Sievertsen)
|
||||
|
||||
phpBB Developers : APTX (Marek A. R.)
|
||||
DavidMJ (David M.)
|
||||
phpBB Developers : DavidMJ (David M.)
|
||||
dhn (Dominik Dr<44>scher)
|
||||
kellanved (Henry Sudhof)
|
||||
naderman (Nils Adermann)
|
||||
ToonArmy (Chris Smith)
|
||||
subBlue (Tom Beddard)
|
||||
Vic D'Elfant (Vic D'Elfant)
|
||||
|
||||
|
||||
-- Previous Contributors --
|
||||
|
||||
phpBB Project Manager : theFinn (James Atkinson) [Founder - 04/2007]
|
||||
|
@@ -53,9 +53,6 @@
|
||||
<ol>
|
||||
<li><a href="#changelog">Changelog</a>
|
||||
<ol style="list-style-type: lower-roman;">
|
||||
<li><a href="#v304">Changes since 3.0.4</a></li>
|
||||
<li><a href="#v303">Changes since 3.0.3</a></li>
|
||||
<li><a href="#v302">Changes since 3.0.2</a></li>
|
||||
<li><a href="#v301">Changes since 3.0.1</a></li>
|
||||
<li><a href="#v300">Changes since 3.0.0</a></li>
|
||||
<li><a href="#v30rc8">Changes since RC-8</a></li>
|
||||
@@ -75,7 +72,7 @@
|
||||
|
||||
<span class="corners-bottom"><span></span></span></div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="changelog"></a><h2>1. Changelog</h2>
|
||||
@@ -84,226 +81,8 @@
|
||||
<div class="inner"><span class="corners-top"><span></span></span>
|
||||
|
||||
<div class="content">
|
||||
<a name="v304"></a><h3>1.i. Changes since 3.0.4</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li>
|
||||
<li>[Fix] Posts incremented for multiple approval of the same topic (Bug #40495 - Patch by TerraFrost)</li>
|
||||
<li>[Fix] Missing end " in quote bb tag deletes text (Bug #40565 - Patch by TerraFrost)</li>
|
||||
<li>[Fix] Friend/foe system displays posts made by foes while composing (Bug #40325 - Patch by TerraFrost and Highway of Life)</li>
|
||||
<li>[Fix] Check forum_image whether it exists (Bug #39005 - Patch by TerraFrost)</li>
|
||||
<li>[Fix] The sql query in acp_users.php lacks a condition (Bug #40275 - Patch by grimskies)</li>
|
||||
<li>[Fix] Added missing read permission information for some phpbb_chmod() calls</li>
|
||||
<li>[Fix] Correctly display future dates (Bug #38755)</li>
|
||||
<li>[Fix] Fix guest/bot session problems with apache authentication plugin (Bug #41085)</li>
|
||||
<li>[Fix] Whois now works reliably for RIRs other than APNIC and RIPE</li>
|
||||
<li>[Fix] Correctly convert Niels' Birthday MOD to the date format used in phpBB3. (Bug #32895)</li>
|
||||
<li>[Fix] Changed the success message when requesting a new password to be more accurate. (Bug #41405)</li>
|
||||
<li>[Fix] Add missing anti-abuse email headers to acp_inactive.php and ucp_resend.php.</li>
|
||||
<li>[Fix] Only remind users in the correct inactive states depending on the board account activation level.</li>
|
||||
<li>[Fix] Various XHTML mistakes in prosilver, subsilver2 and the ACP. (Bugs #41745, #42265 - Patch by nickvergessen, #38465, #43015)</li>
|
||||
<li>[Fix] Log password changes via password reset function. (Bug #41365)</li>
|
||||
<li>[Fix] Poll, negative durations generate error (Bug #41295 - Patch by TerraFrost)</li>
|
||||
<li>[Fix] Visibility of custom field on registration is incorrectly controlled by setting "display" (Bug #41385 - Patch by Eelke and fade2gray)</li>
|
||||
<li>[Fix] Smilies in username are misparsed on [quote=""] (Bug #41955 - Patch by TerraFrost)</li>
|
||||
<li>[Fix] Deleting all posts in a topic - bad redirect (Bug #41705 - Patch by TerraFrost)</li>
|
||||
<li>[Fix] Deleted users still appear logged in (Bug #41985 - Patch by TerraFrost)</li>
|
||||
<li>[Fix] Removed redundant code and unnecessary queries in forum management. (Bug #42265 - Patch by nickvergessen)</li>
|
||||
<li>[Fix] Correct mbstring regular expression for the allowable username characters, only affects <code>USERNAME_LETTER_NUM_SPACERS</code>. (Bug #42325)</li>
|
||||
<li>[Fix] Fix infinite loop in message handler if cache directory is not writable. (Bug #38675)</li>
|
||||
<li>[Fix] While post is awaiting approval it can still be edited even though it can not be seen (Bug #41435 - Patch by TerraFrost)</li>
|
||||
<li>[Fix] Fix imageset editing for retaining and correctly setting dimensions for images, as well as displaying correct settings for first page load.</li>
|
||||
<li>[Fix] Use OS-specific line endings for mail headers. (related to Bug #42755)</li>
|
||||
<li>[Fix] Hide font size options which are bigger than the allowed size in the editor. (Bug #42615 - Patch by nickvergessen)</li>
|
||||
<li>[Fix] Better thumbnail quality with imagemagick. (Bug #42565)</li>
|
||||
<li>[Fix] Fix download count increments for image attachments without corresponding thumbnails. (Bug #42505)</li>
|
||||
<li>[Fix] Fix wrong bot ip check if bot ip was wrongly entered by admin. (Bug #42485)</li>
|
||||
<li>[Fix] Fix javascript errors in simple header (prosilver) by adding forum_fn.js and the corresponding variables. (Bug #42135)</li>
|
||||
<li>[Fix] Set connection encoding for MySQL versions 4.1.0 to 4.1.2. This may fix some conversion issues with special characters. (Bug #41805)</li>
|
||||
<li>[Fix] Deleting private message attachments could delete post attachments. (Bug #42815)</li>
|
||||
<li>[Fix] Do not suppress PHP notices/errors in language packs if DEBUG_EXTRA mode enabled. (Bug #41485)</li>
|
||||
<li>[Fix] Flash files do not display anymore after update to flash player 10 (Bug #41315)</li>
|
||||
<li>[Fix] Use FQDN for SMTP EHLO/HELO command. (Bug #41025)</li>
|
||||
<li>[Fix] Mass Email works again for users with empty jabber address but notification set to 'both'. (Bug #39755)</li>
|
||||
<li>[Fix] Fix race condition for updating post/topic/etc. counter. (Reported by BartVB)</li>
|
||||
<li>[Fix] Fix duplicate creation of acl options in acl_add_options() under certain conditions. (Bug #38385, #40225)</li>
|
||||
<li>[Fix] Cancel when replying to global announcement redirects to first forum - not to the current forum (Bug #41225 - Patch by TerraFrost)</li>
|
||||
<li>[Fix] Cursor Jumps on New Topic in IE (Bug #42455 - Patch by TerraFrost)</li>
|
||||
<li>[Fix] Add indicator to be used in code if session was created (user visits the site for the first time).</li>
|
||||
<li>[Fix] Correctly count topic views for guests visiting the website the first time by entering the topic directly (Bug #43445)</li>
|
||||
<li>[Fix] Fix bug in postgresql db layer for LIMIT ALL clauses (Reported by JRSweets)</li>
|
||||
<li>[Fix] Sort backups by date, newest first (Bug #14818)</li>
|
||||
<li>[Fix] Prevent incomplete backups stored if option "store and download" is selected and admin cancel download by removing the option. (Bug #20325)</li>
|
||||
<li>[Fix] Enforce correct case for template variables</li>
|
||||
<li>[Fix] Set topic_last_view_time on post/reply/edit to circumvent race conditions in auto prune and false removal of topics for manual forum prune (Bug #18055, #43515)</li>
|
||||
<li>[Fix] Correctly split long subject lines according to the used RFC. This fixes extra spaces within long subjects. (Bug #43715)</li>
|
||||
<li>[Fix] Fix skipping messages if using next/prev PM in history links. (Bug #22205)</li>
|
||||
<li>[Fix] Messenger now also able to use a custom language path. (Bug #36545)</li>
|
||||
<li>[Fix] PM Export uses ISO 8601 date now. (Bug #32645)</li>
|
||||
<li>[Fix] Apply append_sid() to newest/latest post links in viewforum/search and UCP main module. (Bug #26815)</li>
|
||||
<li>[Fix] Do not create thumbnail if thumbnail would've the same size as the original image. (Bug #30725)</li>
|
||||
<li>[Fix] Ability to vote in poll is now required for the ability to change existing vote. (Bug #38925)</li>
|
||||
<li>[Fix] Search for 'topic title only' and 'first post' should work again for non-mysql dbms. (Bug #40605)</li>
|
||||
<li>[Fix] Make sure additional information for accessibility is always exposed to screen readers (Bug #44335 - Patch by MarcoZ)</li>
|
||||
<li>[Fix] Approving a topic when some of the posts within that topic have already been approved (Bug #42585 - Patch by TerraFrost)</li>
|
||||
<li>[Fix] Online status shown when post hidden (Bug #35505 - Patch by Raimon)</li>
|
||||
<li>[Fix] memberlist.php display formating can be distorted by posting long URL for website (Bug #36675 - Patch by TerraFrost)</li>
|
||||
<li>[Fix] Display the online status of hidden users to users with the u_viewonline permission when viewing PMs.</li>
|
||||
<li>[Fix] "Select all" selects much too much in Opera (Bug #42885 - Patch by TerraFrost and ToonArmy)</li>
|
||||
<li>[Fix] Correct calculation of source/target forum statistics if mass moving topics with global announcements (Bug #44545)</li>
|
||||
<li>[Fix] Fix column handling in db updater, custom profile fields an db tools for firebird DBMS (Bug #44555)</li>
|
||||
<li>[Fix] IE8 textarea issues (Bug #43305)</li>
|
||||
<li>[Change] Default difference view is now 'inline' instead of 'side by side'</li>
|
||||
<li>[Change] Added new option for merging differences to conflicting files in automatic updater</li>
|
||||
<li>[Change] Add link to user profile in the MCP for user notes and warn user.</li>
|
||||
<li>[Change] Add IN_PHPBB check to generated cache files. (Reported by bantu)</li>
|
||||
<li>[Change] Add topic icons to prosilver UCP main and subscribed templates (Bug #42735 - Patch by Raimon)</li>
|
||||
<li>[Change] Add unique key to ACL options table to prevent duplicate permission options. (Bug #41835)</li>
|
||||
<li>[Change] Redirect to relevant MCP page of multi-page topic if accessing quickmod tools (Split option for example)</li>
|
||||
<li>[Change] Performance improvements for native fulltext search (Patch by Paul)</li>
|
||||
<li>[Change] Changed jumpto() JS function to be more fail-safe. (But #27635 - Patch by peterkclee)</li>
|
||||
<li>[Feature] Added new options for visual confirmation.</li>
|
||||
<li>[Feature] Allow download of conflicting file for later reference in automatic updater</li>
|
||||
<li>[Feature] Allow translation of custom BBCode help messages. (Patch by bantu)</li>
|
||||
<li>[Feature] db_tools now support create table and drop table.</li>
|
||||
<li>[Feature] Database updater checks for incompatible db schema (MySQL 3.x/4.x against MySQL 4.1.x/5.x/6.x)</li>
|
||||
<li>[Feature] New search option: Maximum number of words allowed to search for.</li>
|
||||
<li>[Sec] Prevent accounts from being activated by users when admin activation is turned on and the correct activation key is known.</li>
|
||||
<li>[Sec] Only use forum id supplied for posting if global announcement detected. (Reported by nickvergessen)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v303"></a><h3>1.ii. Changes since 3.0.3</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Allow mixed-case template directories to be inherited (Bug #36725)</li>
|
||||
<li>[Fix] Regression bug from revision #8908 regarding log display in ACP</li>
|
||||
<li>[Fix] Allow the UCP group management to work for groups with avatars. (Bug #37375)</li>
|
||||
<li>[Fix] Fix header list build for replying oldest PM in PM history (Bug #37275)</li>
|
||||
<li>[Fix] Do not display COPPA group in memberlist find member dialog if COPPA disabled (Bug #37175)</li>
|
||||
<li>[Fix] Do not try to send jabber notifications if no jid entered (Bug #36775)</li>
|
||||
<li>[Fix] Only display special ranks to guests; no longer display normal ranks for guests (Bug #36735)</li>
|
||||
<li>[Fix] Properly treat punctuation marks after local urls (Bug #37055)</li>
|
||||
<li>[Fix] Make searching for members by YIM address work in prosilver</li>
|
||||
<li>[Fix] Tell users to recreate the search index after changing the common word threshold for fulltext_native (Bug #36345)</li>
|
||||
<li>[Fix] Adjusted phpbb_chmod() to always set permissions for group bit.</li>
|
||||
<li>[Fix] Do not increment users post count after post approval if post had been posted in a forum with no post count increasing set (Bug #37865)</li>
|
||||
<li>[Fix] Extend vertical line for last post column if no posts in forum (Bug #37125)</li>
|
||||
<li>[Fix] correctly update last topic/forum information if changing guest usernames through editing posts (Bug #38095)</li>
|
||||
<li>[Fix] fix postcount resync for situations where low and high post ids are higher than step value, resulting in users having 0 posts. (Bug #38195)</li>
|
||||
<li>[Fix] Use a left join for the topics table on search to avoid trouble with FROM syntax on some databases (Bug #37005)</li>
|
||||
<li>[Fix] Do not show 'Forward' button if the user cannot send PM's</li>
|
||||
<li>[Change] Alllow applications to set custom module inclusion path (idea by HoL)</li>
|
||||
<li>[Change] Handle checking for duplicate usernames in chunks (Bug #17285 - Patch by A_Jelly_Doughnut)</li>
|
||||
<li>[Change] Better handling and finer control for custom profile fields visibility options. (Patch by Highway of Life)</li>
|
||||
<li>[Change] Performance increase for format_date() (Bug #37575 - Patch by BartVB)</li>
|
||||
<li>[Change] Changed prosilver date separator from 'on' to '»'</li>
|
||||
<li>[Change] Performance increase for get_username_string() (Bug #37545 - Patch by BartVB)</li>
|
||||
<li>[Change] Slight performance increase for common parameter calls to append_sid() (Bug #37555 - Patch by BartVB)</li>
|
||||
<li>[Feature] Added 'AGO' setting to relative date strings. For example: posted 14 minutes ago. (Patch by BartVB)</li>
|
||||
<li>[Sec] Fixed an issue where deactivated accounts could be re-activated without the required privileges. (Reported by Jorick)</li>
|
||||
<li>[Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v302"></a><h3>1.iii. Changes since 3.0.2</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Correctly set topic starter if first post in topic removed (Bug #30575 - Patch by blueray2048)</li>
|
||||
<li>[Fix] Delete avatar files (Bug #29985).</li>
|
||||
<li>[Fix] Preserve selection in the MCP. (Bug #31265).</li>
|
||||
<li>[Fix] Added VST - Venezuela Standard Time (Bug #30545).</li>
|
||||
<li>[Fix] Close DB connections in file.php.</li>
|
||||
<li>[Fix] Correctly return results for nested cached queries (Bug #31445 - Patch by faw).</li>
|
||||
<li>[Fix] Allow export of PM pages greater one. (#33155)</li>
|
||||
<li>[Fix] Display coloured username of last poster in list of subscribed forums (prosilver).</li>
|
||||
<li>[Fix] Added missing UCP language string <em>NO_AUTH_READ_HOLD_MESSAGE</em>.</li>
|
||||
<li>[Fix] Do not jump back to page 1 when hiding member search in memberlist. (Bug #32515)</li>
|
||||
<li>[Fix] Correctly limit input of the users location to 100 characters in the UCP and ACP. (Bug #32655)</li>
|
||||
<li>[Fix] Sync reports when using the move all users posts tool in the ACP. (Bug #31165)</li>
|
||||
<li>[Fix] Extra slash is included in the redirect url when redirecting to the forum root directory. (Bug #33605)</li>
|
||||
<li>[Fix] Remove reported flag from shadow topics when closing reports. (Bug #19765)</li>
|
||||
<li>[Fix] Do not show non indexed forums on the search page if they contain no subforums. (Bug #33125)</li>
|
||||
<li>[Fix] Stop search bots incrementing topic views. (Bug #32675 - Patch by eviL<3)</li>
|
||||
<li>[Fix] Use correct link for post author search. (Bug #32595)</li>
|
||||
<li>[Fix] Do not decrease topics counter when deleting shadow topics. (Bug #26495)</li>
|
||||
<li>[Fix] Send localised disapproval reasons in the recipients local language. (Bug #31645)</li>
|
||||
<li>[Fix] Language typos/fixes. (Bugs #27625, #30755, #34185, #32795)</li>
|
||||
<li>[Fix] Added missing terms parameter to search pagination. (Bug #34085)</li>
|
||||
<li>[Fix] Wrong table order in query obtaining posts if post id given.</li>
|
||||
<li>[Fix] Do not display reported topic icon for shadow topics. (Bug #13970)</li>
|
||||
<li>[Fix] Display popular topic based on posts within topic instead of replies within topic. (Bug #16099)</li>
|
||||
<li>[Fix] Expand shown ban reason in unban screen to fully show long entries. (Bug #16234)</li>
|
||||
<li>[Fix] Preserve alpha transparency for created thumbnails. (Bug #16575)</li>
|
||||
<li>[Fix] Use correct port delimiter for MSSQL connections in windows. (Bug #16615)</li>
|
||||
<li>[Fix] Do not allow setting forums parent to the forum itself. (Bug #18855)</li>
|
||||
<li>[Fix] Display assigned rank/avatar for guests. (Bug #19155)</li>
|
||||
<li>[Fix] Set secure cookie for style switcher if required. (Bug #19625)</li>
|
||||
<li>[Fix] Fix native full text search on postgresql while using excluding keyword matches. (Bug #19195)</li>
|
||||
<li>[Fix] Pass S_SEARCH_ACTION through append_sid() in search.php. (Bug #21585)</li>
|
||||
<li>[Fix] Correctly delete message attachments. (Bug #23755)</li>
|
||||
<li>[Fix] Correctly handle unread status of subforums (that are not shown on the index) of forums that are shown on the index. (Bug #14589)</li>
|
||||
<li>[Fix] Stop users from deleting posts after the edit time has passed or they have been locked. (Bug #19115)</li>
|
||||
<li>[Fix] Split posts target forum requires 'f_post' now instead of 'm_split'. (Bug #31015)</li>
|
||||
<li>[Fix] Duplicate log messages for deleting a topic ('LOG_TOPIC_DELETED' has been deprecated in favour of 'LOG_DELETE_TOPIC').</li>
|
||||
<li>[Fix] Use a distinct log message for shadow topic deletions to differentiate between normal topic deletions. (Bug #34635)</li>
|
||||
<li>[Fix] Fix problems with styles using an underscore within the filename. (Bug #34315)</li>
|
||||
<li>[Fix] Better return links when deleting topics through the MCP. (Bug #34655)</li>
|
||||
<li>[Fix] Add quoting support to PM history when composing a reply. (Bug #34285)</li>
|
||||
<li>[Fix] Use phpBB 3.1.x method for storing cached data to prevent PHP bug with our usage of var_export(). (Thanks to Techie-Micheal and HoL for pointing out possible problems)</li>
|
||||
<li>[Fix] Check users pm preferences for pm's sent to groups. (Bug #33245)</li>
|
||||
<li>[Fix] Do not allow password reminders if u_passchg permission is not given. (Bug #14806)</li>
|
||||
<li>[Fix] Implemented strict check for cached user permissions and existing ACL options. This fix makes sure cached permissions are valid, even if they got already cached.</li>
|
||||
<li>[Fix] Do not show link to user/group profiles if user has no permission to view the linked page and gets a denied message anyway. (Bug #15088)</li>
|
||||
<li>[Fix] Do not display last post link and sort display options for search engines. (Bug #15088)</li>
|
||||
<li>[Fix] Make sure users still get notifications if they set to only be notified by Jabber, but Jabber service disabled. (Bug #29715 - Patch by Paul)</li>
|
||||
<li>[Fix] Don't show forum subscription link on categories. (Bug #34895)</li>
|
||||
<li>[Fix] Display a message if no topics or forums are selected when unsubscribing. (Bug #34855)</li>
|
||||
<li>[Fix] Mark/unmark all links in UCP now select/unselect both subscribed topics and forums.</li>
|
||||
<li>[Fix] Increase board topic counter when splitting topics. (Bug #32125)</li>
|
||||
<li>[Fix] Display profile icons when viewing a topic, or PM when only the jabber icon is to be visible. (Bug #34755)</li>
|
||||
<li>[Fix] Do not send PMs with warnings if the user cannot read PMs or they are disabled. (Bug #30815)</li>
|
||||
<li>[Fix] Correctly convert Niels' Birthday MOD to the date format used in phpBB3. (Bug #32895)</li>
|
||||
<li>[Fix] Parse BBCode lists of type square, circle and disc. (Bug #35295)</li>
|
||||
<li>[Fix] Round the displayed percentages in polls. (Bug #32375)</li>
|
||||
<li>[Fix] Disable mass e-mail when e-mail is disabled. (Bug #27385)</li>
|
||||
<li>[Fix] Display coloured poster username of queued posts displayed on the front of the MCP.</li>
|
||||
<li>[Fix] Moderators can only see reports/queue/logs from forums they can actually read. (Bug #31085)</li>
|
||||
<li>[Fix] Correctly display topic when start parameter is equal to the number of posts.</li>
|
||||
<li>[Fix] Correctly display topic in MCP when start parameter is equal to or greater than the number of posts. (Bug #30525)</li>
|
||||
|
||||
<li>[Change] No longer allow the direct use of MULTI_INSERT in sql_build_array. sql_multi_insert() must be used.</li>
|
||||
<li>[Change] Display warning in ACP if config.php file is left writable.</li>
|
||||
<li>[Change] More restrictive chmod to new files being created. (phpbb_chmod() function mostly by faw)</li>
|
||||
<li>[Change] Set headers to allow browsers to better cache attachments (Mylek pointed this out)</li>
|
||||
<li>[Change] Hide parameters if they equal the default in viewforum/viewtopic (Bug #31185)</li>
|
||||
<li>[Change] Various improvements to group listings (Bugs #32155, #32145, #32085, #26675, #26265)</li>
|
||||
<li>[Change] Set headers for IE 8 in file.php</li>
|
||||
<li>[Change] Do not count queued posts to user_posts.</li>
|
||||
<li>[Change] Allow setting birth year to current year.</li>
|
||||
<li>[Change] Do not use the topics posted table when performing an egosearch.</li>
|
||||
<li>[Change] Log the forum name that topics are moved into.</li>
|
||||
<li>[Change] Automatically add users/groups to the PM recipient list, if entered or selected.</li>
|
||||
<li>[Change] Reply to PM now includes all previous recipients and not only the original sender.</li>
|
||||
<li>[Change] Make topic selection for merge less confusing by removing unneeded controls. (Bug #21925)</li>
|
||||
<li>[Change] MCP topic view checkboxes now default to unchecked.</li>
|
||||
<li>[Change] Adjust language key <em>SPLIT_AFTER</em> to make the action clearer.</li>
|
||||
<li>[Change] Add links to the post and forum when viewing a report from the MCP. (Bugs #33795, #33805)</li>
|
||||
<li>[Change] Added CSRF protection to GET-only actions like marking forums.</li>
|
||||
<li>[Change] Remove NUL-Bytes directly in request_var() for strings and within the custom DBAL sql_escape() functions (MSSQL, Firebird, Oracle) (reported by AdhostMikeSw)</li>
|
||||
|
||||
<li>[Feature] Allow limited inheritance for template sets.</li>
|
||||
<li>[Feature] Allow hard disabling of the template editor.</li>
|
||||
<li>[Feature] Allow setting custom language path through $user->set_custom_lang_path(). $user->lang_path now also do not include the user language, but only the path.</li>
|
||||
<li>[Feature] Ability to define nullar/singular/plural language entries</li>
|
||||
<li>[Feature] Ability to mimic sprintf() calls with $user->lang() with the ability to correctly assign nullar/singular/plural language entries.</li>
|
||||
<li>[Feature] Added the possibility to force user posts put in queue if post count is lower than an admin defined value. Guest posting is not affected by this setting.</li>
|
||||
<li>[Feature] Added 'max_recipients' setting for private messages. This setting allows admins to define the maximum number of recipients per private message with a board-wide setting and a group-specific setting.</li>
|
||||
<li>[Feature] Added new permission setting for sending private messages to groups. Now there are two permissions to define sending private messages to multiple recipients and private messages to groups.</li>
|
||||
<li>[Feature] Allow specific connection to different server for jabber functionality by providing a valid JID as username. This also allows the use of talk.google.com as jabber server with gmail.com JIDs. (Bug #14989)</li>
|
||||
|
||||
<li>[Sec Precaution] Stricter validation of the HTTP_HOST header (Thanks to Techie-Micheal et al for pointing out possible issues in derived code)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v301"></a><h3>1.iv. Changes since 3.0.1</h3>
|
||||
<a name="v301"></a><h3>1.i. Changes since 3.0.1</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Ability to set permissions on non-mysql dbms (Bug #24955)</li>
|
||||
@@ -311,47 +90,41 @@
|
||||
<li>[Fix] Made the compress_tar class tolerate archives that do not properly have their archived contents listed (Bug #14429 / thanks to JRSweets for his patch)</li>
|
||||
<li>[Fix] Moved topics should not count towards the number of topics in a forum (Bug #14648 / thanks to Schumi for his patch)</li>
|
||||
<li>[Fix] Properly check for invalid characters in MySQL DB prefixes during install (Bug #18775)</li>
|
||||
<li>[Change] Generalize load check (Bug #21255 / thanks to Xipher)</li>
|
||||
<li>[Change] Make utf8_htmlspecialchars not pass its argument by reference (Bug #21885)</li>
|
||||
<li>[Fix] Bring the PostgreSQL backup system back to working order (Bug #22385)</li>
|
||||
<li>[Change] Sort the tables at the database table backup screen</li>
|
||||
<li>[Fix] Update correct theme for cached styles in style.php (Bug #25805)</li>
|
||||
<li>[Fix] Also add PHPBB_INSTALLED check to download/file.php for inline avatar delivery</li>
|
||||
<li>[Fix] Unable to login to some jabber server, reverted previous change (Bug #25095)</li>
|
||||
<li>[Fix] Do not return BMP as valid image type for GD image manipulation (Bug #25925)</li>
|
||||
<li>[Change] For determining the maximum number of private messages in one box, use the biggest value from all groups the user is a member of (Bug #24665)</li>
|
||||
<li>[Fix] Correctly determine safe mode for temp file creation in functions_upload.php (Bug #23525)</li>
|
||||
<li>[Fix] Correctly sort by rank in memberlist (Bug #24435)</li>
|
||||
<li>[Fix] Purge cache after database restore (Bug #24245)</li>
|
||||
<li>[Fix] Correctly display subforum read/unread icons from RTL in FF3, Konqueror and Safari3+. (thanks arod-1 for the fix, related to Bug #14830)</li>
|
||||
<li>[Feature] Added optional referer validation of POST requests as additional CSRF protection.</li>
|
||||
<li>[Fix] Added missing form token in acp (thanks NBBN).</li>
|
||||
<li>[Feature] Added optional stricter upload validation to avoid mime sniffing in addition to the safeguards provided by file.php. (thanks to Nicolas Grekas for compiling the list).</li>
|
||||
<li>[Fix] Do not remove whitespace in front of url containing the boards url and no relative path appended (Bug #27355)</li>
|
||||
<li>[Change] Show email ban reason on registration. Additionally allow custom errors properly returned if using validate_data(). (Bug #26885)</li>
|
||||
<li>[Feature] Streamlined banning via the MCP by adding a ban link to the user profile. Also pre-fills ban fields as far as possible.</li>
|
||||
<li>[Feature] Added ACP logout to reset an admin session.</li>
|
||||
<li>[Fix] reset forum notifications in viewtopic (Bug #28025)</li>
|
||||
<li>[Fix] corrected link for searching post author's other posts (Bug #26455)</li>
|
||||
<li>[Fix] HTTP Authentication supports UTF-8 usernames now (Bug #21135)</li>
|
||||
<li>[Fix] Topic searches by author no longer return invalid results (Bug #11777)</li>
|
||||
<li>[Change] Don't allow redirects to different domains. (thanks nookieman)</li>
|
||||
<li>[Fix] Delete drafts and bookmarks when deleting an user. (#27585, thanks Schumi for the fix)</li>
|
||||
<li>[Fix] Set last_post_subject for new topics. (#23945)</li>
|
||||
<li>[Fix] Allow moving posts to invisible forums. (#27325)</li>
|
||||
<li>[Fix] Don't allow promoting unapproved group members (#16124)</li>
|
||||
<li>[Fix] Correctly fetch server name if using non-standard port (#27395)</li>
|
||||
<li>[Fix] Regular expression for email matching in posts will no longer die on long words.</li>
|
||||
<li>[Fix] Do not display ban message if direct call to cron. (thanks Dog Cow for reporting)</li>
|
||||
<li>[Fix] Correctly display double-colon on special conditions within highlighted php source (Bug #26795)</li>
|
||||
<li>[Fix] Increase storage capacity of titles/subjects due to specialchared content (Bug #25235)</li>
|
||||
<li>[Fix] Catch invalid username wildcard ban (we do not support these) (Bug #29305)</li>
|
||||
<li>[Fix] Fix (email)-domain checks for those having DNS prefixes set (Bug #29635)</li>
|
||||
<li>[Change] Adjust truncate_string() to be able to adjust the maximum storage length.</li>
|
||||
<li>[Change] Generalize load check (Bug #21255 / thanks to Xipher)</li>
|
||||
<li>[Change] Make utf8_htmlspecialchars not pass its argument by reference (Bug #21885)</li>
|
||||
<li>[Change] Sort the tables at the database table backup screen</li>
|
||||
<li>[Change] For determining the maximum number of private messages in one box, use the biggest value from all groups the user is a member of (Bug #24665)</li>
|
||||
<li>[Change] Show email ban reason on registration. Additionally allow custom errors properly returned if using validate_data(). (Bug #26885)</li>
|
||||
<li>[Change] Don't allow redirects to different domains. (thanks nookieman)</li>
|
||||
<li>[Feature] Added optional referer validation of POST requests as additional CSRF protection.</li>
|
||||
<li>[Feature] Added optional stricter upload validation to avoid mime sniffing in addition to the safeguards provided by file.php. (thanks to Nicolas Grekas for compiling the list).</li>
|
||||
<li>[Feature] Streamlined banning via the MCP by adding a ban link to the user profile. Also pre-fills ban fields as far as possible.</li>
|
||||
<li>[Feature] Added ACP logout to reset an admin session.</li>
|
||||
<li>[Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v300"></a><h3>1.v. Changes since 3.0.0</h3>
|
||||
<a name="v300"></a><h3>1.ii. Changes since 3.0.0</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Change] Validate birthdays (Bug #15004)</li>
|
||||
@@ -422,7 +195,7 @@
|
||||
<li>[Fix] Find and display colliding usernames correctly when converting from one database to another (Bug #23925)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc8"></a><h3>1.vi. Changes since 3.0.RC8</h3>
|
||||
<a name="v30rc8"></a><h3>1.iii. Changes since 3.0.RC8</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Cleaned usernames contain only single spaces, so "a_name" and "a__name" are treated as the same name (Bug #15634)</li>
|
||||
@@ -431,7 +204,7 @@
|
||||
<li>[Fix] Call garbage_collection() within database updater to correctly close connections (affects Oracle for example)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc7"></a><h3>1.vii. Changes since 3.0.RC7</h3>
|
||||
<a name="v30rc7"></a><h3>1.iv. Changes since 3.0.RC7</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Fixed MSSQL related bug in the update system</li>
|
||||
@@ -466,7 +239,7 @@
|
||||
<li>[Fix] No duplication of active topics (Bug #15474)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc6"></a><h3>1.viii. Changes since 3.0.RC6</h3>
|
||||
<a name="v30rc6"></a><h3>1.v. Changes since 3.0.RC6</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Submitting language changes using acp_language (Bug #14736)</li>
|
||||
@@ -476,7 +249,7 @@
|
||||
<li>[Fix] Able to request new password (Bug #14743)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc5"></a><h3>1.ix. Changes since 3.0.RC5</h3>
|
||||
<a name="v30rc5"></a><h3>1.vi. Changes since 3.0.RC5</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.</li>
|
||||
@@ -539,7 +312,7 @@
|
||||
<li>[Sec] New password hashing mechanism for storing passwords (#i42)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc4"></a><h3>1.x. Changes since 3.0.RC4</h3>
|
||||
<a name="v30rc4"></a><h3>1.vii. Changes since 3.0.RC4</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li>
|
||||
@@ -590,7 +363,7 @@
|
||||
<li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li>
|
||||
</ul>
|
||||
|
||||
<a name="v30rc3"></a><h3>1.xi. Changes since 3.0.RC3</h3>
|
||||
<a name="v30rc3"></a><h3>1.viii. Changes since 3.0.RC3</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Fixing some subsilver2 and prosilver style issues</li>
|
||||
@@ -699,7 +472,7 @@
|
||||
|
||||
</ul>
|
||||
|
||||
<a name="v30rc2"></a><h3>1.xii. Changes since 3.0.RC2</h3>
|
||||
<a name="v30rc2"></a><h3>1.ix. Changes since 3.0.RC2</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] Re-allow searching within the memberlist</li>
|
||||
@@ -724,7 +497,7 @@
|
||||
<li>[Fix] Use our global expression for checking email syntax in memberlist (Bug #12827)</li>
|
||||
<li>[Fix] Correctly retrieve/refresh templates stored in database if using subdirectories within template directory (Bug #12839)</li>
|
||||
<li>[Fix] Correctly translate special group names in ucp_groups.php (Bug #12597)</li>
|
||||
<li>[Fix] Search boxes not losing session id (changing method from get to post) (Bug #12643)</li>
|
||||
<li>[Fix] Search boxes not loosing session id (changing method from get to post) (Bug #12643)</li>
|
||||
<li>[Fix] Make sure the automatic update is also working for those having fsockopen disabled</li>
|
||||
<li>[Fix] Simulate recache of theme data on automatic update finished page - recaching it if css data changed</li>
|
||||
<li>[Feature] Allow dropping in custom "info_[module class]_*.php" files to language/*/mods directory for inclusion into the menu structure without the need to modify phpBB language files for menu placements</li>
|
||||
@@ -745,7 +518,7 @@
|
||||
|
||||
</ul>
|
||||
|
||||
<a name="v30rc1"></a><h3>1.xiii. Changes since 3.0.RC1</h3>
|
||||
<a name="v30rc1"></a><h3>1.x. Changes since 3.0.RC1</h3>
|
||||
|
||||
<ul>
|
||||
<li>[Fix] (X)HTML issues within the templates (Bug #11255, #11255)</li>
|
||||
|
@@ -53,7 +53,7 @@
|
||||
|
||||
<!-- add entry about common UTF8 problems (for example wrong uploading, editing) -->
|
||||
<ul>
|
||||
<li><a href="#install">I am finding phpBB too difficult to install. Will you do it for me?</a></li>
|
||||
<li><a href="#install">I cannot install this it is too difficult! Will you do it?</a></li>
|
||||
<li><a href="#legal">I am having problems with the admin at a certain board, help!</a></li>
|
||||
<li><a href="#legal">A board has ripped off my graphics/software/etc., stop them!</a></li>
|
||||
<li><a href="#legal">A board is dealing in warez/porn/etc., you need to prevent them doing this!</a></li>
|
||||
@@ -62,7 +62,7 @@
|
||||
<li><a href="#mail">I keep getting Mail sending errors when I (or my users) post/send PM's/etc.!</a></li>
|
||||
<li><a href="#mail_language">My users are complaining that emails are not in their selected language!</a></li>
|
||||
<li><a href="#aol_browser">My AOL based users keep getting logged out!</a></li>
|
||||
<li><a href="#avatars">I am unable to upload avatars from my computer, regardless of the settings.</a></li>
|
||||
<li><a href="#avatars">No matter what I set the uploadable avatars to I cannot upload one from my computer!</a></li>
|
||||
<li><a href="#gallery_avatars">I just cannot get gallery avatars to appear!</a></li>
|
||||
<li><a href="#permissions">How do I use/set permissions?</a></li>
|
||||
<li><a href="#login_issues">I (or my users) cannot stay logged in to the forum!</a></li>
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="install"></a><h2>I am finding phpBB too difficult to install. Will you do it for me?</h2>
|
||||
<a name="install"></a><h2>I cannot install this it is too difficult! Will you do it?</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner"><span class="corners-top"><span></span></span>
|
||||
@@ -205,7 +205,7 @@ I want to sue you because i think you host an illegal board!</h2>
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="avatars"></a><h2>I am unable to upload avatars from my computer, regardless of the settings.</h2>
|
||||
<a name="avatars"></a><h2>No matter what I set the uploadable avatars to I cannot upload one from my computer!</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
<div class="inner"><span class="corners-top"><span></span></span>
|
||||
|
@@ -273,7 +273,7 @@
|
||||
|
||||
<p>This package is meant for those wanting to only replace changed files from a previous version to the latest version. This package normally contains the changed files from up to five previous versions.</p>
|
||||
|
||||
<p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.0.4</samp> you should select the phpBB-3.0.4_to_3.0.5.zip/tar.gz file.</p>
|
||||
<p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.0.1</samp> you should select the phpBB-3.0.1_to_3.0.2.zip/tar.gz file.</p>
|
||||
|
||||
<p>The directory structure has been preserved enabling you (if you wish) to simply upload the contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any MODs these files will overwrite the originals possibly destroying them in the process. You will need to re-add MODs to any affected file before uploading.</p>
|
||||
|
||||
@@ -285,7 +285,7 @@
|
||||
|
||||
<p>The patch file is one solution for those with many Modifications (MODs) or other changes who do not want to re-add them back to all the changed files if they use the method explained above. To use this you will need command line access to a standard UNIX type <strong>patch</strong> application. If you do not have access to such an application but still want to use this update approach, we strongly recommend the <a href="#update_auto">Automatic update package</a> explained below. It is also the preferred update method.</p>
|
||||
|
||||
<p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is 3.0.4 you need the phpBB-3.0.4_to_3.0.5.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <strong>patch -cl -d [PHPBB DIRECTORY] -p1 < [PATCH NAME]</strong> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
|
||||
<p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is 3.0.1 you need the phpBB-3.0.1_to_3.0.1.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <strong>patch -cl -d [PHPBB DIRECTORY] -p1 < [PATCH NAME]</strong> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
|
||||
|
||||
<p>If you do get failures you should look at using the <a href="#update_files">Changed files only</a> package to replace the files which failed to patch, please note that you will need to manually re-add any Modifications (MODs) to these particular files. Alternatively if you know how you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.</p>
|
||||
|
||||
@@ -295,7 +295,7 @@
|
||||
|
||||
<p>This update method is the preferred method for updating. This package allows detecting changed files automatically and merges changes if needed.</p>
|
||||
|
||||
<p>The automatic update package contains - contrary to the others - only the information required to update the previous release version to the latest available version. These packages are meant for use with the automatic update tool.</p>
|
||||
<p>The automatic update package is holding - contrary to the others - only the update informations for updating the last released version to the latest available version. These package is meant for use with the automatic update tool.</p>
|
||||
|
||||
<p>To perform the update, either follow the instructions from the <code>Administration Control Panel->System</code> Tab - this should point out that you are running an outdated version and will guide you through the update - or follow the instructions listed below.</p>
|
||||
|
||||
@@ -371,9 +371,9 @@
|
||||
|
||||
<p><strong>Path to your former board</strong> The converter expects the relative path to your old board's files. So, - for instance - if the old board is located at <code>http://www.yourdomain.com/forum</code> and the phpBB3 installation is located at <code>http://www.yourdomain.com/phpBB3</code>, then the correct value would be <code>../forum</code>. Note that the webserver user must be able to access the source installation's files.</p>
|
||||
|
||||
<p><strong>Missing images</strong> If your default board language's language pack does not include all images, then some images might be missing in your installation. Always use a complete language pack as default language.</p>
|
||||
<p><strong>Missing images</strong> If your default board language's language pack does not include all images, then some images might be missing in your installation. Always use a complete language pack as default language.</p>
|
||||
|
||||
<p><strong>Smilies</strong> During the conversion you might see warnings about image files where the copying failed. That can happen if the old board's smilies have the same file names as those on the new board. Copy those files manually after the conversion, if you want to continue using the old smilies.</p>
|
||||
<p><strong>Smilies</strong> During the conversion you might see warnings about image files where the copying failed. That can happen if the old board's smilies have the same file names as those on the new board. Copy those files manually after the conversion, if you want to continue using the old smilies.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
@@ -69,15 +69,7 @@
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href="#styling">Styling</a></li>
|
||||
<ol style="list-style-type: lower-roman;">
|
||||
<li><a href="#cfgfiles">Style Config Files</a></li>
|
||||
<li><a href="#genstyling">General Styling Rules</a></li>
|
||||
</ol></li>
|
||||
<li><a href="#templating">Templating</a>
|
||||
<ol style="list-style-type: lower-roman;">
|
||||
<li><a href="#templates">General Templating</a></li>
|
||||
<li><a href="#inheritance">Template Inheritance</a></li>
|
||||
</ol></li>
|
||||
<li><a href="#templating">Templating</a></li>
|
||||
<li><a href="#charsets">Character Sets and Encodings</a></li>
|
||||
<li><a href="#translation">Translation (<abbr title="Internationalisation">i18n</abbr>/<abbr title="Localisation">L10n</abbr>) Guidelines</a>
|
||||
<ol style="list-style-type: lower-roman;">
|
||||
@@ -196,7 +188,8 @@ class ...
|
||||
<li><code>/includes/db/firebird.php</code><br />Firebird/Interbase Database Abstraction Layer</li>
|
||||
<li><code>/includes/db/msssql.php</code><br />MSSQL Database Abstraction Layer</li>
|
||||
<li><code>/includes/db/mssql_odbc.php</code><br />MSSQL ODBC Database Abstraction Layer for MSSQL</li>
|
||||
<li><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer for MySQL 3.x/4.0.x/4.1.x/5.x
|
||||
<li><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer for MySQL 3.x/4.0.x</li>
|
||||
<li><code>/includes/db/mysql4.php</code><br />MySQL4 Database Abstraction Layer for MySQL 4.1.x/5.x</li>
|
||||
<li><code>/includes/db/mysqli.php</code><br />MySQLi Database Abstraction Layer</li>
|
||||
<li><code>/includes/db/oracle.php</code><br />Oracle Database Abstraction Layer</li>
|
||||
<li><code>/includes/db/postgres.php</code><br />PostgreSQL Database Abstraction Layer</li>
|
||||
@@ -525,7 +518,7 @@ switch ($mode)
|
||||
break;
|
||||
|
||||
default:
|
||||
// Always assume that a case was not caught
|
||||
// Always assume that the case got not catched
|
||||
break;
|
||||
}
|
||||
</pre></div>
|
||||
@@ -548,7 +541,7 @@ switch ($mode)
|
||||
|
||||
default:
|
||||
|
||||
// Always assume that a case was not caught
|
||||
// Always assume that the case got not catched
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -576,7 +569,7 @@ switch ($mode)
|
||||
|
||||
default:
|
||||
|
||||
// Always assume that a case was not caught
|
||||
// Always assume that the case got not catched
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -697,29 +690,7 @@ $sql = 'UPDATE ' . SOME_TABLE . '
|
||||
$db->sql_query($sql);
|
||||
</pre></div>
|
||||
|
||||
<p>The <code>$db->sql_build_array()</code> function supports the following modes: <code>INSERT</code> (example above), <code>INSERT_SELECT</code> (building query for <code>INSERT INTO table (...) SELECT value, column ...</code> statements), <code>UPDATE</code> (example above) and <code>SELECT</code> (for building WHERE statement [AND logic]).</p>
|
||||
|
||||
<h4>sql_multi_insert():</h4>
|
||||
|
||||
<p>If you want to insert multiple statements at once, please use the separate <code>sql_multi_insert()</code> method. An example:</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
$sql_ary = array();
|
||||
|
||||
$sql_ary[] = array(
|
||||
'somedata' => $my_string_1,
|
||||
'otherdata' => $an_int_1,
|
||||
'moredata' => $another_int_1,
|
||||
);
|
||||
|
||||
$sql_ary[] = array(
|
||||
'somedata' => $my_string_2,
|
||||
'otherdata' => $an_int_2,
|
||||
'moredata' => $another_int_2,
|
||||
);
|
||||
|
||||
$db->sql_multi_insert(SOME_TABLE, $sql_ary);
|
||||
</pre></div>
|
||||
<p>The <code>$db->sql_build_array()</code> function supports the following modes: <code>INSERT</code> (example above), <code>INSERT_SELECT</code> (building query for <code>INSERT INTO table (...) SELECT value, column ...</code> statements), <code>MULTI_INSERT</code> (for returning extended inserts), <code>UPDATE</code> (example above) and <code>SELECT</code> (for building WHERE statement [AND logic]).</p>
|
||||
|
||||
<h4>sql_in_set():</h4>
|
||||
|
||||
@@ -1002,18 +973,8 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;
|
||||
<div class="inner"><span class="corners-top"><span></span></span>
|
||||
|
||||
<div class="content">
|
||||
<a name="cfgfiles"></a><h3>3.i. Style Config Files</h3>
|
||||
<p>Style cfg files are simple name-value lists with the information necessary for installing a style. Similar cfg files exist for templates, themes and imagesets. These follow the same principle and will not be introduced individually. Styles can use installed components by using the required_theme/required_template/required_imageset entries. The important part of the style configuration file is assigning an unique name.</p>
|
||||
<div class="codebox"><pre>
|
||||
# General Information about this style
|
||||
name = prosilver_duplicate
|
||||
copyright = © phpBB Group, 2007
|
||||
version = 3.0.3
|
||||
required_template = prosilver
|
||||
required_theme = prosilver
|
||||
required_imageset = prosilver
|
||||
</pre></div>
|
||||
<a name="genstyling"></a><h3>3.2. General Styling Rules</h3>
|
||||
|
||||
<h4>General things</h4>
|
||||
<p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms). Please also note that the intendation and coding guidelines also apply to templates where possible.</p>
|
||||
|
||||
<p>The outer table class <code>forumline</code> has gone and is replaced with <code>tablebg</code>.</p>
|
||||
@@ -1080,7 +1041,6 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;
|
||||
<div class="inner"><span class="corners-top"><span></span></span>
|
||||
|
||||
<div class="content">
|
||||
<a name="templates"></a><h3>4.i. General Templating</h3>
|
||||
|
||||
<h4>File naming</h4>
|
||||
<p>Firstly templates now take the suffix ".html" rather than ".tpl". This was done simply to make the lifes of some people easier wrt syntax highlighting, etc.</p>
|
||||
@@ -1469,29 +1429,6 @@ div
|
||||
</fieldset>
|
||||
</form>
|
||||
</pre></div><br />
|
||||
|
||||
<a name="inheritance"></a><h3>4.ii. Template Inheritance</h3>
|
||||
<p>When basing a new template on an existing one, it is not necessary to provide all template files. By declaring the template to be "<strong>inheriting</strong>" in the template configuration file.</p>
|
||||
|
||||
<p>The limitation on this is that the base style has to be installed and complete, meaning that it is not itself inheriting.</p>
|
||||
|
||||
<p>The effect of doing so is that the template engine will use the files in the new template where they exist, but fall back to files in the base template otherwise. Declaring a style to be inheriting also causes it to use some of the configuration settings of the base style, notably database storage.</p>
|
||||
|
||||
<p>We strongly encourage the use of inheritance for styles based on the bundled styles, as it will ease the update procedure.</p>
|
||||
|
||||
<div class="codebox"><pre>
|
||||
# General Information about this template
|
||||
name = inherits
|
||||
copyright = © phpBB Group, 2007
|
||||
version = 3.0.3
|
||||
|
||||
# Defining a different template bitfield
|
||||
template_bitfield = lNg=
|
||||
|
||||
# Are we inheriting?
|
||||
inherit_from = prosilver
|
||||
</pre></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
|
||||
@@ -2258,21 +2195,6 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
|
||||
|
||||
<div class="content">
|
||||
|
||||
|
||||
<h3>Revision 8732</h3>
|
||||
|
||||
<ul>
|
||||
<li>Added cfg files.</li>
|
||||
<li>Added template <a href="#inheritance">inheritance</a>.</li>
|
||||
</ul>
|
||||
|
||||
<h3>Revision 8596+</h3>
|
||||
|
||||
<ul>
|
||||
<li>Removed sql_build_array('MULTI_INSERT'... statements.</li>
|
||||
<li>Added sql_multi_insert() explanation.</li>
|
||||
</ul>
|
||||
|
||||
<h3>Revision 1.31</h3>
|
||||
|
||||
<ul>
|
||||
|
@@ -15,20 +15,6 @@ define('IN_PHPBB', true);
|
||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
|
||||
|
||||
// Thank you sun.
|
||||
if (isset($_SERVER['CONTENT_TYPE']))
|
||||
{
|
||||
if ($_SERVER['CONTENT_TYPE'] === 'application/x-java-archive')
|
||||
{
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Java') !== false)
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_GET['avatar']))
|
||||
{
|
||||
require($phpbb_root_path . 'config.' . $phpEx);
|
||||
@@ -59,8 +45,6 @@ if (isset($_GET['avatar']))
|
||||
$config = $cache->obtain_config();
|
||||
$filename = $_GET['avatar'];
|
||||
$avatar_group = false;
|
||||
$exit = false;
|
||||
|
||||
if ($filename[0] === 'g')
|
||||
{
|
||||
$avatar_group = true;
|
||||
@@ -71,37 +55,75 @@ if (isset($_GET['avatar']))
|
||||
if (strpos($filename, '.') == false)
|
||||
{
|
||||
header('HTTP/1.0 403 Forbidden');
|
||||
$exit = true;
|
||||
}
|
||||
|
||||
if (!$exit)
|
||||
{
|
||||
$ext = substr(strrchr($filename, '.'), 1);
|
||||
$stamp = (int) substr(stristr($filename, '_'), 1);
|
||||
$filename = (int) $filename;
|
||||
$exit = set_modified_headers($stamp, $browser);
|
||||
}
|
||||
if (!$exit && !in_array($ext, array('png', 'gif', 'jpg', 'jpeg')))
|
||||
{
|
||||
// no way such an avatar could exist. They are not following the rules, stop the show.
|
||||
header("HTTP/1.0 403 Forbidden");
|
||||
$exit = true;
|
||||
}
|
||||
|
||||
|
||||
if (!$exit)
|
||||
{
|
||||
if (!$filename)
|
||||
if (!empty($cache))
|
||||
{
|
||||
// no way such an avatar could exist. They are not following the rules, stop the show.
|
||||
header("HTTP/1.0 403 Forbidden");
|
||||
$cache->unload();
|
||||
}
|
||||
$db->sql_close();
|
||||
exit;
|
||||
}
|
||||
|
||||
$ext = substr(strrchr($filename, '.'), 1);
|
||||
$stamp = (int) substr(stristr($filename, '_'), 1);
|
||||
$filename = (int) $filename;
|
||||
|
||||
// let's see if we have to send the file at all
|
||||
$last_load = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? strtotime(trim($_SERVER['HTTP_IF_MODIFIED_SINCE'])) : false;
|
||||
if (strpos(strtolower($browser), 'msie 6.0') === false)
|
||||
{
|
||||
if ($last_load !== false && $last_load <= $stamp)
|
||||
{
|
||||
if (@php_sapi_name() === 'CGI')
|
||||
{
|
||||
header('Status: 304 Not Modified', true, 304);
|
||||
}
|
||||
else
|
||||
{
|
||||
header('HTTP/1.0 304 Not Modified', true, 304);
|
||||
}
|
||||
// seems that we need those too ... browsers
|
||||
header('Pragma: public');
|
||||
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000));
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
send_avatar_to_browser(($avatar_group ? 'g' : '') . $filename . '.' . $ext, $browser);
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $stamp) . ' GMT');
|
||||
}
|
||||
}
|
||||
file_gc();
|
||||
|
||||
if (!in_array($ext, array('png', 'gif', 'jpg', 'jpeg')))
|
||||
{
|
||||
// no way such an avatar could exist. They are not following the rules, stop the show.
|
||||
header("HTTP/1.0 403 Forbidden");
|
||||
if (!empty($cache))
|
||||
{
|
||||
$cache->unload();
|
||||
}
|
||||
$db->sql_close();
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$filename)
|
||||
{
|
||||
// no way such an avatar could exist. They are not following the rules, stop the show.
|
||||
header("HTTP/1.0 403 Forbidden");
|
||||
if (!empty($cache))
|
||||
{
|
||||
$cache->unload();
|
||||
}
|
||||
$db->sql_close();
|
||||
exit;
|
||||
}
|
||||
|
||||
send_avatar_to_browser(($avatar_group ? 'g' : '') . $filename . '.' . $ext, $browser);
|
||||
|
||||
if (!empty($cache))
|
||||
{
|
||||
$cache->unload();
|
||||
}
|
||||
$db->sql_close();
|
||||
exit;
|
||||
}
|
||||
|
||||
// implicit else: we are not in avatar mode
|
||||
@@ -126,7 +148,7 @@ if (!$config['allow_attachments'] && !$config['allow_pm_attach'])
|
||||
trigger_error('ATTACHMENT_FUNCTIONALITY_DISABLED');
|
||||
}
|
||||
|
||||
$sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id, filetime
|
||||
$sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id
|
||||
FROM ' . ATTACHMENTS_TABLE . "
|
||||
WHERE attach_id = $download_id";
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
@@ -237,7 +259,7 @@ if (!download_allowed())
|
||||
$download_mode = (int) $extensions[$attachment['extension']]['download_mode'];
|
||||
|
||||
// Fetching filename here to prevent sniffing of filename
|
||||
$sql = 'SELECT attach_id, is_orphan, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype, filetime
|
||||
$sql = 'SELECT attach_id, is_orphan, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype
|
||||
FROM ' . ATTACHMENTS_TABLE . "
|
||||
WHERE attach_id = $download_id";
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
@@ -266,7 +288,7 @@ if ($thumbnail)
|
||||
{
|
||||
$attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename'];
|
||||
}
|
||||
else if (($display_cat == ATTACHMENT_CATEGORY_NONE/* || $display_cat == ATTACHMENT_CATEGORY_IMAGE*/) && !$attachment['is_orphan'])
|
||||
else if (($display_cat == ATTACHMENT_CATEGORY_NONE || $display_cat == ATTACHMENT_CATEGORY_IMAGE) && !$attachment['is_orphan'])
|
||||
{
|
||||
// Update download count
|
||||
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
|
||||
@@ -275,10 +297,9 @@ else if (($display_cat == ATTACHMENT_CATEGORY_NONE/* || $display_cat == ATTACHME
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && ((strpos(strtolower($user->browser), 'msie') !== false) && (strpos(strtolower($user->browser), 'msie 8.0') === false)))
|
||||
if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && strpos(strtolower($user->browser), 'msie') !== false)
|
||||
{
|
||||
wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']);
|
||||
file_gc();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -292,12 +313,12 @@ else
|
||||
}
|
||||
|
||||
redirect($phpbb_root_path . $config['upload_path'] . '/' . $attachment['physical_filename']);
|
||||
file_gc();
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
send_file_to_browser($attachment, $config['upload_path'], $display_cat);
|
||||
file_gc();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,7 +354,7 @@ function send_avatar_to_browser($file, $browser)
|
||||
$image_data = @getimagesize($file_path);
|
||||
header('Content-Type: ' . image_type_to_mime_type($image_data[2]));
|
||||
|
||||
if (strpos(strtolower($browser), 'msie') !== false && strpos(strtolower($browser), 'msie 8.0') === false)
|
||||
if (strpos(strtolower($browser), 'msie') !== false)
|
||||
{
|
||||
header('Content-Disposition: attachment; ' . header_filename($file));
|
||||
|
||||
@@ -358,7 +379,7 @@ function send_avatar_to_browser($file, $browser)
|
||||
header("Content-Length: $size");
|
||||
}
|
||||
|
||||
if (@readfile($file_path) == false)
|
||||
if (@readfile($file_path) === false)
|
||||
{
|
||||
$fp = @fopen($file_path, 'rb');
|
||||
|
||||
@@ -376,7 +397,7 @@ function send_avatar_to_browser($file, $browser)
|
||||
}
|
||||
else
|
||||
{
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
header('HTTP/1.0 404 not found');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,37 +484,19 @@ function send_file_to_browser($attachment, $upload_dir, $category)
|
||||
*/
|
||||
|
||||
// Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer.
|
||||
$is_ie8 = (strpos(strtolower($user->browser), 'msie 8.0') !== false);
|
||||
header('Content-Type: ' . $attachment['mimetype']);
|
||||
|
||||
if ($is_ie8)
|
||||
if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie') !== false))
|
||||
{
|
||||
header('X-Content-Type-Options: nosniff');
|
||||
}
|
||||
|
||||
if ($category == ATTACHMENT_CATEGORY_FLASH && request_var('view', 0) === 1)
|
||||
{
|
||||
// We use content-disposition: inline for flash files and view=1 to let it correctly play with flash player 10 - any other disposition will fail to play inline
|
||||
header('Content-Disposition: inline');
|
||||
header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
|
||||
if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false))
|
||||
{
|
||||
header('expires: -1');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (empty($user->browser) || (!$is_ie8 && (strpos(strtolower($user->browser), 'msie') !== false)))
|
||||
{
|
||||
header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
|
||||
if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false))
|
||||
{
|
||||
header('expires: -1');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
|
||||
if ($is_ie8 && (strpos($attachment['mimetype'], 'image') !== 0))
|
||||
{
|
||||
header('X-Download-Options: noopen');
|
||||
}
|
||||
}
|
||||
header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
|
||||
}
|
||||
|
||||
if ($size)
|
||||
@@ -501,32 +504,26 @@ function send_file_to_browser($attachment, $upload_dir, $category)
|
||||
header("Content-Length: $size");
|
||||
}
|
||||
|
||||
// Close the db connection before sending the file
|
||||
$db->sql_close();
|
||||
// Try to deliver in chunks
|
||||
@set_time_limit(0);
|
||||
|
||||
if (!set_modified_headers($attachment['filetime'], $user->browser))
|
||||
$fp = @fopen($filename, 'rb');
|
||||
|
||||
if ($fp !== false)
|
||||
{
|
||||
// Try to deliver in chunks
|
||||
@set_time_limit(0);
|
||||
|
||||
$fp = @fopen($filename, 'rb');
|
||||
|
||||
if ($fp !== false)
|
||||
while (!feof($fp))
|
||||
{
|
||||
while (!feof($fp))
|
||||
{
|
||||
echo fread($fp, 8192);
|
||||
}
|
||||
fclose($fp);
|
||||
echo fread($fp, 8192);
|
||||
}
|
||||
else
|
||||
{
|
||||
@readfile($filename);
|
||||
}
|
||||
|
||||
flush();
|
||||
fclose($fp);
|
||||
}
|
||||
file_gc();
|
||||
else
|
||||
{
|
||||
@readfile($filename);
|
||||
}
|
||||
|
||||
flush();
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -658,49 +655,4 @@ function download_allowed()
|
||||
return $allowed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the browser has the file already and set the appropriate headers-
|
||||
* @returns false if a resend is in order.
|
||||
*/
|
||||
function set_modified_headers($stamp, $browser)
|
||||
{
|
||||
// let's see if we have to send the file at all
|
||||
$last_load = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? strtotime(trim($_SERVER['HTTP_IF_MODIFIED_SINCE'])) : false;
|
||||
if ((strpos(strtolower($browser), 'msie 6.0') === false) && (strpos(strtolower($browser), 'msie 8.0') === false))
|
||||
{
|
||||
if ($last_load !== false && $last_load <= $stamp)
|
||||
{
|
||||
if (substr(strtolower(@php_sapi_name()),0,3) === 'cgi')
|
||||
{
|
||||
// in theory, we shouldn't need that due to php doing it. Reality offers a differing opinion, though
|
||||
header('Status: 304 Not Modified', true, 304);
|
||||
}
|
||||
else
|
||||
{
|
||||
header('HTTP/1.0 304 Not Modified', true, 304);
|
||||
}
|
||||
// seems that we need those too ... browsers
|
||||
header('Pragma: public');
|
||||
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000));
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $stamp) . ' GMT');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function file_gc()
|
||||
{
|
||||
global $cache, $db;
|
||||
if (!empty($cache))
|
||||
{
|
||||
$cache->unload();
|
||||
}
|
||||
$db->sql_close();
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
@@ -89,30 +89,21 @@ class acm
|
||||
if ($fp = @fopen($this->cache_dir . 'data_global.' . $phpEx, 'wb'))
|
||||
{
|
||||
@flock($fp, LOCK_EX);
|
||||
fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$this->vars = " . var_export($this->vars, true) . ";\n\n\$this->var_expires = " . var_export($this->var_expires, true) . "\n?>");
|
||||
fwrite($fp, "<?php\n\$this->vars = " . var_export($this->vars, true) . ";\n\n\$this->var_expires = " . var_export($this->var_expires, true) . "\n?>");
|
||||
@flock($fp, LOCK_UN);
|
||||
fclose($fp);
|
||||
|
||||
if (!function_exists('phpbb_chmod'))
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
include($phpbb_root_path . 'includes/functions.' . $phpEx);
|
||||
}
|
||||
|
||||
phpbb_chmod($this->cache_dir . 'data_global.' . $phpEx, CHMOD_READ | CHMOD_WRITE);
|
||||
@chmod($this->cache_dir . 'data_global.' . $phpEx, 0666);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Now, this occurred how often? ... phew, just tell the user then...
|
||||
if (!@is_writable($this->cache_dir))
|
||||
{
|
||||
// We need to use die() here, because else we may encounter an infinite loop (the message handler calls $cache->unload())
|
||||
die($this->cache_dir . ' is NOT writable.');
|
||||
exit;
|
||||
trigger_error($this->cache_dir . ' is NOT writable.', E_USER_ERROR);
|
||||
}
|
||||
|
||||
die('Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx);
|
||||
exit;
|
||||
trigger_error('Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx, E_USER_ERROR);
|
||||
}
|
||||
|
||||
$this->is_modified = false;
|
||||
@@ -163,7 +154,7 @@ class acm
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
set_config('cache_last_gc', time(), true);
|
||||
}
|
||||
|
||||
@@ -202,17 +193,11 @@ class acm
|
||||
if ($fp = @fopen($this->cache_dir . "data{$var_name}.$phpEx", 'wb'))
|
||||
{
|
||||
@flock($fp, LOCK_EX);
|
||||
fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data = " . (sizeof($var) ? "unserialize(" . var_export(serialize($var), true) . ");" : 'array();') . "\n\n?>");
|
||||
fwrite($fp, "<?php\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data = " . var_export($var, true) . ";\n?>");
|
||||
@flock($fp, LOCK_UN);
|
||||
fclose($fp);
|
||||
|
||||
if (!function_exists('phpbb_chmod'))
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
include($phpbb_root_path . 'includes/functions.' . $phpEx);
|
||||
}
|
||||
|
||||
phpbb_chmod($this->cache_dir . "data{$var_name}.$phpEx", CHMOD_READ | CHMOD_WRITE);
|
||||
@chmod($this->cache_dir . "data{$var_name}.$phpEx", 0666);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -424,20 +409,14 @@ class acm
|
||||
}
|
||||
$db->sql_freeresult($query_result);
|
||||
|
||||
$file = "<?php\nif (!defined('IN_PHPBB')) exit;\n\n/* " . str_replace('*/', '*\/', $query) . " */\n";
|
||||
$file = "<?php\n\n/* " . str_replace('*/', '*\/', $query) . " */\n";
|
||||
$file .= "\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n";
|
||||
|
||||
fwrite($fp, $file . "\n\$this->sql_rowset[\$query_id] = " . (sizeof($this->sql_rowset[$query_id]) ? "unserialize(" . var_export(serialize($this->sql_rowset[$query_id]), true) . ");" : 'array();') . "\n\n?>");
|
||||
fwrite($fp, $file . "\n\$this->sql_rowset[\$query_id] = " . var_export($this->sql_rowset[$query_id], true) . ";\n?>");
|
||||
@flock($fp, LOCK_UN);
|
||||
fclose($fp);
|
||||
|
||||
if (!function_exists('phpbb_chmod'))
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
include($phpbb_root_path . 'includes/functions.' . $phpEx);
|
||||
}
|
||||
|
||||
phpbb_chmod($filename, CHMOD_READ | CHMOD_WRITE);
|
||||
@chmod($filename, 0666);
|
||||
|
||||
$query_result = $query_id;
|
||||
}
|
||||
@@ -512,7 +491,7 @@ class acm
|
||||
*/
|
||||
function remove_file($filename, $check = false)
|
||||
{
|
||||
if ($check && !@is_writable($this->cache_dir))
|
||||
if ($check && !@is_writeable($this->cache_dir))
|
||||
{
|
||||
// E_USER_ERROR - not using language entry - intended.
|
||||
trigger_error('Unable to remove files within ' . $this->cache_dir . '. Please check directory permissions.', E_USER_ERROR);
|
||||
|
@@ -279,7 +279,7 @@ class acp_attachments
|
||||
{
|
||||
$l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '';
|
||||
}
|
||||
|
||||
|
||||
$content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars);
|
||||
if (empty($content))
|
||||
{
|
||||
@@ -765,8 +765,6 @@ class acp_attachments
|
||||
|
||||
$s_forum_id_options = '';
|
||||
|
||||
/** @todo use in-built function **/
|
||||
|
||||
$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
ORDER BY left_id ASC';
|
||||
@@ -797,7 +795,7 @@ class acp_attachments
|
||||
}
|
||||
else if ($row['left_id'] > $right + 1)
|
||||
{
|
||||
$padding = empty($padding_store[$row['parent_id']]) ? '' : $padding_store[$row['parent_id']];
|
||||
$padding = $padding_store[$row['parent_id']];
|
||||
}
|
||||
|
||||
$right = $row['right_id'];
|
||||
@@ -1003,8 +1001,8 @@ class acp_attachments
|
||||
|
||||
if ($files_added)
|
||||
{
|
||||
set_config_count('upload_dir_size', $space_taken, true);
|
||||
set_config_count('num_files', $files_added, true);
|
||||
set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true);
|
||||
set_config('num_files', $config['num_files'] + $files_added, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1170,7 +1168,7 @@ class acp_attachments
|
||||
$location .= '/';
|
||||
}
|
||||
|
||||
if (@file_exists($location) && @is_readable($location . 'mogrify' . $exe) && @filesize($location . 'mogrify' . $exe) > 3000)
|
||||
if (@is_readable($location . 'mogrify' . $exe) && @filesize($location . 'mogrify' . $exe) > 3000)
|
||||
{
|
||||
$imagick = str_replace('\\', '/', $location);
|
||||
continue;
|
||||
@@ -1198,7 +1196,7 @@ class acp_attachments
|
||||
if (!file_exists($phpbb_root_path . $upload_dir))
|
||||
{
|
||||
@mkdir($phpbb_root_path . $upload_dir, 0777);
|
||||
phpbb_chmod($phpbb_root_path . $upload_dir, CHMOD_READ | CHMOD_WRITE);
|
||||
@chmod($phpbb_root_path . $upload_dir, 0777);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -168,12 +168,6 @@ class acp_bbcodes
|
||||
{
|
||||
trigger_error($user->lang['BBCODE_TAG_DEF_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
if (strlen($bbcode_helpline) > 255)
|
||||
{
|
||||
trigger_error($user->lang['BBCODE_HELPLINE_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$sql_ary = array(
|
||||
'bbcode_tag' => $data['bbcode_tag'],
|
||||
|
@@ -131,7 +131,6 @@ class acp_board
|
||||
'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true),
|
||||
'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'validate' => 'int', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true),
|
||||
'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
|
||||
'pm_max_recipients' => array('lang' => 'PM_MAX_RECIPIENTS', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true),
|
||||
|
||||
'legend2' => 'GENERAL_OPTIONS',
|
||||
'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
@@ -164,8 +163,6 @@ class acp_board
|
||||
'enable_post_confirm' => array('lang' => 'VISUAL_CONFIRM_POST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
|
||||
'legend2' => 'POSTING',
|
||||
'enable_queue_trigger' => array('lang' => 'ENABLE_QUEUE_TRIGGER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'queue_trigger_posts' => array('lang' => 'QUEUE_TRIGGER_POSTS', 'validate' => 'int:0:250', 'type' => 'text:4:4', 'explain' => true),
|
||||
'bump_type' => false,
|
||||
'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
|
||||
'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
@@ -560,14 +557,14 @@ class acp_board
|
||||
{
|
||||
$l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '';
|
||||
}
|
||||
|
||||
|
||||
$content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars);
|
||||
|
||||
|
||||
if (empty($content))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$template->assign_block_vars('options', array(
|
||||
'KEY' => $config_key,
|
||||
'TITLE' => (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'],
|
||||
@@ -680,7 +677,7 @@ class acp_board
|
||||
|
||||
return h_radio('config[ip_check]', $radio_ary, $value, $key);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Select referer validation
|
||||
*/
|
||||
@@ -690,7 +687,7 @@ class acp_board
|
||||
|
||||
return h_radio('config[referer_validation]', $radio_ary, $value, $key);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Select account activation method
|
||||
*/
|
||||
|
@@ -28,26 +28,22 @@ class acp_captcha
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
|
||||
$user->add_lang('acp/board');
|
||||
|
||||
|
||||
$captcha_vars = array(
|
||||
'captcha_gd_x_grid' => 'CAPTCHA_GD_X_GRID',
|
||||
'captcha_gd_y_grid' => 'CAPTCHA_GD_Y_GRID',
|
||||
'captcha_gd_foreground_noise' => 'CAPTCHA_GD_FOREGROUND_NOISE',
|
||||
'captcha_gd' => 'CAPTCHA_GD_PREVIEWED',
|
||||
'captcha_gd_wave' => 'CAPTCHA_GD_WAVE',
|
||||
'captcha_gd_3d_noise' => 'CAPTCHA_GD_3D_NOISE',
|
||||
'captcha_gd_fonts' => 'CAPTCHA_GD_FONTS',
|
||||
|
||||
'captcha_gd' => 'CAPTCHA_GD_PREVIEWED'
|
||||
);
|
||||
|
||||
if (isset($_GET['demo']))
|
||||
{
|
||||
$captcha_vars = array_keys($captcha_vars);
|
||||
|
||||
foreach ($captcha_vars as $captcha_var)
|
||||
{
|
||||
$config[$captcha_var] = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var];
|
||||
}
|
||||
|
||||
if ($config['captcha_gd'])
|
||||
{
|
||||
include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
|
||||
@@ -56,16 +52,14 @@ class acp_captcha
|
||||
{
|
||||
include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
|
||||
}
|
||||
|
||||
$captcha = new captcha();
|
||||
$captcha->execute(gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)), time());
|
||||
$captcha->execute(gen_rand_string(mt_rand(5, 8)), time());
|
||||
exit;
|
||||
}
|
||||
|
||||
$config_vars = array(
|
||||
'enable_confirm' => 'REG_ENABLE',
|
||||
'enable_post_confirm' => 'POST_ENABLE',
|
||||
'confirm_refresh' => 'CONFIRM_REFRESH',
|
||||
'captcha_gd' => 'CAPTCHA_GD',
|
||||
);
|
||||
|
||||
@@ -79,55 +73,44 @@ class acp_captcha
|
||||
if ($submit && check_form_key($form_key))
|
||||
{
|
||||
$config_vars = array_keys($config_vars);
|
||||
|
||||
foreach ($config_vars as $config_var)
|
||||
{
|
||||
set_config($config_var, request_var($config_var, ''));
|
||||
}
|
||||
|
||||
$captcha_vars = array_keys($captcha_vars);
|
||||
|
||||
foreach ($captcha_vars as $captcha_var)
|
||||
{
|
||||
$value = request_var($captcha_var, 0);
|
||||
if ($value >= 0)
|
||||
{
|
||||
set_config($captcha_var, $value);
|
||||
}
|
||||
set_config($captcha_var, request_var($captcha_var, 0));
|
||||
}
|
||||
|
||||
add_log('admin', 'LOG_CONFIG_VISUAL');
|
||||
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
|
||||
}
|
||||
else if ($submit)
|
||||
{
|
||||
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action));
|
||||
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action));
|
||||
}
|
||||
else
|
||||
{
|
||||
$preview_image_src = append_sid(append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&demo=demo"));
|
||||
|
||||
$preview_image_src = append_sid(append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&demo=demo"));
|
||||
if (@extension_loaded('gd'))
|
||||
{
|
||||
$template->assign_var('GD', true);
|
||||
}
|
||||
|
||||
foreach ($config_vars as $config_var => $template_var)
|
||||
{
|
||||
$template->assign_var($template_var, (isset($_REQUEST[$config_var])) ? request_var($config_var, '') : $config[$config_var]) ;
|
||||
}
|
||||
|
||||
foreach ($captcha_vars as $captcha_var => $template_var)
|
||||
{
|
||||
$var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var];
|
||||
$template->assign_var($template_var, $var);
|
||||
$preview_image_src .= "&$captcha_var=" . $var;
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'CAPTCHA_PREVIEW' => $preview_image_src,
|
||||
'PREVIEW' => isset($_POST['preview']),
|
||||
));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ class acp_database
|
||||
{
|
||||
global $cache, $db, $user, $auth, $template, $table_prefix;
|
||||
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
|
||||
|
||||
$user->add_lang('acp/database');
|
||||
|
||||
$this->tpl_name = 'acp_database';
|
||||
@@ -82,7 +82,6 @@ class acp_database
|
||||
}
|
||||
|
||||
@set_time_limit(1200);
|
||||
@set_time_limit(0);
|
||||
|
||||
$time = time();
|
||||
|
||||
@@ -188,7 +187,7 @@ class acp_database
|
||||
$template->assign_vars(array(
|
||||
'U_ACTION' => $this->u_action . '&action=download'
|
||||
));
|
||||
|
||||
|
||||
$available_methods = array('gzip' => 'zlib', 'bzip2' => 'bz2');
|
||||
|
||||
foreach ($available_methods as $type => $module)
|
||||
@@ -425,37 +424,27 @@ class acp_database
|
||||
$dir = $phpbb_root_path . 'store/';
|
||||
$dh = @opendir($dir);
|
||||
|
||||
$backup_files = array();
|
||||
|
||||
if ($dh)
|
||||
{
|
||||
while (($file = readdir($dh)) !== false)
|
||||
{
|
||||
if (preg_match('#^backup_(\d{10,})_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches))
|
||||
{
|
||||
if (in_array($matches[2], $methods))
|
||||
$supported = in_array($matches[2], $methods);
|
||||
|
||||
if ($supported == 'true')
|
||||
{
|
||||
$backup_files[gmdate("d-m-Y H:i:s", $matches[1])] = $file;
|
||||
$template->assign_block_vars('files', array(
|
||||
'FILE' => $file,
|
||||
'NAME' => gmdate("d-m-Y H:i:s", $matches[1]),
|
||||
'SUPPORTED' => $supported
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
|
||||
if (!empty($backup_files))
|
||||
{
|
||||
krsort($backup_files);
|
||||
|
||||
foreach ($backup_files as $name => $file)
|
||||
{
|
||||
$template->assign_block_vars('files', array(
|
||||
'FILE' => $file,
|
||||
'NAME' => $name,
|
||||
'SUPPORTED' => true,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'U_ACTION' => $this->u_action . '&action=submit'
|
||||
));
|
||||
@@ -519,7 +508,7 @@ class base_extractor
|
||||
header('Pragma: no-cache');
|
||||
header("Content-Type: $mimetype; name=\"$name\"");
|
||||
header("Content-disposition: attachment; filename=$name");
|
||||
|
||||
|
||||
switch ($format)
|
||||
{
|
||||
case 'bzip2':
|
||||
@@ -538,14 +527,14 @@ class base_extractor
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($store == true)
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
$file = $phpbb_root_path . 'store/' . $filename . $ext;
|
||||
|
||||
|
||||
$this->fp = $open($file, 'w');
|
||||
|
||||
|
||||
if (!$this->fp)
|
||||
{
|
||||
trigger_error('Unable to write temporary file to storage folder', E_USER_ERROR);
|
||||
@@ -556,7 +545,6 @@ class base_extractor
|
||||
function write_end()
|
||||
{
|
||||
static $close;
|
||||
|
||||
if ($this->store)
|
||||
{
|
||||
if ($close === null)
|
||||
@@ -632,7 +620,7 @@ class mysql_extractor extends base_extractor
|
||||
|
||||
if ($new_extract === null)
|
||||
{
|
||||
if ($db->sql_layer === 'mysqli' || version_compare($db->sql_server_info(true), '3.23.20', '>='))
|
||||
if ($db->sql_layer === 'mysqli' || version_compare($db->mysql_version, '3.23.20', '>='))
|
||||
{
|
||||
$new_extract = true;
|
||||
}
|
||||
@@ -674,11 +662,11 @@ class mysql_extractor extends base_extractor
|
||||
if ($result != false)
|
||||
{
|
||||
$fields_cnt = mysqli_num_fields($result);
|
||||
|
||||
|
||||
// Get field information
|
||||
$field = mysqli_fetch_fields($result);
|
||||
$field_set = array();
|
||||
|
||||
|
||||
for ($j = 0; $j < $fields_cnt; $j++)
|
||||
{
|
||||
$field_set[] = $field[$j]->name;
|
||||
@@ -691,7 +679,7 @@ class mysql_extractor extends base_extractor
|
||||
$first_set = true;
|
||||
$query_len = 0;
|
||||
$max_len = get_usable_memory();
|
||||
|
||||
|
||||
while ($row = mysqli_fetch_row($result))
|
||||
{
|
||||
$values = array();
|
||||
@@ -762,7 +750,7 @@ class mysql_extractor extends base_extractor
|
||||
$field[] = mysql_fetch_field($result, $i);
|
||||
}
|
||||
$field_set = array();
|
||||
|
||||
|
||||
for ($j = 0; $j < $fields_cnt; $j++)
|
||||
{
|
||||
$field_set[] = $field[$j]->name;
|
||||
@@ -978,7 +966,7 @@ class sqlite_extractor extends base_extractor
|
||||
$ar[] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
foreach ($ar as $value)
|
||||
{
|
||||
if (strpos($value['name'], 'autoindex') !== false)
|
||||
@@ -1136,7 +1124,7 @@ class postgres_extractor extends base_extractor
|
||||
$sql_data .= "CREATE SEQUENCE {$table_name}_seq;\n";
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$field_query = "SELECT a.attnum, a.attname as field, t.typname as type, a.attlen as length, a.atttypmod as lengthvar, a.attnotnull as notnull
|
||||
FROM pg_class c, pg_attribute a, pg_type t
|
||||
WHERE c.relname = '" . $db->sql_escape($table_name) . "'
|
||||
@@ -1200,7 +1188,7 @@ class postgres_extractor extends base_extractor
|
||||
{
|
||||
$line .= ' NOT NULL';
|
||||
}
|
||||
|
||||
|
||||
$lines[] = $line;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
@@ -1400,33 +1388,33 @@ class mssql_extractor extends base_extractor
|
||||
$sql_data .= "GO\n";
|
||||
$sql_data .= "\nCREATE TABLE [$table_name] (\n";
|
||||
$rows = array();
|
||||
|
||||
|
||||
$text_flag = false;
|
||||
|
||||
|
||||
$sql = "SELECT COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, COLUMNPROPERTY(object_id(TABLE_NAME), COLUMN_NAME, 'IsIdentity') as IS_IDENTITY
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_NAME = '$table_name'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$line = "\t[{$row['COLUMN_NAME']}] [{$row['DATA_TYPE']}]";
|
||||
|
||||
|
||||
if ($row['DATA_TYPE'] == 'text')
|
||||
{
|
||||
$text_flag = true;
|
||||
}
|
||||
|
||||
|
||||
if ($row['IS_IDENTITY'])
|
||||
{
|
||||
$line .= ' IDENTITY (1 , 1)';
|
||||
}
|
||||
|
||||
|
||||
if ($row['CHARACTER_MAXIMUM_LENGTH'] && $row['DATA_TYPE'] !== 'text')
|
||||
{
|
||||
$line .= ' (' . $row['CHARACTER_MAXIMUM_LENGTH'] . ')';
|
||||
}
|
||||
|
||||
|
||||
if ($row['IS_NULLABLE'] == 'YES')
|
||||
{
|
||||
$line .= ' NULL';
|
||||
@@ -1435,27 +1423,27 @@ class mssql_extractor extends base_extractor
|
||||
{
|
||||
$line .= ' NOT NULL';
|
||||
}
|
||||
|
||||
|
||||
if ($row['COLUMN_DEFAULT'])
|
||||
{
|
||||
$line .= ' DEFAULT ' . $row['COLUMN_DEFAULT'];
|
||||
}
|
||||
|
||||
|
||||
$rows[] = $line;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$sql_data .= implode(",\n", $rows);
|
||||
$sql_data .= "\n) ON [PRIMARY]";
|
||||
|
||||
|
||||
if ($text_flag)
|
||||
{
|
||||
$sql_data .= " TEXTIMAGE_ON [PRIMARY]";
|
||||
}
|
||||
|
||||
|
||||
$sql_data .= "\nGO\n\n";
|
||||
$rows = array();
|
||||
|
||||
|
||||
$sql = "SELECT CONSTRAINT_NAME, COLUMN_NAME
|
||||
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
|
||||
WHERE TABLE_NAME = '$table_name'";
|
||||
@@ -1475,7 +1463,7 @@ class mssql_extractor extends base_extractor
|
||||
$sql_data .= "\n\t) ON [PRIMARY] \nGO\n";
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$index = array();
|
||||
$sql = "EXEC sp_statistics '$table_name'";
|
||||
$result = $db->sql_query($sql);
|
||||
@@ -1487,12 +1475,12 @@ class mssql_extractor extends base_extractor
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
foreach ($index as $index_name => $column_name)
|
||||
{
|
||||
$index[$index_name] = implode(', ', $column_name);
|
||||
}
|
||||
|
||||
|
||||
foreach ($index as $index_name => $columns)
|
||||
{
|
||||
$sql_data .= "\nCREATE INDEX [$index_name] ON [$table_name]($columns) ON [PRIMARY]\nGO\n";
|
||||
@@ -1520,7 +1508,7 @@ class mssql_extractor extends base_extractor
|
||||
$ary_type = $ary_name = array();
|
||||
$ident_set = false;
|
||||
$sql_data = '';
|
||||
|
||||
|
||||
// Grab all of the data from current table.
|
||||
$sql = "SELECT *
|
||||
FROM $table_name";
|
||||
@@ -1614,7 +1602,7 @@ class mssql_extractor extends base_extractor
|
||||
$ary_type = $ary_name = array();
|
||||
$ident_set = false;
|
||||
$sql_data = '';
|
||||
|
||||
|
||||
// Grab all of the data from current table.
|
||||
$sql = "SELECT *
|
||||
FROM $table_name";
|
||||
@@ -1831,7 +1819,7 @@ class oracle_extractor extends base_extractor
|
||||
{
|
||||
global $db;
|
||||
$ary_type = $ary_name = array();
|
||||
|
||||
|
||||
// Grab all of the data from current table.
|
||||
$sql = "SELECT *
|
||||
FROM $table_name";
|
||||
@@ -1927,7 +1915,7 @@ class firebird_extractor extends base_extractor
|
||||
{
|
||||
global $db;
|
||||
$ary_type = $ary_name = array();
|
||||
|
||||
|
||||
// Grab all of the data from current table.
|
||||
$sql = "SELECT *
|
||||
FROM $table_name";
|
||||
@@ -2256,7 +2244,7 @@ function fgetd(&$fp, $delim, $read, $seek, $eof, $buffer = 8192)
|
||||
{
|
||||
$record = '';
|
||||
$delim_len = strlen($delim);
|
||||
|
||||
|
||||
while (!$eof($fp))
|
||||
{
|
||||
$pos = strpos($record, $delim);
|
||||
|
@@ -108,7 +108,7 @@ class acp_email
|
||||
$db->sql_freeresult($result);
|
||||
trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
$i = $j = 0;
|
||||
|
||||
// Send with BCC, no more than 50 recipients for one mail (to not exceed the limit)
|
||||
@@ -121,7 +121,7 @@ class acp_email
|
||||
{
|
||||
if (($row['user_notify_type'] == NOTIFY_EMAIL && $row['user_email']) ||
|
||||
($row['user_notify_type'] == NOTIFY_IM && $row['user_jabber']) ||
|
||||
($row['user_notify_type'] == NOTIFY_BOTH && ($row['user_email'] || $row['user_jabber'])))
|
||||
($row['user_notify_type'] == NOTIFY_BOTH && $row['user_email'] && $row['user_jabber']))
|
||||
{
|
||||
if ($i == $max_chunk_size || $row['user_lang'] != $old_lang || $row['user_notify_type'] != $old_notify_type)
|
||||
{
|
||||
@@ -173,7 +173,7 @@ class acp_email
|
||||
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
|
||||
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
|
||||
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
|
||||
|
||||
|
||||
$messenger->subject(htmlspecialchars_decode($subject));
|
||||
$messenger->set_mail_priority($priority);
|
||||
|
||||
@@ -181,7 +181,7 @@ class acp_email
|
||||
'CONTACT_EMAIL' => $config['board_contact'],
|
||||
'MESSAGE' => htmlspecialchars_decode($message))
|
||||
);
|
||||
|
||||
|
||||
if (!($messenger->send($used_method)))
|
||||
{
|
||||
$errored = true;
|
||||
@@ -239,7 +239,7 @@ class acp_email
|
||||
|
||||
$select_list = '<option value="0"' . ((!$group_id) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_USERS'] . '</option>';
|
||||
$select_list .= group_select_options($group_id, $exclude);
|
||||
|
||||
|
||||
$s_priority_options = '<option value="' . MAIL_LOW_PRIORITY . '">' . $user->lang['MAIL_LOW_PRIORITY'] . '</option>';
|
||||
$s_priority_options .= '<option value="' . MAIL_NORMAL_PRIORITY . '" selected="selected">' . $user->lang['MAIL_NORMAL_PRIORITY'] . '</option>';
|
||||
$s_priority_options .= '<option value="' . MAIL_HIGH_PRIORITY . '">' . $user->lang['MAIL_HIGH_PRIORITY'] . '</option>';
|
||||
|
@@ -154,11 +154,8 @@ class acp_forums
|
||||
if ($forum_data['forum_type'] == FORUM_LINK)
|
||||
{
|
||||
$forum_data['display_on_index'] = request_var('link_display_on_index', false);
|
||||
}
|
||||
|
||||
// Linked forums and categories are not able to be locked...
|
||||
if ($forum_data['forum_type'] == FORUM_LINK || $forum_data['forum_type'] == FORUM_CAT)
|
||||
{
|
||||
// Linked forums are not able to be locked...
|
||||
$forum_data['forum_status'] = ITEM_UNLOCKED;
|
||||
}
|
||||
|
||||
@@ -183,7 +180,7 @@ class acp_forums
|
||||
$forum_perm_from = request_var('forum_perm_from', 0);
|
||||
|
||||
// Copy permissions?
|
||||
if (!empty($forum_perm_from) && $forum_perm_from != $forum_data['forum_id'] &&
|
||||
if ($forum_perm_from && !empty($forum_perm_from) && $forum_perm_from != $forum_data['forum_id'] &&
|
||||
(($action != 'edit') || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))))
|
||||
{
|
||||
// if we edit a forum delete current permissions first
|
||||
@@ -560,12 +557,13 @@ class acp_forums
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_type = ' . FORUM_POST . "
|
||||
AND forum_id <> $forum_id";
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$postable_forum_exists = false;
|
||||
if ($db->sql_fetchrow($result))
|
||||
{
|
||||
$postable_forum_exists = true;
|
||||
$template->assign_vars(array(
|
||||
'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $forum_id, false, true, false))
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
@@ -582,24 +580,25 @@ class acp_forums
|
||||
|
||||
$forums_list = make_forum_select($forum_data['parent_id'], $subforums_id);
|
||||
|
||||
if ($postable_forum_exists)
|
||||
$sql = 'SELECT forum_id
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_type = ' . FORUM_POST . "
|
||||
AND forum_id <> $forum_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($db->sql_fetchrow($result))
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $subforums_id)) // , false, true, false???
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_HAS_SUBFORUMS' => ($forum_data['right_id'] - $forum_data['left_id'] > 1) ? true : false,
|
||||
'S_FORUMS_LIST' => $forums_list)
|
||||
);
|
||||
}
|
||||
else if ($postable_forum_exists)
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $forum_id, false, true, false))
|
||||
);
|
||||
}
|
||||
|
||||
$s_show_display_on_index = false;
|
||||
|
||||
@@ -712,7 +711,7 @@ class acp_forums
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_type = ' . FORUM_POST . "
|
||||
AND forum_id <> $forum_id";
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($db->sql_fetchrow($result))
|
||||
{
|
||||
@@ -805,6 +804,10 @@ class acp_forums
|
||||
|
||||
$url = $this->u_action . "&parent_id=$this->parent_id&f={$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>' : '';
|
||||
|
||||
$template->assign_block_vars('forums', array(
|
||||
'FOLDER_IMAGE' => $folder_image,
|
||||
'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="" />' : '',
|
||||
@@ -882,7 +885,7 @@ class acp_forums
|
||||
*/
|
||||
function update_forum_data(&$forum_data)
|
||||
{
|
||||
global $db, $user, $cache, $phpbb_root_path;
|
||||
global $db, $user, $cache;
|
||||
|
||||
$errors = array();
|
||||
|
||||
@@ -919,14 +922,10 @@ class acp_forums
|
||||
$range_test_ary = array(
|
||||
array('lang' => 'FORUM_TOPICS_PAGE', 'value' => $forum_data['forum_topics_per_page'], 'column_type' => 'TINT:0'),
|
||||
);
|
||||
|
||||
if (!file_exists($phpbb_root_path . $forum_data['forum_image']))
|
||||
{
|
||||
$errors[] = $user->lang['FORUM_IMAGE_NO_EXIST'];
|
||||
}
|
||||
|
||||
validate_range($range_test_ary, $errors);
|
||||
|
||||
|
||||
|
||||
// Set forum flags
|
||||
// 1 = link tracking
|
||||
// 2 = prune old polls
|
||||
@@ -1207,14 +1206,7 @@ class acp_forums
|
||||
|
||||
if ($row['parent_id'] != $forum_data_sql['parent_id'])
|
||||
{
|
||||
if ($row['forum_id'] != $forum_data_sql['parent_id'])
|
||||
{
|
||||
$errors = $this->move_forum($forum_data_sql['forum_id'], $forum_data_sql['parent_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_data_sql['parent_id'] = $row['parent_id'];
|
||||
}
|
||||
$errors = $this->move_forum($forum_data_sql['forum_id'], $forum_data_sql['parent_id']);
|
||||
}
|
||||
|
||||
if (sizeof($errors))
|
||||
@@ -1655,8 +1647,7 @@ class acp_forums
|
||||
$sql = 'SELECT poster_id
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE forum_id = ' . $forum_id . '
|
||||
AND post_postcount = 1
|
||||
AND post_approved = 1';
|
||||
AND post_postcount = 1';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$post_counts = array();
|
||||
@@ -1777,7 +1768,6 @@ class acp_forums
|
||||
WHERE user_id = ' . $poster_id . '
|
||||
AND user_posts < ' . $substract;
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET user_posts = user_posts - ' . $substract . '
|
||||
WHERE user_id = ' . $poster_id . '
|
||||
@@ -1821,7 +1811,7 @@ class acp_forums
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
set_config('upload_dir_size', (float) $row['stat'], true);
|
||||
set_config('upload_dir_size', (int) $row['stat'], true);
|
||||
|
||||
return array();
|
||||
}
|
||||
|
@@ -88,7 +88,7 @@ class acp_groups
|
||||
// Approve, demote or promote
|
||||
$group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
|
||||
$error = group_user_attributes($action, $group_id, $mark_ary, false, $group_name);
|
||||
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
switch ($action)
|
||||
@@ -112,7 +112,7 @@ class acp_groups
|
||||
{
|
||||
trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&action=list&g=' . $group_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'default':
|
||||
@@ -180,17 +180,13 @@ class acp_groups
|
||||
|
||||
case 'deleteusers':
|
||||
case 'delete':
|
||||
if (!$group_id)
|
||||
{
|
||||
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
else if ($action === 'delete' && $group_row['group_type'] == GROUP_SPECIAL)
|
||||
{
|
||||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
if (confirm_box(true))
|
||||
{
|
||||
if (!$group_id)
|
||||
{
|
||||
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$error = '';
|
||||
|
||||
switch ($action)
|
||||
@@ -307,7 +303,6 @@ class acp_groups
|
||||
'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0,
|
||||
'legend' => isset($_REQUEST['group_legend']) ? 1 : 0,
|
||||
'message_limit' => request_var('group_message_limit', 0),
|
||||
'max_recipients' => request_var('group_max_recipients', 0),
|
||||
'founder_manage' => 0,
|
||||
);
|
||||
|
||||
@@ -400,7 +395,7 @@ class acp_groups
|
||||
// were made.
|
||||
|
||||
$group_attributes = array();
|
||||
$test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'max_recipients', 'founder_manage');
|
||||
$test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'founder_manage');
|
||||
foreach ($test_variables as $test)
|
||||
{
|
||||
if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test]))
|
||||
@@ -560,7 +555,6 @@ class acp_groups
|
||||
'GROUP_FOUNDER_MANAGE' => (isset($group_row['group_founder_manage']) && $group_row['group_founder_manage']) ? ' checked="checked"' : '',
|
||||
'GROUP_LEGEND' => (isset($group_row['group_legend']) && $group_row['group_legend']) ? ' checked="checked"' : '',
|
||||
'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0,
|
||||
'GROUP_MAX_RECIPIENTS' => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0,
|
||||
'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '',
|
||||
|
||||
|
||||
@@ -753,14 +747,14 @@ class acp_groups
|
||||
foreach ($row_ary as $group_id => $row)
|
||||
{
|
||||
$group_name = (!empty($user->lang['G_' . $row['group_name']]))? $user->lang['G_' . $row['group_name']] : $row['group_name'];
|
||||
|
||||
|
||||
$template->assign_block_vars('groups', array(
|
||||
'U_LIST' => "{$this->u_action}&action=list&g=$group_id",
|
||||
'U_EDIT' => "{$this->u_action}&action=edit&g=$group_id",
|
||||
'U_DELETE' => ($auth->acl_get('a_groupdel')) ? "{$this->u_action}&action=delete&g=$group_id" : '',
|
||||
|
||||
'S_GROUP_SPECIAL' => ($row['group_type'] == GROUP_SPECIAL) ? true : false,
|
||||
|
||||
|
||||
'GROUP_NAME' => $group_name,
|
||||
'TOTAL_MEMBERS' => $row['total_members'],
|
||||
)
|
||||
|
@@ -73,13 +73,6 @@ class acp_icons
|
||||
|
||||
foreach ($imglist as $path => $img_ary)
|
||||
{
|
||||
if (empty($img_ary))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
asort($img_ary, SORT_STRING);
|
||||
|
||||
foreach ($img_ary as $img)
|
||||
{
|
||||
$img_size = getimagesize($phpbb_root_path . $img_path . '/' . $path . $img);
|
||||
@@ -106,11 +99,6 @@ class acp_icons
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
|
||||
if (!empty($_paks))
|
||||
{
|
||||
asort($_paks, SORT_STRING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -111,7 +111,6 @@ class acp_inactive
|
||||
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
|
||||
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
|
||||
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
|
||||
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($row['username']))
|
||||
@@ -162,11 +161,7 @@ class acp_inactive
|
||||
|
||||
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type, user_regdate, user_actkey
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('user_id', $mark) . '
|
||||
AND user_inactive_reason';
|
||||
|
||||
$sql .= ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? ' = ' . INACTIVE_REMIND : ' <> ' . INACTIVE_MANUAL;
|
||||
|
||||
WHERE ' . $db->sql_in_set('user_id', $mark);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
@@ -184,14 +179,9 @@ class acp_inactive
|
||||
$messenger->to($row['user_email'], $row['username']);
|
||||
$messenger->im($row['user_jabber'], $row['username']);
|
||||
|
||||
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
|
||||
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
|
||||
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
|
||||
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($row['username']),
|
||||
'REGISTER_DATE' => $user->format_date($row['user_regdate'], false, true),
|
||||
'REGISTER_DATE' => $user->format_date($row['user_regdate']),
|
||||
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey'])
|
||||
);
|
||||
|
||||
|
@@ -85,20 +85,6 @@ class acp_jabber
|
||||
|
||||
$jabber->disconnect();
|
||||
}
|
||||
else
|
||||
{
|
||||
// This feature is disabled.
|
||||
// We update the user table to be sure all users that have IM as notify type are set to both as notify type
|
||||
// We set this to both because users still have their jabber address entered and may want to receive jabber notifications again once it is re-enabled.
|
||||
$sql_ary = array(
|
||||
'user_notify_type' => NOTIFY_BOTH,
|
||||
);
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
WHERE user_notify_type = ' . NOTIFY_IM;
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
set_config('jab_enable', $jab_enable);
|
||||
set_config('jab_host', $jab_host);
|
||||
|
@@ -181,7 +181,7 @@ class acp_language
|
||||
case 'submit_file':
|
||||
case 'download_file':
|
||||
case 'upload_data':
|
||||
|
||||
|
||||
if (!$submit || !check_form_key($form_name))
|
||||
{
|
||||
trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
|
||||
@@ -261,16 +261,16 @@ class acp_language
|
||||
if (!$safe_mode)
|
||||
{
|
||||
$mkdir_ary = array('language', 'language/' . $row['lang_iso']);
|
||||
|
||||
|
||||
if ($this->language_directory)
|
||||
{
|
||||
$mkdir_ary[] = 'language/' . $row['lang_iso'] . '/' . $this->language_directory;
|
||||
}
|
||||
|
||||
|
||||
foreach ($mkdir_ary as $dir)
|
||||
{
|
||||
$dir = $phpbb_root_path . 'store/' . $dir;
|
||||
|
||||
|
||||
if (!is_dir($dir))
|
||||
{
|
||||
if (!@mkdir($dir, 0777))
|
||||
@@ -316,7 +316,7 @@ class acp_language
|
||||
}
|
||||
|
||||
$entry = "\tarray(\n";
|
||||
|
||||
|
||||
foreach ($value as $_key => $_value)
|
||||
{
|
||||
$entry .= "\t\t" . (int) $_key . "\t=> '" . $this->prepare_lang_entry($_value) . "',\n";
|
||||
@@ -433,7 +433,7 @@ class acp_language
|
||||
{
|
||||
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
$this->page_title = 'LANGUAGE_PACK_DETAILS';
|
||||
|
||||
$sql = 'SELECT *
|
||||
@@ -442,7 +442,7 @@ class acp_language
|
||||
$result = $db->sql_query($sql);
|
||||
$lang_entries = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$lang_iso = $lang_entries['lang_iso'];
|
||||
$missing_vars = $missing_files = array();
|
||||
|
||||
@@ -488,7 +488,7 @@ class acp_language
|
||||
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isset($_POST['remove_store']))
|
||||
{
|
||||
$store_filename = $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true);
|
||||
@@ -532,7 +532,7 @@ class acp_language
|
||||
if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file)))
|
||||
{
|
||||
$missing_vars[$file] = $this->compare_language_files($config['default_lang'], $lang_iso, '', $file);
|
||||
|
||||
|
||||
if (sizeof($missing_vars[$file]))
|
||||
{
|
||||
$is_missing_var = true;
|
||||
@@ -550,7 +550,7 @@ class acp_language
|
||||
if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'acp', $file)))
|
||||
{
|
||||
$missing_vars['acp/' . $file] = $this->compare_language_files($config['default_lang'], $lang_iso, 'acp', $file);
|
||||
|
||||
|
||||
if (sizeof($missing_vars['acp/' . $file]))
|
||||
{
|
||||
$is_missing_var = true;
|
||||
@@ -569,7 +569,7 @@ class acp_language
|
||||
if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'mods', $file)))
|
||||
{
|
||||
$missing_vars['mods/' . $file] = $this->compare_language_files($config['default_lang'], $lang_iso, 'mods', $file);
|
||||
|
||||
|
||||
if (sizeof($missing_vars['mods/' . $file]))
|
||||
{
|
||||
$is_missing_var = true;
|
||||
@@ -581,7 +581,7 @@ class acp_language
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// More missing files... for example email templates?
|
||||
foreach ($email_files as $file)
|
||||
{
|
||||
@@ -1046,7 +1046,7 @@ class acp_language
|
||||
$compress->add_data('', 'language/' . $row['lang_iso'] . '/index.html');
|
||||
$compress->add_data('', 'language/' . $row['lang_iso'] . '/email/index.html');
|
||||
$compress->add_data('', 'language/' . $row['lang_iso'] . '/acp/index.html');
|
||||
|
||||
|
||||
if (sizeof($mod_files))
|
||||
{
|
||||
$compress->add_data('', 'language/' . $row['lang_iso'] . '/mods/index.html');
|
||||
@@ -1208,7 +1208,7 @@ $lang = array_merge($lang, array(
|
||||
function get_filename($lang_iso, $directory, $filename, $check_store = false, $only_return_filename = false)
|
||||
{
|
||||
global $phpbb_root_path, $safe_mode;
|
||||
|
||||
|
||||
$check_filename = "language/$lang_iso/" . (($directory) ? $directory . '/' : '') . $filename;
|
||||
|
||||
if ($check_store)
|
||||
|
@@ -166,9 +166,9 @@ class acp_main
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE is_orphan = 0';
|
||||
$result = $db->sql_query($sql);
|
||||
set_config('upload_dir_size', (float) $db->sql_fetchfield('stat'), true);
|
||||
set_config('upload_dir_size', (int) $db->sql_fetchfield('stat'), true);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
if (!function_exists('update_last_username'))
|
||||
{
|
||||
include($phpbb_root_path . "includes/functions_user.$phpEx");
|
||||
@@ -184,63 +184,22 @@ class acp_main
|
||||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
// Resync post counts
|
||||
$start = $max_post_id = 0;
|
||||
|
||||
// Find the maximum post ID, we can only stop the cycle when we've reached it
|
||||
$sql = 'SELECT MAX(forum_last_post_id) as max_post_id
|
||||
FROM ' . FORUMS_TABLE;
|
||||
$sql = 'SELECT COUNT(p.post_id) AS num_posts, u.user_id
|
||||
FROM ' . USERS_TABLE . ' u
|
||||
LEFT JOIN ' . POSTS_TABLE . ' p ON (u.user_id = p.poster_id AND p.post_postcount = 1)
|
||||
GROUP BY u.user_id';
|
||||
$result = $db->sql_query($sql);
|
||||
$max_post_id = (int) $db->sql_fetchfield('max_post_id');
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$db->sql_query('UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['user_id']}");
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// No maximum post id? :o
|
||||
if (!$max_post_id)
|
||||
{
|
||||
$sql = 'SELECT MAX(post_id)
|
||||
FROM ' . POSTS_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
$max_post_id = (int) $db->sql_fetchfield('max_post_id');
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
// Still no maximum post id? Then we are finished
|
||||
if (!$max_post_id)
|
||||
{
|
||||
add_log('admin', 'LOG_RESYNC_POSTCOUNTS');
|
||||
break;
|
||||
}
|
||||
|
||||
$step = ($config['num_posts']) ? (max((int) ($config['num_posts'] / 5), 20000)) : 20000;
|
||||
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_posts = 0');
|
||||
|
||||
while ($start < $max_post_id)
|
||||
{
|
||||
$sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE post_id BETWEEN ' . ($start + 1) . ' AND ' . ($start + $step) . '
|
||||
AND post_postcount = 1 AND post_approved = 1
|
||||
GROUP BY poster_id';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . " SET user_posts = user_posts + {$row['num_posts']} WHERE user_id = {$row['poster_id']}";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$start += $step;
|
||||
}
|
||||
|
||||
add_log('admin', 'LOG_RESYNC_POSTCOUNTS');
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'date':
|
||||
if (!$auth->acl_get('a_board'))
|
||||
{
|
||||
@@ -250,7 +209,7 @@ class acp_main
|
||||
set_config('board_startdate', time() - 1);
|
||||
add_log('admin', 'LOG_RESET_DATE');
|
||||
break;
|
||||
|
||||
|
||||
case 'db_track':
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
@@ -272,7 +231,7 @@ class acp_main
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_type <> ' . FORUM_CAT;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
||||
$forum_ids = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
@@ -322,7 +281,7 @@ class acp_main
|
||||
$db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
add_log('admin', 'LOG_RESYNC_POST_MARKING');
|
||||
break;
|
||||
|
||||
@@ -361,7 +320,7 @@ class acp_main
|
||||
$files_per_day = sprintf('%.2f', $total_files / $boarddays);
|
||||
|
||||
$upload_dir_size = get_formatted_filesize($config['upload_dir_size']);
|
||||
|
||||
|
||||
$avatar_dir_size = 0;
|
||||
|
||||
if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path']))
|
||||
@@ -504,18 +463,6 @@ class acp_main
|
||||
$template->assign_var('S_REMOVE_INSTALL', true);
|
||||
}
|
||||
|
||||
if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && is_writable($phpbb_root_path . 'config.' . $phpEx))
|
||||
{
|
||||
// World-Writable? (000x)
|
||||
$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x0002));
|
||||
}
|
||||
|
||||
// Fill dbms version if not yet filled
|
||||
if (empty($config['dbms_version']))
|
||||
{
|
||||
set_config('dbms_version', $db->sql_server_info(true));
|
||||
}
|
||||
|
||||
$this->tpl_name = 'acp_main';
|
||||
$this->page_title = 'ACP_MAIN';
|
||||
}
|
||||
|
@@ -658,8 +658,6 @@ class acp_modules
|
||||
|
||||
$iteration++;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
unset($padding_store);
|
||||
|
||||
return $module_list;
|
||||
|
@@ -23,7 +23,7 @@ class acp_permissions
|
||||
{
|
||||
var $u_action;
|
||||
var $permission_dropdown;
|
||||
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
@@ -94,7 +94,7 @@ class acp_permissions
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
|
||||
// Map usernames to ids and vice versa
|
||||
if ($usernames)
|
||||
{
|
||||
@@ -112,7 +112,7 @@ class acp_permissions
|
||||
}
|
||||
}
|
||||
unset($username);
|
||||
|
||||
|
||||
// Build forum ids (of all forums are checked or subforum listing used)
|
||||
if ($all_forums)
|
||||
{
|
||||
@@ -369,8 +369,8 @@ class acp_permissions
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_SELECT_GROUP' => true,
|
||||
'S_GROUP_OPTIONS' => group_select_options(false, false, false), // Show all groups
|
||||
));
|
||||
'S_GROUP_OPTIONS' => group_select_options(false, false, (($user->data['user_type'] == USER_FOUNDER) ? false : 0)))
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
@@ -415,7 +415,7 @@ class acp_permissions
|
||||
'S_SELECT_USERGROUP_VIEW' => ($victim == 'usergroup_view') ? true : false,
|
||||
'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'],
|
||||
'S_DEFINED_GROUP_OPTIONS' => $items['group_ids_options'],
|
||||
'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids'], false), // Show all groups
|
||||
'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids'], (($user->data['user_type'] == USER_FOUNDER) ? false : 0)),
|
||||
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username&select_single=true'),
|
||||
));
|
||||
|
||||
@@ -528,7 +528,7 @@ class acp_permissions
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if ($branch_there)
|
||||
{
|
||||
$s_options .= ' [' . $user->lang['PLUS_SUBFORUMS'] . ']';
|
||||
@@ -539,14 +539,14 @@ class acp_permissions
|
||||
|
||||
return $s_options;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build dropdown field for changing permission types
|
||||
*/
|
||||
function build_permission_dropdown($options, $default_option, $permission_scope)
|
||||
{
|
||||
global $user, $auth;
|
||||
|
||||
|
||||
$s_dropdown_options = '';
|
||||
foreach ($options as $setting)
|
||||
{
|
||||
@@ -626,7 +626,7 @@ class acp_permissions
|
||||
{
|
||||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
$ug_id = $forum_id = 0;
|
||||
|
||||
// We loop through the auth settings defined in our submit
|
||||
@@ -762,14 +762,7 @@ class acp_permissions
|
||||
|
||||
$this->log_action($mode, 'add', $permission_type, $ug_type, $ug_ids, $forum_ids);
|
||||
|
||||
if ($mode == 'setting_forum_local' || $mode == 'setting_mod_local')
|
||||
{
|
||||
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action . '&forum_id[]=' . implode('&forum_id[]=', $forum_ids)));
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
|
||||
}
|
||||
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -816,7 +809,7 @@ class acp_permissions
|
||||
function remove_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id, &$forum_id)
|
||||
{
|
||||
global $user, $db, $auth;
|
||||
|
||||
|
||||
// User or group to be set?
|
||||
$ug_type = (sizeof($user_id)) ? 'user' : 'group';
|
||||
|
||||
@@ -836,14 +829,7 @@ class acp_permissions
|
||||
|
||||
$this->log_action($mode, 'del', $permission_type, $ug_type, (($ug_type == 'user') ? $user_id : $group_id), (sizeof($forum_id) ? $forum_id : array(0 => 0)));
|
||||
|
||||
if ($mode == 'setting_forum_local' || $mode == 'setting_mod_local')
|
||||
{
|
||||
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action . '&forum_id[]=' . implode('&forum_id[]=', $forum_id)));
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
|
||||
}
|
||||
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1164,11 +1150,7 @@ class acp_permissions
|
||||
{
|
||||
$sql_where = 'AND (' . $db->sql_in_set('a.auth_option_id', $option_ids) . ' OR ' . $db->sql_in_set('a.auth_role_id', $role_ids) . ')';
|
||||
}
|
||||
else if (sizeof($role_ids))
|
||||
{
|
||||
$sql_where = 'AND ' . $db->sql_in_set('a.auth_role_id', $role_ids);
|
||||
}
|
||||
else if (sizeof($option_ids))
|
||||
else
|
||||
{
|
||||
$sql_where = 'AND ' . $db->sql_in_set('a.auth_option_id', $option_ids);
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ class acp_profile
|
||||
FROM ' . PROFILE_LANG_TABLE . '
|
||||
ORDER BY lang_id';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
// Which languages are available for each item
|
||||
@@ -206,7 +206,7 @@ class acp_profile
|
||||
'field_id' => $field_id,
|
||||
)));
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'activate':
|
||||
@@ -216,7 +216,7 @@ class acp_profile
|
||||
{
|
||||
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
$sql = 'SELECT lang_id
|
||||
FROM ' . LANG_TABLE . "
|
||||
WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
|
||||
@@ -253,7 +253,7 @@ class acp_profile
|
||||
{
|
||||
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
|
||||
$sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . "
|
||||
SET field_active = 0
|
||||
WHERE field_id = $field_id";
|
||||
@@ -285,7 +285,7 @@ class acp_profile
|
||||
|
||||
case 'create':
|
||||
case 'edit':
|
||||
|
||||
|
||||
$field_id = request_var('field_id', 0);
|
||||
$step = request_var('step', 1);
|
||||
|
||||
@@ -354,19 +354,18 @@ class acp_profile
|
||||
{
|
||||
// We are adding a new field, define basic params
|
||||
$lang_options = $field_row = array();
|
||||
|
||||
|
||||
$field_type = request_var('field_type', 0);
|
||||
|
||||
|
||||
if (!$field_type)
|
||||
{
|
||||
trigger_error($user->lang['NO_FIELD_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$field_row = array_merge($default_values[$field_type], array(
|
||||
'field_ident' => str_replace(' ', '_', utf8_clean_string(request_var('field_ident', '', true))),
|
||||
'field_ident' => utf8_clean_string(request_var('field_ident', '', true)),
|
||||
'field_required' => 0,
|
||||
'field_hide' => 0,
|
||||
'field_show_profile'=> 0,
|
||||
'field_no_view' => 0,
|
||||
'field_show_on_reg' => 0,
|
||||
'lang_name' => utf8_normalize_nfc(request_var('field_ident', '', true)),
|
||||
@@ -379,7 +378,7 @@ class acp_profile
|
||||
|
||||
// $exclude contains the data we gather in each step
|
||||
$exclude = array(
|
||||
1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'),
|
||||
1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option', 'field_no_view'),
|
||||
2 => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'),
|
||||
3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options')
|
||||
);
|
||||
@@ -401,20 +400,25 @@ class acp_profile
|
||||
$cp->vars['lang_explain'] = utf8_normalize_nfc(request_var('lang_explain', $field_row['lang_explain'], true));
|
||||
$cp->vars['lang_default_value'] = utf8_normalize_nfc(request_var('lang_default_value', $field_row['lang_default_value'], true));
|
||||
|
||||
// Visibility Options...
|
||||
$visibility_ary = array(
|
||||
'field_required',
|
||||
'field_show_on_reg',
|
||||
'field_show_profile',
|
||||
'field_hide',
|
||||
);
|
||||
|
||||
foreach ($visibility_ary as $val)
|
||||
// Field option...
|
||||
if (isset($_REQUEST['field_option']))
|
||||
{
|
||||
$cp->vars[$val] = ($submit || $save) ? request_var($val, 0) : $field_row[$val];
|
||||
$field_option = request_var('field_option', '');
|
||||
|
||||
$cp->vars['field_required'] = ($field_option == 'field_required') ? 1 : 0;
|
||||
$cp->vars['field_show_on_reg'] = ($field_option == 'field_show_on_reg') ? 1 : 0;
|
||||
$cp->vars['field_hide'] = ($field_option == 'field_hide') ? 1 : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$cp->vars['field_required'] = $field_row['field_required'];
|
||||
$cp->vars['field_show_on_reg'] = $field_row['field_show_on_reg'];
|
||||
$cp->vars['field_hide'] = $field_row['field_hide'];
|
||||
|
||||
$field_option = ($field_row['field_required']) ? 'field_required' : (($field_row['field_show_on_reg']) ? 'field_show_on_reg' : (($field_row['field_hide']) ? 'field_hide' : ''));
|
||||
}
|
||||
|
||||
$cp->vars['field_no_view'] = request_var('field_no_view', (int) $field_row['field_no_view']);
|
||||
$cp->vars['field_no_view'] = request_var('field_no_view', $field_row['field_no_view']);
|
||||
|
||||
// A boolean field expects an array as the lang options
|
||||
if ($field_type == FIELD_BOOL)
|
||||
@@ -477,7 +481,7 @@ class acp_profile
|
||||
else if ($field_type == FIELD_DATE && $key == 'field_default_value')
|
||||
{
|
||||
$always_now = request_var('always_now', -1);
|
||||
|
||||
|
||||
if ($always_now == 1 || ($always_now === -1 && $var == 'now'))
|
||||
{
|
||||
$now = getdate();
|
||||
@@ -500,7 +504,7 @@ class acp_profile
|
||||
{
|
||||
list($cp->vars['field_default_value_day'], $cp->vars['field_default_value_month'], $cp->vars['field_default_value_year']) = explode('-', $var);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* else if ($field_type == FIELD_BOOL && $key == 'field_default_value')
|
||||
{
|
||||
@@ -529,7 +533,7 @@ class acp_profile
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
|
||||
$sql = 'SELECT lang_id, lang_name, lang_explain, lang_default_value
|
||||
FROM ' . PROFILE_LANG_TABLE . '
|
||||
WHERE lang_id <> ' . $this->edit_lang_id . "
|
||||
@@ -546,7 +550,7 @@ class acp_profile
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
|
||||
foreach ($exclude[3] as $key)
|
||||
{
|
||||
$cp->vars[$key] = utf8_normalize_nfc(request_var($key, array(0 => ''), true));
|
||||
@@ -565,7 +569,7 @@ class acp_profile
|
||||
{
|
||||
$cp->vars[$key][$lang_id] = explode("\n", $options);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -705,7 +709,7 @@ class acp_profile
|
||||
|
||||
'L_TITLE' => $user->lang['STEP_' . $step . '_TITLE_' . strtoupper($action)],
|
||||
'L_EXPLAIN' => $user->lang['STEP_' . $step . '_EXPLAIN_' . strtoupper($action)],
|
||||
|
||||
|
||||
'U_ACTION' => $this->u_action . "&action=$action&step=$step",
|
||||
'U_BACK' => $this->u_action)
|
||||
);
|
||||
@@ -715,14 +719,13 @@ class acp_profile
|
||||
{
|
||||
// Create basic options - only small differences between field types
|
||||
case 1:
|
||||
|
||||
|
||||
// Build common create options
|
||||
$template->assign_vars(array(
|
||||
'S_STEP_ONE' => true,
|
||||
'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false,
|
||||
'S_SHOW_ON_REG' => ($cp->vars['field_show_on_reg']) ? true : false,
|
||||
'S_FIELD_HIDE' => ($cp->vars['field_hide']) ? true : false,
|
||||
'S_SHOW_PROFILE' => ($cp->vars['field_show_profile']) ? true : false,
|
||||
'S_FIELD_NO_VIEW' => ($cp->vars['field_no_view']) ? true : false,
|
||||
|
||||
'L_LANG_SPECIFIC' => sprintf($user->lang['LANG_SPECIFIC_OPTIONS'], $config['default_lang']),
|
||||
@@ -743,7 +746,7 @@ class acp_profile
|
||||
'LANG_DEFAULT_VALUE' => $cp->vars['lang_default_value'])
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($field_type == FIELD_BOOL || $field_type == FIELD_DROPDOWN)
|
||||
{
|
||||
// Initialize these array elements if we are creating a new field
|
||||
@@ -772,11 +775,11 @@ class acp_profile
|
||||
'SECOND_LANG_OPTION' => ($field_type == FIELD_BOOL) ? $cp->vars['lang_options'][1] : '')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_STEP_TWO' => true,
|
||||
'L_NEXT_STEP' => (sizeof($this->lang_defs['iso']) == 1) ? $user->lang['SAVE'] : $user->lang['PROFILE_LANG_OPTIONS'])
|
||||
@@ -814,7 +817,7 @@ class acp_profile
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -826,7 +829,7 @@ class acp_profile
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . PROFILE_FIELDS_TABLE . '
|
||||
ORDER BY field_order';
|
||||
@@ -902,14 +905,14 @@ class acp_profile
|
||||
$languages[$row['lang_id']] = $row['lang_iso'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
$options = array();
|
||||
$options['lang_name'] = 'string';
|
||||
if ($cp->vars['lang_explain'])
|
||||
{
|
||||
$options['lang_explain'] = 'text';
|
||||
}
|
||||
|
||||
|
||||
switch ($field_type)
|
||||
{
|
||||
case FIELD_BOOL:
|
||||
@@ -919,7 +922,7 @@ class acp_profile
|
||||
case FIELD_DROPDOWN:
|
||||
$options['lang_options'] = 'optionfield';
|
||||
break;
|
||||
|
||||
|
||||
case FIELD_TEXT:
|
||||
case FIELD_STRING:
|
||||
if ($cp->vars['lang_default_value'])
|
||||
@@ -928,7 +931,7 @@ class acp_profile
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$lang_options = array();
|
||||
|
||||
foreach ($options as $field => $field_type)
|
||||
@@ -954,7 +957,7 @@ class acp_profile
|
||||
if ($field == 'lang_options')
|
||||
{
|
||||
$var = (!isset($cp->vars['l_lang_options'][$lang_id]) || !is_array($cp->vars['l_lang_options'][$lang_id])) ? $cp->vars['lang_options'] : $cp->vars['l_lang_options'][$lang_id];
|
||||
|
||||
|
||||
switch ($field_type)
|
||||
{
|
||||
case 'two_options':
|
||||
@@ -975,7 +978,7 @@ class acp_profile
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (isset($user->lang['CP_' . strtoupper($field) . '_EXPLAIN']))
|
||||
{
|
||||
$lang_options[$lang_id]['fields'][$field]['EXPLAIN'] = $user->lang['CP_' . strtoupper($field) . '_EXPLAIN'];
|
||||
@@ -989,7 +992,7 @@ class acp_profile
|
||||
'TITLE' => $user->lang['CP_' . strtoupper($field)],
|
||||
'FIELD' => ($field_type == 'string') ? '<dd><input class="medium" type="text" name="l_' . $field . '[' . $lang_id . ']" value="' . ((isset($value[$lang_id])) ? $value[$lang_id] : $var) . '" /></dd>' : '<dd><textarea name="l_' . $field . '[' . $lang_id . ']" rows="3" cols="80">' . ((isset($value[$lang_id])) ? $value[$lang_id] : $var) . '</textarea></dd>'
|
||||
);
|
||||
|
||||
|
||||
if (isset($user->lang['CP_' . strtoupper($field) . '_EXPLAIN']))
|
||||
{
|
||||
$lang_options[$lang_id]['fields'][$field]['EXPLAIN'] = $user->lang['CP_' . strtoupper($field) . '_EXPLAIN'];
|
||||
@@ -1037,7 +1040,6 @@ class acp_profile
|
||||
'field_required' => $cp->vars['field_required'],
|
||||
'field_show_on_reg' => $cp->vars['field_show_on_reg'],
|
||||
'field_hide' => $cp->vars['field_hide'],
|
||||
'field_show_profile' => $cp->vars['field_show_profile'],
|
||||
'field_no_view' => $cp->vars['field_no_view']
|
||||
);
|
||||
|
||||
@@ -1063,7 +1065,7 @@ class acp_profile
|
||||
WHERE field_id = $field_id";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
$field_ident = 'pf_' . $field_ident;
|
||||
@@ -1080,7 +1082,7 @@ class acp_profile
|
||||
{
|
||||
$sql_ary['field_id'] = $field_id;
|
||||
$sql_ary['lang_id'] = $default_lang_id;
|
||||
|
||||
|
||||
$profile_sql[] = 'INSERT INTO ' . PROFILE_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
||||
}
|
||||
else
|
||||
@@ -1153,7 +1155,7 @@ class acp_profile
|
||||
AND lang_id = " . (int) $default_lang_id;
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
|
||||
foreach ($cp->vars['lang_options'] as $option_id => $value)
|
||||
{
|
||||
$sql_ary = array(
|
||||
@@ -1256,7 +1258,7 @@ class acp_profile
|
||||
$lang_id = $sql['lang_id'];
|
||||
$option_id = $sql['option_id'];
|
||||
unset($sql['lang_id'], $sql['field_id'], $sql['option_id']);
|
||||
|
||||
|
||||
$this->update_insert(PROFILE_FIELDS_LANG_TABLE, $sql, array(
|
||||
'lang_id' => $lang_id,
|
||||
'field_id' => $field_id,
|
||||
@@ -1276,7 +1278,7 @@ class acp_profile
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$db->sql_transaction('commit');
|
||||
|
||||
if ($action == 'edit')
|
||||
@@ -1322,7 +1324,7 @@ class acp_profile
|
||||
if (!$row)
|
||||
{
|
||||
$sql_ary = array_merge($where_fields, $sql_ary);
|
||||
|
||||
|
||||
if (sizeof($sql_ary))
|
||||
{
|
||||
$db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql_ary));
|
||||
@@ -1374,7 +1376,7 @@ class acp_profile
|
||||
case FIELD_BOOL:
|
||||
$sql .= 'TINYINT(2) ';
|
||||
break;
|
||||
|
||||
|
||||
case FIELD_DROPDOWN:
|
||||
$sql .= 'MEDIUMINT(8) ';
|
||||
break;
|
||||
@@ -1539,7 +1541,7 @@ class acp_profile
|
||||
case 'firebird':
|
||||
|
||||
// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
|
||||
$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' ADD "' . strtoupper($field_ident) . '" ';
|
||||
$sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD \"$field_ident\" ";
|
||||
|
||||
switch ($field_type)
|
||||
{
|
||||
@@ -1610,4 +1612,4 @@ class acp_profile
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@@ -63,7 +63,6 @@ class acp_search
|
||||
'load_search' => 'bool',
|
||||
'limit_search_load' => 'float',
|
||||
'min_search_author_chars' => 'integer',
|
||||
'max_num_search_keywords' => 'integer',
|
||||
'search_store_results' => 'integer',
|
||||
);
|
||||
|
||||
@@ -217,7 +216,6 @@ class acp_search
|
||||
'SEARCH_INTERVAL' => (float) $config['search_interval'],
|
||||
'SEARCH_GUEST_INTERVAL' => (float) $config['search_anonymous_interval'],
|
||||
'SEARCH_STORE_RESULTS' => (int) $config['search_store_results'],
|
||||
'MAX_NUM_SEARCH_KEYWORDS' => (int) $config['max_num_search_keywords'],
|
||||
|
||||
'S_SEARCH_TYPES' => $search_options,
|
||||
'S_YES_SEARCH' => (bool) $config['load_search'],
|
||||
@@ -593,7 +591,7 @@ class acp_search
|
||||
|
||||
ksort($this->state);
|
||||
|
||||
set_config('search_indexing_state', implode(',', $this->state), true);
|
||||
set_config('search_indexing_state', implode(',', $this->state));
|
||||
}
|
||||
|
||||
/**
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -634,7 +634,7 @@ class acp_users
|
||||
|
||||
if (sizeof($topic_id_ary))
|
||||
{
|
||||
sync('topic_reported', 'topic_id', $topic_id_ary);
|
||||
sync('reported', 'topic_id', $topic_id_ary);
|
||||
sync('topic', 'topic_id', $topic_id_ary);
|
||||
}
|
||||
|
||||
@@ -891,19 +891,9 @@ class acp_users
|
||||
}
|
||||
}
|
||||
|
||||
// Posts in Queue
|
||||
$sql = 'SELECT COUNT(post_id) as posts_in_queue
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE poster_id = ' . $user_id . '
|
||||
AND post_approved = 0';
|
||||
$result = $db->sql_query($sql);
|
||||
$user_row['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'L_NAME_CHARS_EXPLAIN' => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
|
||||
'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
|
||||
'L_POSTS_IN_QUEUE' => $user->lang('NUM_POSTS_IN_QUEUE', $user_row['posts_in_queue']),
|
||||
'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
|
||||
|
||||
'S_OVERVIEW' => true,
|
||||
@@ -915,11 +905,9 @@ 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_MCP_QUEUE' => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '',
|
||||
|
||||
'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_row['user_id']}") : '',
|
||||
|
||||
'POSTS_IN_QUEUE' => $user_row['posts_in_queue'],
|
||||
'USER' => $user_row['username'],
|
||||
'USER_REGISTERED' => $user->format_date($user_row['user_regdate']),
|
||||
'REGISTERED_IP' => ($ip == 'hostname') ? gethostbyaddr($user_row['user_ip']) : $user_row['user_ip'],
|
||||
@@ -972,7 +960,6 @@ class acp_users
|
||||
{
|
||||
$sql = 'DELETE FROM ' . LOG_TABLE . '
|
||||
WHERE log_type = ' . LOG_USERS . "
|
||||
AND reportee_id = $user_id
|
||||
$where_sql";
|
||||
$db->sql_query($sql);
|
||||
|
||||
@@ -1094,7 +1081,7 @@ class acp_users
|
||||
'website' => array(
|
||||
array('string', true, 12, 255),
|
||||
array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
|
||||
'location' => array('string', true, 2, 100),
|
||||
'location' => array('string', true, 2, 255),
|
||||
'occupation' => array('string', true, 2, 500),
|
||||
'interests' => array('string', true, 2, 500),
|
||||
'bday_day' => array('num', true, 1, 31),
|
||||
@@ -1162,8 +1149,7 @@ class acp_users
|
||||
|
||||
foreach ($cp_data as $key => $value)
|
||||
{
|
||||
// Firebird is case sensitive with delimiter
|
||||
$cp_data[$left_delim . (($db->sql_layer == 'firebird') ? strtoupper($key) : $key) . $right_delim] = $value;
|
||||
$cp_data[$left_delim . $key . $right_delim] = $value;
|
||||
unset($cp_data[$key]);
|
||||
}
|
||||
|
||||
@@ -1848,16 +1834,6 @@ class acp_users
|
||||
}
|
||||
|
||||
$error = array();
|
||||
|
||||
// The delete action was successful - therefore update the user row...
|
||||
$sql = 'SELECT u.*, s.*
|
||||
FROM ' . USERS_TABLE . ' u
|
||||
LEFT JOIN ' . SESSIONS_TABLE . ' s ON (s.session_user_id = u.user_id)
|
||||
WHERE u.user_id = ' . $user_id . '
|
||||
ORDER BY s.session_time DESC';
|
||||
$result = $db->sql_query($sql);
|
||||
$user_row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -58,7 +58,7 @@ class auth_admin extends auth
|
||||
$cache->put('_acl_options', $this->acl_options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get permission mask
|
||||
* This function only supports getting permissions of one type (for example a_)
|
||||
@@ -140,7 +140,7 @@ class auth_admin extends auth
|
||||
$auth2 = &$auth;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$hold_ary[$userdata['user_id']] = array();
|
||||
foreach ($forum_ids as $f_id)
|
||||
{
|
||||
@@ -345,7 +345,7 @@ class auth_admin extends auth
|
||||
|
||||
// Build js roles array (role data assignments)
|
||||
$s_role_js_array = '';
|
||||
|
||||
|
||||
if (sizeof($roles))
|
||||
{
|
||||
$s_role_js_array = array();
|
||||
@@ -696,7 +696,6 @@ class auth_admin extends auth
|
||||
|
||||
$cur_options = array();
|
||||
|
||||
// Determine current options
|
||||
$sql = 'SELECT auth_option, is_global, is_local
|
||||
FROM ' . ACL_OPTIONS_TABLE . '
|
||||
ORDER BY auth_option_id';
|
||||
@@ -704,7 +703,15 @@ class auth_admin extends auth
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$cur_options[$row['auth_option']] = ($row['is_global'] && $row['is_local']) ? 'both' : (($row['is_global']) ? 'global' : 'local');
|
||||
if ($row['is_global'])
|
||||
{
|
||||
$cur_options['global'][] = $row['auth_option'];
|
||||
}
|
||||
|
||||
if ($row['is_local'])
|
||||
{
|
||||
$cur_options['local'][] = $row['auth_option'];
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
@@ -719,11 +726,14 @@ class auth_admin extends auth
|
||||
|
||||
foreach ($option_ary as $option_value)
|
||||
{
|
||||
$new_options[$type][] = $option_value;
|
||||
if (!in_array($option_value, $cur_options[$type]))
|
||||
{
|
||||
$new_options[$type][] = $option_value;
|
||||
}
|
||||
|
||||
$flag = substr($option_value, 0, strpos($option_value, '_') + 1);
|
||||
|
||||
if (!in_array($flag, $new_options[$type]))
|
||||
if (!in_array($flag, $cur_options[$type]) && !in_array($flag, $new_options[$type]))
|
||||
{
|
||||
$new_options[$type][] = $flag;
|
||||
}
|
||||
@@ -734,53 +744,23 @@ class auth_admin extends auth
|
||||
$options = array();
|
||||
$options['local'] = array_diff($new_options['local'], $new_options['global']);
|
||||
$options['global'] = array_diff($new_options['global'], $new_options['local']);
|
||||
$options['both'] = array_intersect($new_options['local'], $new_options['global']);
|
||||
$options['local_global'] = array_intersect($new_options['local'], $new_options['global']);
|
||||
|
||||
// Now check which options to add/update
|
||||
$add_options = $update_options = array();
|
||||
$sql_ary = array();
|
||||
|
||||
// First local ones...
|
||||
foreach ($options as $type => $option_ary)
|
||||
{
|
||||
foreach ($option_ary as $option)
|
||||
{
|
||||
if (!isset($cur_options[$option]))
|
||||
{
|
||||
$add_options[] = array(
|
||||
'auth_option' => (string) $option,
|
||||
'is_global' => ($type == 'global' || $type == 'both') ? 1 : 0,
|
||||
'is_local' => ($type == 'local' || $type == 'both') ? 1 : 0
|
||||
);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Else, update existing entry if it is changed...
|
||||
if ($type === $cur_options[$option])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// New type is always both:
|
||||
// If is now both, we set both.
|
||||
// If it was global the new one is local and we need to set it to both
|
||||
// If it was local the new one is global and we need to set it to both
|
||||
$update_options[] = $option;
|
||||
$sql_ary[] = array(
|
||||
'auth_option' => (string) $option,
|
||||
'is_global' => ($type == 'global' || $type == 'local_global') ? 1 : 0,
|
||||
'is_local' => ($type == 'local' || $type == 'local_global') ? 1 : 0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($add_options))
|
||||
{
|
||||
$db->sql_multi_insert(ACL_OPTIONS_TABLE, $add_options);
|
||||
}
|
||||
|
||||
if (!empty($update_options))
|
||||
{
|
||||
$sql = 'UPDATE ' . ACL_OPTIONS_TABLE . '
|
||||
SET is_global = 1, is_local = 1
|
||||
WHERE ' . $db->sql_in_set('auth_option', $update_options);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
$db->sql_multi_insert(ACL_OPTIONS_TABLE, $sql_ary);
|
||||
|
||||
$cache->destroy('_acl_options');
|
||||
$this->acl_clear_prefetch();
|
||||
@@ -822,7 +802,7 @@ class auth_admin extends auth
|
||||
reset($auth);
|
||||
$flag = key($auth);
|
||||
$flag = substr($flag, 0, strpos($flag, '_') + 1);
|
||||
|
||||
|
||||
// This ID (the any-flag) is set if one or more permissions are true...
|
||||
$any_option_id = (int) $this->acl_options['id'][$flag];
|
||||
|
||||
@@ -936,7 +916,7 @@ class auth_admin extends auth
|
||||
reset($auth);
|
||||
$flag = key($auth);
|
||||
$flag = substr($flag, 0, strpos($flag, '_') + 1);
|
||||
|
||||
|
||||
// Remove any-flag from auth ary
|
||||
if (isset($auth[$flag]))
|
||||
{
|
||||
@@ -1087,7 +1067,7 @@ class auth_admin extends auth
|
||||
{
|
||||
$where_sql[] = $db->sql_in_set('auth_option_id', array_map('intval', $option_id_ary));
|
||||
}
|
||||
|
||||
|
||||
$sql = "DELETE FROM $table
|
||||
WHERE " . implode(' AND ', $where_sql);
|
||||
$db->sql_query($sql);
|
||||
@@ -1110,7 +1090,7 @@ class auth_admin extends auth
|
||||
'S_YES' => ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false,
|
||||
'S_NEVER' => ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false,
|
||||
'S_NO' => ($cat_array['S_NO'] && !$cat_array['S_NEVER'] && !$cat_array['S_YES']) ? true : false,
|
||||
|
||||
|
||||
'CAT_NAME' => $user->lang['permission_cat'][$cat])
|
||||
);
|
||||
|
||||
@@ -1199,9 +1179,9 @@ class auth_admin extends auth
|
||||
'lang' => '{ acl_' . $permission . ' }'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$cat = $user->lang['acl_' . $permission]['cat'];
|
||||
|
||||
|
||||
// Build our categories array
|
||||
if (!isset($categories[$cat]))
|
||||
{
|
||||
|
@@ -20,7 +20,7 @@ class acp_email_info
|
||||
'title' => 'ACP_MASS_EMAIL',
|
||||
'version' => '1.0.0',
|
||||
'modes' => array(
|
||||
'email' => array('title' => 'ACP_MASS_EMAIL', 'auth' => 'acl_a_email && cfg_email_enable', 'cat' => array('ACP_GENERAL_TASKS')),
|
||||
'email' => array('title' => 'ACP_MASS_EMAIL', 'auth' => 'acl_a_email', 'cat' => array('ACP_GENERAL_TASKS')),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -71,46 +71,7 @@ class auth
|
||||
$this->acl_cache($userdata);
|
||||
}
|
||||
|
||||
// Fill ACL array
|
||||
$this->_fill_acl($userdata['user_permissions']);
|
||||
|
||||
// Verify bitstring length with options provided...
|
||||
$renew = false;
|
||||
$global_length = sizeof($this->acl_options['global']);
|
||||
$local_length = sizeof($this->acl_options['local']);
|
||||
|
||||
// Specify comparing length (bitstring is padded to 31 bits)
|
||||
$global_length = ($global_length % 31) ? ($global_length - ($global_length % 31) + 31) : $global_length;
|
||||
$local_length = ($local_length % 31) ? ($local_length - ($local_length % 31) + 31) : $local_length;
|
||||
|
||||
// You thought we are finished now? Noooo... now compare them.
|
||||
foreach ($this->acl as $forum_id => $bitstring)
|
||||
{
|
||||
if (($forum_id && strlen($bitstring) != $local_length) || (!$forum_id && strlen($bitstring) != $global_length))
|
||||
{
|
||||
$renew = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If a bitstring within the list does not match the options, we have a user with incorrect permissions set and need to renew them
|
||||
if ($renew)
|
||||
{
|
||||
$this->acl_cache($userdata);
|
||||
$this->_fill_acl($userdata['user_permissions']);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill ACL array with relevant bitstrings from user_permissions column
|
||||
* @access private
|
||||
*/
|
||||
function _fill_acl($user_permissions)
|
||||
{
|
||||
$this->acl = array();
|
||||
$user_permissions = explode("\n", $user_permissions);
|
||||
$user_permissions = explode("\n", $userdata['user_permissions']);
|
||||
|
||||
foreach ($user_permissions as $f => $seq)
|
||||
{
|
||||
@@ -131,6 +92,8 @@ class auth
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -206,7 +169,7 @@ class auth
|
||||
|
||||
$sql = 'SELECT forum_id
|
||||
FROM ' . FORUMS_TABLE;
|
||||
|
||||
|
||||
if (sizeof($this->acl))
|
||||
{
|
||||
$sql .= ' WHERE ' . $db->sql_in_set('forum_id', array_keys($this->acl), true);
|
||||
@@ -221,7 +184,7 @@ class auth
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isset($this->acl_options['local'][$opt]))
|
||||
{
|
||||
foreach ($this->acl as $f => $bitstring)
|
||||
@@ -455,7 +418,7 @@ class auth
|
||||
|
||||
// The line number indicates the id, therefore we have to add empty lines for those ids not present
|
||||
$hold_str .= str_repeat("\n", $f - $last_f);
|
||||
|
||||
|
||||
// Convert bitstring for storage - we do not use binary/bytes because PHP's string functions are not fully binary safe
|
||||
for ($i = 0, $bit_length = strlen($bitstring); $i < $bit_length; $i += 31)
|
||||
{
|
||||
@@ -586,7 +549,7 @@ class auth
|
||||
// Now the role settings - user-specific
|
||||
$sql_ary[] = 'SELECT a.user_id, a.forum_id, r.auth_option_id, r.auth_setting, r.auth_option_id' . $sql_opts_select . '
|
||||
FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_ROLES_DATA_TABLE . ' r' . $sql_opts_from . '
|
||||
WHERE a.auth_role_id = r.role_id ' .
|
||||
WHERE a.auth_role_id = r.role_id ' .
|
||||
(($sql_opts_from) ? 'AND r.auth_option_id = ao.auth_option_id ' : '') .
|
||||
(($sql_user) ? 'AND a.' . $sql_user : '') . "
|
||||
$sql_forum
|
||||
@@ -644,7 +607,7 @@ class auth
|
||||
if ($row['auth_setting'] == ACL_NEVER)
|
||||
{
|
||||
$flag = substr($option, 0, strpos($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]);
|
||||
@@ -864,7 +827,7 @@ class auth
|
||||
{
|
||||
$flag = substr($this->acl_options['option'][$option_id], 0, strpos($this->acl_options['option'][$option_id], '_') + 1);
|
||||
$flag = (int) $this->acl_options['id'][$flag];
|
||||
|
||||
|
||||
if (isset($hold_ary[$flag]) && $hold_ary[$flag] == ACL_YES)
|
||||
{
|
||||
unset($hold_ary[$flag]);
|
||||
|
@@ -104,7 +104,7 @@ function login_apache(&$username, &$password)
|
||||
'user_row' => $row,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Successful login...
|
||||
return array(
|
||||
'status' => LOGIN_SUCCESS,
|
||||
@@ -227,22 +227,15 @@ function user_row_apache($username, $password)
|
||||
*/
|
||||
function validate_session_apache(&$user)
|
||||
{
|
||||
// Check if PHP_AUTH_USER is set and handle this case
|
||||
if (isset($_SERVER['PHP_AUTH_USER']))
|
||||
if (!isset($_SERVER['PHP_AUTH_USER']))
|
||||
{
|
||||
$php_auth_user = '';
|
||||
set_var($php_auth_user, $_SERVER['PHP_AUTH_USER'], 'string', true);
|
||||
|
||||
return ($php_auth_user === $user['username']) ? true : false;
|
||||
return false;
|
||||
}
|
||||
|
||||
// PHP_AUTH_USER is not set. A valid session is now determined by the user type (anonymous/bot or not)
|
||||
if ($user['user_type'] == USER_IGNORE)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
$php_auth_user = '';
|
||||
set_var($php_auth_user, $_SERVER['PHP_AUTH_USER'], 'string', true);
|
||||
|
||||
return false;
|
||||
return ($php_auth_user === $user['username']) ? true : false;
|
||||
}
|
||||
|
||||
?>
|
@@ -141,9 +141,7 @@ function login_db(&$username, &$password)
|
||||
}
|
||||
|
||||
// cp1252 is phpBB2's default encoding, characters outside ASCII range might work when converted into that encoding
|
||||
// plain md5 support left in for conversions from other systems.
|
||||
if ((strlen($row['user_password']) == 34 && (phpbb_check_hash(md5($password_old_format), $row['user_password']) || phpbb_check_hash(md5(utf8_to_cp1252($password_old_format)), $row['user_password'])))
|
||||
|| (strlen($row['user_password']) == 32 && (md5($password_old_format) == $row['user_password'] || md5(utf8_to_cp1252($password_old_format)) == $row['user_password'])))
|
||||
if (md5($password_old_format) == $row['user_password'] || md5(utf8_to_cp1252($password_old_format)) == $row['user_password'])
|
||||
{
|
||||
$hash = phpbb_hash($password_new_format);
|
||||
|
||||
@@ -157,7 +155,7 @@ function login_db(&$username, &$password)
|
||||
$row['user_pass_convert'] = 0;
|
||||
$row['user_password'] = $hash;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
// Although we weren't able to convert this password we have to
|
||||
// increase login attempt count to make sure this cannot be exploited
|
||||
|
@@ -137,18 +137,7 @@ class bbcode
|
||||
|
||||
if (!@file_exists($this->template_filename))
|
||||
{
|
||||
if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'])
|
||||
{
|
||||
$this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_inherit_path'] . '/template/bbcode.html';
|
||||
if (!@file_exists($this->template_filename))
|
||||
{
|
||||
trigger_error('The file ' . $this->template_filename . ' is missing.', E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error('The file ' . $this->template_filename . ' is missing.', E_USER_ERROR);
|
||||
}
|
||||
trigger_error('The file ' . $this->template_filename . ' is missing.', E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,7 +399,7 @@ class bbcode
|
||||
if (empty($bbcode_hardtpl))
|
||||
{
|
||||
global $user;
|
||||
|
||||
|
||||
$bbcode_hardtpl = array(
|
||||
'b_open' => '<span style="font-weight: bold">',
|
||||
'b_close' => '</span>',
|
||||
@@ -528,12 +517,12 @@ class bbcode
|
||||
else if (is_numeric($type))
|
||||
{
|
||||
$tpl = 'olist_open';
|
||||
$type = 'decimal';
|
||||
$type = 'arabic-numbers';
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl = 'olist_open';
|
||||
$type = 'decimal';
|
||||
$type = 'arabic-numbers';
|
||||
}
|
||||
|
||||
return str_replace('{LIST_TYPE}', $type, $this->bbcode_tpl($tpl));
|
||||
|
@@ -63,7 +63,7 @@ class cache extends acm
|
||||
|
||||
$this->put('config', $cached_config);
|
||||
}
|
||||
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ class cache extends acm
|
||||
if (($icons = $this->get('_icons')) === false)
|
||||
{
|
||||
global $db;
|
||||
|
||||
|
||||
// Topic icons
|
||||
$sql = 'SELECT *
|
||||
FROM ' . ICONS_TABLE . '
|
||||
@@ -134,7 +134,7 @@ class cache extends acm
|
||||
if (($ranks = $this->get('_ranks')) === false)
|
||||
{
|
||||
global $db;
|
||||
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . RANKS_TABLE . '
|
||||
ORDER BY rank_min DESC';
|
||||
@@ -284,7 +284,7 @@ class cache extends acm
|
||||
if (($bots = $this->get('_bots')) === false)
|
||||
{
|
||||
global $db;
|
||||
|
||||
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mssql':
|
||||
@@ -321,7 +321,7 @@ class cache extends acm
|
||||
|
||||
$this->put('_bots', $bots);
|
||||
}
|
||||
|
||||
|
||||
return $bots;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -24,9 +24,6 @@ if (!defined('IN_PHPBB'))
|
||||
* PHPBB_ADMIN_PATH
|
||||
*/
|
||||
|
||||
// phpBB Version
|
||||
define('PHPBB_VERSION', '3.0.5-RC1');
|
||||
|
||||
// QA-related
|
||||
// define('PHPBB_QA', 1);
|
||||
|
||||
@@ -179,15 +176,6 @@ define('REFERER_VALIDATE_NONE', 0);
|
||||
define('REFERER_VALIDATE_HOST', 1);
|
||||
define('REFERER_VALIDATE_PATH', 2);
|
||||
|
||||
// phpbb_chmod() permissions
|
||||
@define('CHMOD_ALL', 7);
|
||||
@define('CHMOD_READ', 4);
|
||||
@define('CHMOD_WRITE', 2);
|
||||
@define('CHMOD_EXECUTE', 1);
|
||||
|
||||
// Captcha code length
|
||||
define('CAPTCHA_MIN_CHARS', 4);
|
||||
define('CAPTCHA_MAX_CHARS', 7);
|
||||
|
||||
// Additional constants
|
||||
define('VOTE_CONVERTED', 127);
|
||||
|
@@ -30,15 +30,6 @@ class phpbb_db_tools
|
||||
*/
|
||||
var $sql_layer = '';
|
||||
|
||||
/**
|
||||
* @var object DB object
|
||||
*/
|
||||
var $db = NULL;
|
||||
|
||||
/**
|
||||
* The Column types for every database we support
|
||||
* @var array
|
||||
*/
|
||||
var $dbms_type_map = array(
|
||||
'mysql_41' => array(
|
||||
'INT:' => 'int(%d)',
|
||||
@@ -251,34 +242,20 @@ class phpbb_db_tools
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* A list of types being unsigned for better reference in some db's
|
||||
* @var array
|
||||
*/
|
||||
// A list of types being unsigned for better reference in some db's
|
||||
var $unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP');
|
||||
|
||||
/**
|
||||
* A list of supported DBMS. We change this class to support more DBMS, the DBMS itself only need to follow some rules.
|
||||
* @var array
|
||||
*/
|
||||
var $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite');
|
||||
|
||||
/**
|
||||
* This is set to true if user only wants to return the 'to-be-executed' SQL statement(s) (as an array).
|
||||
* This mode has no effect on some methods (inserting of data for example). This is expressed within the methods command.
|
||||
* Set this to true if you only want to return the 'to-be-executed' SQL statement(s) (as an array).
|
||||
*/
|
||||
var $return_statements = false;
|
||||
|
||||
/**
|
||||
* Constructor. Set DB Object and set {@link $return_statements return_statements}.
|
||||
*
|
||||
* @param phpbb_dbal $db DBAL object
|
||||
* @param bool $return_statements True if only statements should be returned and no SQL being executed
|
||||
*/
|
||||
function phpbb_db_tools(&$db, $return_statements = false)
|
||||
function phpbb_db_tools(&$db)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->return_statements = $return_statements;
|
||||
|
||||
// Determine mapping database type
|
||||
switch ($this->db->sql_layer)
|
||||
@@ -288,7 +265,7 @@ class phpbb_db_tools
|
||||
break;
|
||||
|
||||
case 'mysql4':
|
||||
if (version_compare($this->db->sql_server_info(true), '4.1.3', '>='))
|
||||
if (version_compare($this->db->mysql_version, '4.1.3', '>='))
|
||||
{
|
||||
$this->sql_layer = 'mysql_41';
|
||||
}
|
||||
@@ -313,245 +290,6 @@ class phpbb_db_tools
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if table exists
|
||||
*
|
||||
*
|
||||
* @param string $table_name The table name to check for
|
||||
* @return bool true if table exists, else false
|
||||
*/
|
||||
function sql_table_exists($table_name)
|
||||
{
|
||||
$this->db->sql_return_on_error(true);
|
||||
$result = $this->db->sql_query_limit('SELECT * FROM ' . $table_name, 1);
|
||||
$this->db->sql_return_on_error(false);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$this->db->sql_freeresult($result);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create SQL Table
|
||||
*
|
||||
* @param string $table_name The table name to create
|
||||
* @param array $table_data Array containing table data.
|
||||
* @return array Statements if $return_statements is true.
|
||||
*/
|
||||
function sql_create_table($table_name, $table_data)
|
||||
{
|
||||
// holds the DDL for a column
|
||||
$columns = $statements = array();
|
||||
|
||||
// Begin transaction
|
||||
$statements[] = 'begin';
|
||||
|
||||
// Determine if we have created a PRIMARY KEY in the earliest
|
||||
$primary_key_gen = false;
|
||||
|
||||
// Determine if the table must be created with TEXTIMAGE
|
||||
$create_textimage = false;
|
||||
|
||||
// Determine if the table requires a sequence
|
||||
$create_sequence = false;
|
||||
|
||||
// Begin table sql statement
|
||||
switch ($this->sql_layer)
|
||||
{
|
||||
case 'mssql':
|
||||
$table_sql = 'CREATE TABLE [' . $table_name . '] (' . "\n";
|
||||
break;
|
||||
|
||||
default:
|
||||
$table_sql = 'CREATE TABLE ' . $table_name . ' (' . "\n";
|
||||
break;
|
||||
}
|
||||
|
||||
// Iterate through the columns to create a table
|
||||
foreach ($table_data['COLUMNS'] as $column_name => $column_data)
|
||||
{
|
||||
// here lies an array, filled with information compiled on the column's data
|
||||
$prepared_column = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
|
||||
|
||||
// here we add the definition of the new column to the list of columns
|
||||
switch ($this->sql_layer)
|
||||
{
|
||||
case 'mssql':
|
||||
$columns[] = "\t [{$column_name}] " . $prepared_column['column_type_sql_default'];
|
||||
break;
|
||||
|
||||
default:
|
||||
$columns[] = "\t {$column_name} " . $prepared_column['column_type_sql'];
|
||||
break;
|
||||
}
|
||||
|
||||
// see if we have found a primary key set due to a column definition if we have found it, we can stop looking
|
||||
if (!$primary_key_gen)
|
||||
{
|
||||
$primary_key_gen = isset($prepared_column['primary_key_set']) && $prepared_column['primary_key_set'];
|
||||
}
|
||||
|
||||
// create textimage DDL based off of the existance of certain column types
|
||||
if (!$create_textimage)
|
||||
{
|
||||
$create_textimage = isset($prepared_column['textimage']) && $prepared_column['textimage'];
|
||||
}
|
||||
|
||||
// create sequence DDL based off of the existance of auto incrementing columns
|
||||
if (!$create_sequence && isset($prepared_column['auto_increment']) && $prepared_column['auto_increment'])
|
||||
{
|
||||
$create_sequence = $column_name;
|
||||
}
|
||||
}
|
||||
|
||||
// this makes up all the columns in the create table statement
|
||||
$table_sql .= implode(",\n", $columns);
|
||||
|
||||
// Close the table for two DBMS and add to the statements
|
||||
switch ($this->sql_layer)
|
||||
{
|
||||
case 'firebird':
|
||||
$table_sql .= "\n);";
|
||||
$statements[] = $table_sql;
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
$table_sql .= "\n) ON [PRIMARY]" . (($create_textimage) ? ' TEXTIMAGE_ON [PRIMARY]' : '');
|
||||
$statements[] = $table_sql;
|
||||
break;
|
||||
}
|
||||
|
||||
// we have yet to create a primary key for this table,
|
||||
// this means that we can add the one we really wanted instead
|
||||
if (!$primary_key_gen)
|
||||
{
|
||||
// Write primary key
|
||||
if (isset($table_data['PRIMARY_KEY']))
|
||||
{
|
||||
if (!is_array($table_data['PRIMARY_KEY']))
|
||||
{
|
||||
$table_data['PRIMARY_KEY'] = array($table_data['PRIMARY_KEY']);
|
||||
}
|
||||
|
||||
switch ($this->sql_layer)
|
||||
{
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
case 'postgres':
|
||||
case 'sqlite':
|
||||
$table_sql .= ",\n\t PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . ')';
|
||||
break;
|
||||
|
||||
case 'firebird':
|
||||
case 'mssql':
|
||||
$primary_key_stmts = $this->sql_create_primary_key($table_name, $table_data['PRIMARY_KEY']);
|
||||
foreach ($primary_key_stmts as $pk_stmt)
|
||||
{
|
||||
$statements[] = $pk_stmt;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$table_sql .= ",\n\t CONSTRAINT pk_{$table_name} PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . ')';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// close the table
|
||||
switch ($this->sql_layer)
|
||||
{
|
||||
case 'mysql_41':
|
||||
// make sure the table is in UTF-8 mode
|
||||
$table_sql .= "\n) CHARACTER SET `utf8` COLLATE `utf8_bin`;";
|
||||
$statements[] = $table_sql;
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'sqlite':
|
||||
$table_sql .= "\n);";
|
||||
$statements[] = $table_sql;
|
||||
break;
|
||||
|
||||
case 'postgres':
|
||||
// do we need to add a sequence for auto incrementing columns?
|
||||
if ($create_sequence)
|
||||
{
|
||||
$statements[] = "CREATE SEQUENCE {$table_name}_seq;";
|
||||
}
|
||||
|
||||
$table_sql .= "\n);";
|
||||
$statements[] = $table_sql;
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$table_sql .= "\n);";
|
||||
$statements[] = $table_sql;
|
||||
|
||||
// do we need to add a sequence and a tigger for auto incrementing columns?
|
||||
if ($create_sequence)
|
||||
{
|
||||
// create the actual sequence
|
||||
$statements[] = "CREATE SEQUENCE {$table_name}_seq";
|
||||
|
||||
// the trigger is the mechanism by which we increment the counter
|
||||
$trigger = "CREATE OR REPLACE TRIGGER t_{$table_name}\n";
|
||||
$trigger .= "BEFORE INSERT ON {$table_name}\n";
|
||||
$trigger .= "FOR EACH ROW WHEN (\n";
|
||||
$trigger .= "\tnew.{$create_sequence} IS NULL OR new.{$create_sequence} = 0\n";
|
||||
$trigger .= ")\n";
|
||||
$trigger .= "BEGIN\n";
|
||||
$trigger .= "\tSELECT {$table_name}_seq.nextval\n";
|
||||
$trigger .= "\tINTO :new.{$create_sequence}\n";
|
||||
$trigger .= "\tFROM dual\n";
|
||||
$trigger .= "END;";
|
||||
|
||||
$statements[] = $trigger;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'firebird':
|
||||
if ($create_sequence)
|
||||
{
|
||||
$statements[] = "CREATE SEQUENCE {$table_name}_seq;";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Write Keys
|
||||
if (isset($table_data['KEYS']))
|
||||
{
|
||||
foreach ($table_data['KEYS'] as $key_name => $key_data)
|
||||
{
|
||||
if (!is_array($key_data[1]))
|
||||
{
|
||||
$key_data[1] = array($key_data[1]);
|
||||
}
|
||||
|
||||
$old_return_statements = $this->return_statements;
|
||||
$this->return_statements = true;
|
||||
|
||||
$key_stmts = ($key_data[0] == 'UNIQUE') ? $this->sql_create_unique_index($table_name, $key_name, $key_data[1]) : $this->sql_create_index($table_name, $key_name, $key_data[1]);
|
||||
|
||||
foreach ($key_stmts as $key_stmt)
|
||||
{
|
||||
$statements[] = $key_stmt;
|
||||
}
|
||||
|
||||
$this->return_statements = $old_return_statements;
|
||||
}
|
||||
}
|
||||
|
||||
// Commit Transaction
|
||||
$statements[] = 'commit';
|
||||
|
||||
return $this->_sql_run_sql($statements);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle passed database update array.
|
||||
* Expected structure...
|
||||
@@ -570,7 +308,7 @@ class phpbb_db_tools
|
||||
* {KEY/INDEX NAME} => array({COLUMN NAMES}),
|
||||
* )
|
||||
*
|
||||
* For more information have a look at /develop/create_schema_files.php (only available through SVN)
|
||||
* For more information have a look at /develop/create_schema_files.php (only available through CVS)
|
||||
*/
|
||||
function perform_schema_changes($schema_changes)
|
||||
{
|
||||
@@ -588,15 +326,7 @@ class phpbb_db_tools
|
||||
{
|
||||
foreach ($columns as $column_name => $column_data)
|
||||
{
|
||||
// If the column exists we change it, else we add it ;)
|
||||
if ($this->sql_column_exists($table, $column_name))
|
||||
{
|
||||
$result = $this->sql_column_change($table, $column_name, $column_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->sql_column_add($table, $column_name, $column_data);
|
||||
}
|
||||
$result = $this->sql_column_change($table, $column_name, $column_data);
|
||||
|
||||
if ($this->return_statements)
|
||||
{
|
||||
@@ -613,19 +343,15 @@ class phpbb_db_tools
|
||||
{
|
||||
foreach ($columns as $column_name => $column_data)
|
||||
{
|
||||
// Only add the column if it does not exist yet, else change it (to be consistent)
|
||||
if ($this->sql_column_exists($table, $column_name))
|
||||
{
|
||||
$result = $this->sql_column_change($table, $column_name, $column_data);
|
||||
}
|
||||
else
|
||||
// Only add the column if it does not exist yet
|
||||
if (!$this->sql_column_exists($table, $column_name))
|
||||
{
|
||||
$result = $this->sql_column_add($table, $column_name, $column_data);
|
||||
}
|
||||
|
||||
if ($this->return_statements)
|
||||
{
|
||||
$statements = array_merge($statements, $result);
|
||||
if ($this->return_statements)
|
||||
{
|
||||
$statements = array_merge($statements, $result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -655,15 +381,11 @@ class phpbb_db_tools
|
||||
{
|
||||
foreach ($columns as $column)
|
||||
{
|
||||
// Only remove the column if it exists...
|
||||
if ($this->sql_column_exists($table, $column))
|
||||
{
|
||||
$result = $this->sql_column_remove($table, $column);
|
||||
$result = $this->sql_column_remove($table, $column);
|
||||
|
||||
if ($this->return_statements)
|
||||
{
|
||||
$statements = array_merge($statements, $result);
|
||||
}
|
||||
if ($this->return_statements)
|
||||
{
|
||||
$statements = array_merge($statements, $result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -725,10 +447,6 @@ class phpbb_db_tools
|
||||
|
||||
/**
|
||||
* Check if a specified column exist
|
||||
*
|
||||
* @param string $table Table to check the column at
|
||||
* @param string $column_name The column to check
|
||||
*
|
||||
* @return bool True if column exists, else false
|
||||
*/
|
||||
function sql_column_exists($table, $column_name)
|
||||
@@ -875,7 +593,7 @@ class phpbb_db_tools
|
||||
|
||||
/**
|
||||
* Private method for performing sql statements (either execute them or return them)
|
||||
* @access private
|
||||
* @private
|
||||
*/
|
||||
function _sql_run_sql($statements)
|
||||
{
|
||||
@@ -906,7 +624,7 @@ class phpbb_db_tools
|
||||
|
||||
/**
|
||||
* Function to prepare some column information for better usage
|
||||
* @access private
|
||||
* @private
|
||||
*/
|
||||
function sql_prepare_column_data($table_name, $column_name, $column_data)
|
||||
{
|
||||
@@ -914,6 +632,7 @@ class phpbb_db_tools
|
||||
if (strpos($column_data[0], ':') !== false)
|
||||
{
|
||||
list($orig_column_type, $column_length) = explode(':', $column_data[0]);
|
||||
|
||||
if (!is_array($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']))
|
||||
{
|
||||
$column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'], $column_length);
|
||||
@@ -986,12 +705,6 @@ class phpbb_db_tools
|
||||
$sql .= ' COLLATE UNICODE';
|
||||
}
|
||||
|
||||
$return_array['auto_increment'] = false;
|
||||
if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
|
||||
{
|
||||
$return_array['auto_increment'] = true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
@@ -1012,19 +725,10 @@ class phpbb_db_tools
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
|
||||
{
|
||||
// $sql .= 'IDENTITY (1, 1) ';
|
||||
$sql_default .= 'IDENTITY (1, 1) ';
|
||||
}
|
||||
|
||||
$return_array['textimage'] = $column_type === '[text]';
|
||||
|
||||
$sql .= 'NOT NULL';
|
||||
$sql_default .= 'NOT NULL';
|
||||
|
||||
$return_array['column_type_sql_default'] = $sql_default;
|
||||
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
@@ -1059,17 +763,10 @@ class phpbb_db_tools
|
||||
// In Oracle empty strings ('') are treated as NULL.
|
||||
// Therefore in oracle we allow NULL's for all DEFAULT '' entries
|
||||
// Oracle does not like setting NOT NULL on a column that is already NOT NULL (this happens only on number fields)
|
||||
if (!preg_match('/number/i', $column_type))
|
||||
if (preg_match('/number/i', $column_type))
|
||||
{
|
||||
$sql .= ($column_data[1] === '') ? '' : 'NOT NULL';
|
||||
}
|
||||
|
||||
$return_array['auto_increment'] = false;
|
||||
if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
|
||||
{
|
||||
$return_array['auto_increment'] = true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'postgres':
|
||||
@@ -1077,11 +774,9 @@ class phpbb_db_tools
|
||||
|
||||
$sql .= " {$column_type} ";
|
||||
|
||||
$return_array['auto_increment'] = false;
|
||||
if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
|
||||
{
|
||||
$default_val = "nextval('{$table_name}_seq')";
|
||||
$return_array['auto_increment'] = true;
|
||||
}
|
||||
else if (!is_null($column_data[1]))
|
||||
{
|
||||
@@ -1100,15 +795,12 @@ class phpbb_db_tools
|
||||
$return_array['constraint'] = "CHECK ({$column_name} >= 0)";
|
||||
$sql .= " CHECK ({$column_name} >= 0)";
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'sqlite':
|
||||
$return_array['primary_key_set'] = false;
|
||||
if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
|
||||
{
|
||||
$sql .= ' INTEGER PRIMARY KEY';
|
||||
$return_array['primary_key_set'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1117,7 +809,6 @@ class phpbb_db_tools
|
||||
|
||||
$sql .= ' NOT NULL ';
|
||||
$sql .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}'" : '';
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1137,7 +828,7 @@ class phpbb_db_tools
|
||||
switch ($this->sql_layer)
|
||||
{
|
||||
case 'firebird':
|
||||
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD "' . strtoupper($column_name) . '" ' . $column_data['column_type_sql'];
|
||||
$statements[] = 'ALTER TABLE "' . $table_name . '" ADD "' . $column_name . '" ' . $column_data['column_type_sql'];
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
@@ -1229,7 +920,7 @@ class phpbb_db_tools
|
||||
switch ($this->sql_layer)
|
||||
{
|
||||
case 'firebird':
|
||||
$statements[] = 'ALTER TABLE ' . $table_name . ' DROP "' . strtoupper($column_name) . '"';
|
||||
$statements[] = 'ALTER TABLE "' . $table_name . '" DROP "' . $column_name . '"';
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
@@ -1340,68 +1031,6 @@ class phpbb_db_tools
|
||||
return $this->_sql_run_sql($statements);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop Table
|
||||
*/
|
||||
function sql_table_drop($table_name)
|
||||
{
|
||||
$statements = array();
|
||||
|
||||
// the most basic operation, get rid of the table
|
||||
$statements[] = 'DROP TABLE ' . $table_name;
|
||||
|
||||
switch ($this->sql_layer)
|
||||
{
|
||||
case 'firebird':
|
||||
$sql = 'SELECT RDB$GENERATOR_NAME as gen
|
||||
FROM RDB$GENERATORS
|
||||
WHERE RDB$SYSTEM_FLAG = 0
|
||||
AND RDB$GENERATOR_NAME = \'' . strtoupper($table_name) . "_GEN'";
|
||||
$result = $this->db->sql_query($sql);
|
||||
|
||||
// does a generator exist?
|
||||
if ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$statements[] = "DROP GENERATOR {$row['gen']};";
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$sql = 'SELECT A.REFERENCED_NAME
|
||||
FROM USER_DEPENDENCIES A, USER_TRIGGERS B
|
||||
WHERE A.REFERENCED_TYPE = \'SEQUENCE\'
|
||||
AND A.NAME = B.TRIGGER_NAME
|
||||
AND B.TABLE_NAME = \'' . strtoupper($table_name) . "'";
|
||||
$result = $this->db->sql_query($sql);
|
||||
|
||||
// any sequences ref'd to this table's triggers?
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
$statements[] = "DROP SEQUENCE {$row['referenced_name']}";
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
|
||||
case 'postgres':
|
||||
// PGSQL does not "tightly" bind sequences and tables, we must guess...
|
||||
$sql = "SELECT relname
|
||||
FROM pg_class
|
||||
WHERE relkind = 'S'
|
||||
AND relname = '{$table_name}_seq'";
|
||||
$result = $this->db->sql_query($sql);
|
||||
|
||||
// We don't even care about storing the results. We already know the answer if we get rows back.
|
||||
if ($this->db->sql_fetchrow($result))
|
||||
{
|
||||
$statements[] = "DROP SEQUENCE {$table_name}_seq;\n";
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
break;
|
||||
}
|
||||
|
||||
return $this->_sql_run_sql($statements);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add primary key
|
||||
*/
|
||||
@@ -1413,8 +1042,6 @@ class phpbb_db_tools
|
||||
{
|
||||
case 'firebird':
|
||||
case 'postgres':
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')';
|
||||
break;
|
||||
|
||||
@@ -1427,6 +1054,11 @@ class phpbb_db_tools
|
||||
$statements[] = $sql;
|
||||
break;
|
||||
|
||||
case 'mysql_40':
|
||||
case 'mysql_41':
|
||||
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')';
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$statements[] = 'ALTER TABLE ' . $table_name . 'add CONSTRAINT pk_' . $table_name . ' PRIMARY KEY (' . implode(', ', $column) . ')';
|
||||
break;
|
||||
@@ -1601,7 +1233,6 @@ class phpbb_db_tools
|
||||
FROM user_indexes
|
||||
WHERE table_name = '" . $table_name . "'
|
||||
AND generated = 'N'";
|
||||
$col = 'index_name';
|
||||
break;
|
||||
|
||||
case 'sqlite':
|
||||
@@ -1648,7 +1279,7 @@ class phpbb_db_tools
|
||||
{
|
||||
case 'firebird':
|
||||
// Change type...
|
||||
$statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql'];
|
||||
$statements[] = 'ALTER TABLE "' . $table_name . '" ALTER COLUMN "' . $column_name . '" TYPE ' . ' ' . $column_data['column_type_sql'];
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
|
@@ -34,7 +34,7 @@ class dbal
|
||||
var $query_hold = '';
|
||||
var $html_hold = '';
|
||||
var $sql_report = '';
|
||||
|
||||
|
||||
var $persistency = false;
|
||||
var $user = '';
|
||||
var $server = '';
|
||||
@@ -47,7 +47,7 @@ class dbal
|
||||
var $sql_error_sql = '';
|
||||
// Holding the error information - only populated if sql_error_triggered is set
|
||||
var $sql_error_returned = array();
|
||||
|
||||
|
||||
// Holding transaction count
|
||||
var $transactions = 0;
|
||||
|
||||
@@ -65,11 +65,6 @@ class dbal
|
||||
var $any_char;
|
||||
var $one_char;
|
||||
|
||||
/**
|
||||
* Exact version of the DBAL, directly queried
|
||||
*/
|
||||
var $sql_server_version = false;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -142,14 +137,8 @@ class dbal
|
||||
{
|
||||
$this->sql_freeresult($query_id);
|
||||
}
|
||||
|
||||
// Connection closed correctly. Set db_connect_id to false to prevent errors
|
||||
if ($result = $this->_sql_close())
|
||||
{
|
||||
$this->db_connect_id = false;
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
return $this->_sql_close();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,7 +179,7 @@ class dbal
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -311,7 +300,7 @@ class dbal
|
||||
* Build sql statement from array for insert/update/select statements
|
||||
*
|
||||
* Idea for this from Ikonboard
|
||||
* Possible query values: INSERT, INSERT_SELECT, UPDATE, SELECT
|
||||
* Possible query values: INSERT, INSERT_SELECT, MULTI_INSERT, UPDATE, SELECT
|
||||
*
|
||||
*/
|
||||
function sql_build_array($query, $assoc_ary = false)
|
||||
@@ -344,7 +333,24 @@ class dbal
|
||||
}
|
||||
else if ($query == 'MULTI_INSERT')
|
||||
{
|
||||
trigger_error('The MULTI_INSERT query value is no longer supported. Please use sql_multi_insert() instead.', E_USER_ERROR);
|
||||
$ary = array();
|
||||
foreach ($assoc_ary as $id => $sql_ary)
|
||||
{
|
||||
// If by accident the sql array is only one-dimensional we build a normal insert statement
|
||||
if (!is_array($sql_ary))
|
||||
{
|
||||
return $this->sql_build_array('INSERT', $assoc_ary);
|
||||
}
|
||||
|
||||
$values = array();
|
||||
foreach ($sql_ary as $key => $var)
|
||||
{
|
||||
$values[] = $this->_sql_validate_value($var);
|
||||
}
|
||||
$ary[] = '(' . implode(', ', $values) . ')';
|
||||
}
|
||||
|
||||
$query = ' (' . implode(', ', array_keys($assoc_ary[0])) . ') VALUES ' . implode(', ', $ary);
|
||||
}
|
||||
else if ($query == 'UPDATE' || $query == 'SELECT')
|
||||
{
|
||||
@@ -429,25 +435,7 @@ class dbal
|
||||
|
||||
if ($this->multi_insert)
|
||||
{
|
||||
$ary = array();
|
||||
foreach ($sql_ary as $id => $_sql_ary)
|
||||
{
|
||||
// If by accident the sql array is only one-dimensional we build a normal insert statement
|
||||
if (!is_array($_sql_ary))
|
||||
{
|
||||
$this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $sql_ary));
|
||||
return true;
|
||||
}
|
||||
|
||||
$values = array();
|
||||
foreach ($_sql_ary as $key => $var)
|
||||
{
|
||||
$values[] = $this->_sql_validate_value($var);
|
||||
}
|
||||
$ary[] = '(' . implode(', ', $values) . ')';
|
||||
}
|
||||
|
||||
$this->sql_query('INSERT INTO ' . $table . ' ' . ' (' . implode(', ', array_keys($sql_ary[0])) . ') VALUES ' . implode(', ', $ary));
|
||||
$this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('MULTI_INSERT', $sql_ary));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -500,62 +488,19 @@ class dbal
|
||||
|
||||
$sql = str_replace('_', ' ', $query) . ' ' . $array['SELECT'] . ' FROM ';
|
||||
|
||||
// Build table array. We also build an alias array for later checks.
|
||||
$table_array = $aliases = array();
|
||||
$used_multi_alias = false;
|
||||
|
||||
$table_array = array();
|
||||
foreach ($array['FROM'] as $table_name => $alias)
|
||||
{
|
||||
if (is_array($alias))
|
||||
{
|
||||
$used_multi_alias = true;
|
||||
|
||||
foreach ($alias as $multi_alias)
|
||||
{
|
||||
$table_array[] = $table_name . ' ' . $multi_alias;
|
||||
$aliases[] = $multi_alias;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$table_array[] = $table_name . ' ' . $alias;
|
||||
$aliases[] = $alias;
|
||||
}
|
||||
}
|
||||
|
||||
// We run the following code to determine if we need to re-order the table array. ;)
|
||||
// The reason for this is that for multi-aliased tables (two equal tables) in the FROM statement the last table need to match the first comparison.
|
||||
// DBMS who rely on this: Oracle, PostgreSQL and MSSQL. For all other DBMS it makes absolutely no difference in which order the table is.
|
||||
if (!empty($array['LEFT_JOIN']) && sizeof($array['FROM']) > 1 && $used_multi_alias !== false)
|
||||
{
|
||||
// Take first LEFT JOIN
|
||||
$join = current($array['LEFT_JOIN']);
|
||||
|
||||
// Determine the table used there (even if there are more than one used, we only want to have one
|
||||
preg_match('/(' . implode('|', $aliases) . ')\.[^\s]+/U', str_replace(array('(', ')', 'AND', 'OR', ' '), '', $join['ON']), $matches);
|
||||
|
||||
// If there is a first join match, we need to make sure the table order is correct
|
||||
if (!empty($matches[1]))
|
||||
{
|
||||
$first_join_match = trim($matches[1]);
|
||||
$table_array = $last = array();
|
||||
|
||||
foreach ($array['FROM'] as $table_name => $alias)
|
||||
{
|
||||
if (is_array($alias))
|
||||
{
|
||||
foreach ($alias as $multi_alias)
|
||||
{
|
||||
($multi_alias === $first_join_match) ? $last[] = $table_name . ' ' . $multi_alias : $table_array[] = $table_name . ' ' . $multi_alias;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
($alias === $first_join_match) ? $last[] = $table_name . ' ' . $alias : $table_array[] = $table_name . ' ' . $alias;
|
||||
}
|
||||
}
|
||||
|
||||
$table_array = array_merge($table_array, $last);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -755,7 +700,7 @@ class dbal
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
' . $this->html_hold . '
|
||||
|
||||
<p style="text-align: center;">
|
||||
@@ -783,24 +728,24 @@ class dbal
|
||||
case 'start':
|
||||
$this->query_hold = $query;
|
||||
$this->html_hold = '';
|
||||
|
||||
|
||||
$this->_sql_report($mode, $query);
|
||||
|
||||
$this->curtime = explode(' ', microtime());
|
||||
$this->curtime = $this->curtime[0] + $this->curtime[1];
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'add_select_row':
|
||||
|
||||
$html_table = func_get_arg(2);
|
||||
$row = func_get_arg(3);
|
||||
|
||||
|
||||
if (!$html_table && sizeof($row))
|
||||
{
|
||||
$html_table = true;
|
||||
$this->html_hold .= '<table cellspacing="1"><tr>';
|
||||
|
||||
|
||||
foreach (array_keys($row) as $val)
|
||||
{
|
||||
$this->html_hold .= '<th>' . (($val) ? ucwords(str_replace('_', ' ', $val)) : ' ') . '</th>';
|
||||
@@ -816,7 +761,7 @@ class dbal
|
||||
$this->html_hold .= '<td class="' . $class . '">' . (($val) ? $val : ' ') . '</td>';
|
||||
}
|
||||
$this->html_hold .= '</tr>';
|
||||
|
||||
|
||||
return $html_table;
|
||||
|
||||
break;
|
||||
@@ -847,7 +792,7 @@ class dbal
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
|
||||
$this->_sql_report($mode, $query);
|
||||
|
||||
break;
|
||||
|
@@ -37,42 +37,26 @@ class dbal_firebird extends dbal
|
||||
$this->persistency = $persistency;
|
||||
$this->user = $sqluser;
|
||||
$this->server = $sqlserver . (($port) ? ':' . $port : '');
|
||||
$this->dbname = str_replace('\\', '/', $database);
|
||||
$this->dbname = $database;
|
||||
|
||||
// There are three possibilities to connect to an interbase db
|
||||
if (!$this->server)
|
||||
{
|
||||
$use_database = $this->dbname;
|
||||
}
|
||||
else if (strpos($this->server, '//') === 0)
|
||||
{
|
||||
$use_database = $this->server . $this->dbname;
|
||||
}
|
||||
else
|
||||
{
|
||||
$use_database = $this->server . ':' . $this->dbname;
|
||||
}
|
||||
$this->db_connect_id = ($this->persistency) ? @ibase_pconnect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3);
|
||||
|
||||
$this->db_connect_id = ($this->persistency) ? @ibase_pconnect($use_database, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($use_database, $this->user, $sqlpassword, false, false, 3);
|
||||
|
||||
$this->service_handle = (function_exists('ibase_service_attach') && $this->server) ? @ibase_service_attach($this->server, $this->user, $sqlpassword) : false;
|
||||
$this->service_handle = (function_exists('ibase_service_attach')) ? @ibase_service_attach($this->server, $this->user, $sqlpassword) : false;
|
||||
|
||||
return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
|
||||
}
|
||||
|
||||
/**
|
||||
* Version information about used database
|
||||
* @param bool $raw if true, only return the fetched sql_server_version
|
||||
* @return string sql server version
|
||||
*/
|
||||
function sql_server_info($raw = false)
|
||||
function sql_server_info()
|
||||
{
|
||||
if ($this->service_handle !== false && function_exists('ibase_server_info'))
|
||||
{
|
||||
return @ibase_server_info($this->service_handle, IBASE_SVC_SERVER_VERSION);
|
||||
}
|
||||
|
||||
return ($raw) ? '2.0' : 'Firebird/Interbase';
|
||||
return 'Firebird/Interbase';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -254,7 +238,7 @@ class dbal_firebird extends dbal
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->query_result;
|
||||
return ($this->query_result) ? $this->query_result : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -425,7 +409,7 @@ class dbal_firebird extends dbal
|
||||
*/
|
||||
function sql_escape($msg)
|
||||
{
|
||||
return str_replace(array("'", "\0"), array("''", ''), $msg);
|
||||
return str_replace("'", "''", $msg);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -32,11 +32,9 @@ class dbal_mssql extends dbal
|
||||
{
|
||||
$this->persistency = $persistency;
|
||||
$this->user = $sqluser;
|
||||
$this->server = $sqlserver . (($port) ? ':' . $port : '');
|
||||
$this->dbname = $database;
|
||||
|
||||
$port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':';
|
||||
$this->server = $sqlserver . (($port) ? $port_delimiter . $port : '');
|
||||
|
||||
@ini_set('mssql.charset', 'UTF-8');
|
||||
@ini_set('mssql.textlimit', 2147483647);
|
||||
@ini_set('mssql.textsize', 2147483647);
|
||||
@@ -64,38 +62,24 @@ class dbal_mssql extends dbal
|
||||
|
||||
/**
|
||||
* Version information about used database
|
||||
* @param bool $raw if true, only return the fetched sql_server_version
|
||||
* @return string sql server version
|
||||
*/
|
||||
function sql_server_info($raw = false)
|
||||
function sql_server_info()
|
||||
{
|
||||
global $cache;
|
||||
$result_id = @mssql_query("SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')", $this->db_connect_id);
|
||||
|
||||
if (empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
|
||||
$row = false;
|
||||
if ($result_id)
|
||||
{
|
||||
$result_id = @mssql_query("SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')", $this->db_connect_id);
|
||||
|
||||
$row = false;
|
||||
if ($result_id)
|
||||
{
|
||||
$row = @mssql_fetch_assoc($result_id);
|
||||
@mssql_free_result($result_id);
|
||||
}
|
||||
|
||||
$this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0;
|
||||
|
||||
if (!empty($cache))
|
||||
{
|
||||
$cache->put('mssql_version', $this->sql_server_version);
|
||||
}
|
||||
$row = @mssql_fetch_assoc($result_id);
|
||||
@mssql_free_result($result_id);
|
||||
}
|
||||
|
||||
if ($raw)
|
||||
if ($row)
|
||||
{
|
||||
return $this->sql_server_version;
|
||||
return 'MSSQL<br />' . implode(' ', $row);
|
||||
}
|
||||
|
||||
return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
|
||||
return 'MSSQL';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,7 +162,7 @@ class dbal_mssql extends dbal
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->query_result;
|
||||
return ($this->query_result) ? $this->query_result : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -328,7 +312,7 @@ class dbal_mssql extends dbal
|
||||
*/
|
||||
function sql_escape($msg)
|
||||
{
|
||||
return str_replace(array("'", "\0"), array("''", ''), $msg);
|
||||
return str_replace("'", "''", $msg);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -40,11 +40,9 @@ class dbal_mssql_odbc extends dbal
|
||||
{
|
||||
$this->persistency = $persistency;
|
||||
$this->user = $sqluser;
|
||||
$this->server = $sqlserver . (($port) ? ':' . $port : '');
|
||||
$this->dbname = $database;
|
||||
|
||||
$port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':';
|
||||
$this->server = $sqlserver . (($port) ? $port_delimiter . $port : '');
|
||||
|
||||
$max_size = @ini_get('odbc.defaultlrl');
|
||||
if (!empty($max_size))
|
||||
{
|
||||
@@ -75,38 +73,24 @@ class dbal_mssql_odbc extends dbal
|
||||
|
||||
/**
|
||||
* Version information about used database
|
||||
* @param bool $raw if true, only return the fetched sql_server_version
|
||||
* @return string sql server version
|
||||
*/
|
||||
function sql_server_info($raw = false)
|
||||
function sql_server_info()
|
||||
{
|
||||
global $cache;
|
||||
$result_id = @odbc_exec($this->db_connect_id, "SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')");
|
||||
|
||||
if (empty($cache) || ($this->sql_server_version = $cache->get('mssqlodbc_version')) === false)
|
||||
$row = false;
|
||||
if ($result_id)
|
||||
{
|
||||
$result_id = @odbc_exec($this->db_connect_id, "SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')");
|
||||
|
||||
$row = false;
|
||||
if ($result_id)
|
||||
{
|
||||
$row = @odbc_fetch_array($result_id);
|
||||
@odbc_free_result($result_id);
|
||||
}
|
||||
|
||||
$this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0;
|
||||
|
||||
if (!empty($cache))
|
||||
{
|
||||
$cache->put('mssqlodbc_version', $this->sql_server_version);
|
||||
}
|
||||
$row = @odbc_fetch_array($result_id);
|
||||
@odbc_free_result($result_id);
|
||||
}
|
||||
|
||||
if ($raw)
|
||||
if ($row)
|
||||
{
|
||||
return $this->sql_server_version;
|
||||
return 'MSSQL (ODBC)<br />' . implode(' ', $row);
|
||||
}
|
||||
|
||||
return ($this->sql_server_version) ? 'MSSQL (ODBC)<br />' . $this->sql_server_version : 'MSSQL (ODBC)';
|
||||
return 'MSSQL (ODBC)';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,7 +174,7 @@ class dbal_mssql_odbc extends dbal
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->query_result;
|
||||
return ($this->query_result) ? $this->query_result : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -349,7 +333,7 @@ class dbal_mssql_odbc extends dbal
|
||||
*/
|
||||
function sql_escape($msg)
|
||||
{
|
||||
return str_replace(array("'", "\0"), array("''", ''), $msg);
|
||||
return str_replace("'", "''", $msg);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -29,6 +29,7 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
|
||||
*/
|
||||
class dbal_mysql extends dbal
|
||||
{
|
||||
var $mysql_version;
|
||||
var $multi_insert = true;
|
||||
|
||||
/**
|
||||
@@ -51,12 +52,13 @@ class dbal_mysql extends dbal
|
||||
if (@mysql_select_db($this->dbname, $this->db_connect_id))
|
||||
{
|
||||
// Determine what version we are using and if it natively supports UNICODE
|
||||
if (version_compare($this->sql_server_info(true), '4.1.0', '>='))
|
||||
$this->mysql_version = mysql_get_server_info($this->db_connect_id);
|
||||
|
||||
if (version_compare($this->mysql_version, '4.1.3', '>='))
|
||||
{
|
||||
@mysql_query("SET NAMES 'utf8'", $this->db_connect_id);
|
||||
|
||||
// enforce strict mode on databases that support it
|
||||
if (version_compare($this->sql_server_info(true), '5.0.2', '>='))
|
||||
if (version_compare($this->mysql_version, '5.0.2', '>='))
|
||||
{
|
||||
$result = @mysql_query('SELECT @@session.sql_mode AS sql_mode', $this->db_connect_id);
|
||||
$row = @mysql_fetch_assoc($result);
|
||||
@@ -81,7 +83,7 @@ class dbal_mysql extends dbal
|
||||
@mysql_query("SET SESSION sql_mode='{$mode}'", $this->db_connect_id);
|
||||
}
|
||||
}
|
||||
else if (version_compare($this->sql_server_info(true), '4.0.0', '<'))
|
||||
else if (version_compare($this->mysql_version, '4.0.0', '<'))
|
||||
{
|
||||
$this->sql_layer = 'mysql';
|
||||
}
|
||||
@@ -95,28 +97,10 @@ class dbal_mysql extends dbal
|
||||
|
||||
/**
|
||||
* Version information about used database
|
||||
* @param bool $raw if true, only return the fetched sql_server_version
|
||||
* @return string sql server version
|
||||
*/
|
||||
function sql_server_info($raw = false)
|
||||
function sql_server_info()
|
||||
{
|
||||
global $cache;
|
||||
|
||||
if (empty($cache) || ($this->sql_server_version = $cache->get('mysql_version')) === false)
|
||||
{
|
||||
$result = @mysql_query('SELECT VERSION() AS version', $this->db_connect_id);
|
||||
$row = @mysql_fetch_assoc($result);
|
||||
@mysql_free_result($result);
|
||||
|
||||
$this->sql_server_version = $row['version'];
|
||||
|
||||
if (!empty($cache))
|
||||
{
|
||||
$cache->put('mysql_version', $this->sql_server_version);
|
||||
}
|
||||
}
|
||||
|
||||
return ($raw) ? $this->sql_server_version : 'MySQL ' . $this->sql_server_version;
|
||||
return 'MySQL ' . $this->mysql_version;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -199,7 +183,7 @@ class dbal_mysql extends dbal
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->query_result;
|
||||
return ($this->query_result) ? $this->query_result : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -341,7 +325,7 @@ class dbal_mysql extends dbal
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* return sql error array
|
||||
* @access private
|
||||
@@ -383,9 +367,13 @@ class dbal_mysql extends dbal
|
||||
if ($test_prof === null)
|
||||
{
|
||||
$test_prof = false;
|
||||
if (version_compare($this->sql_server_info(true), '5.0.37', '>=') && version_compare($this->sql_server_info(true), '5.1', '<'))
|
||||
if (strpos($this->mysql_version, 'community') !== false)
|
||||
{
|
||||
$test_prof = true;
|
||||
$ver = substr($this->mysql_version, 0, strpos($this->mysql_version, '-'));
|
||||
if (version_compare($ver, '5.0.37', '>=') && version_compare($ver, '5.1', '<'))
|
||||
{
|
||||
$test_prof = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -45,14 +45,12 @@ class dbal_mysqli extends dbal
|
||||
if ($this->db_connect_id && $this->dbname != '')
|
||||
{
|
||||
@mysqli_query($this->db_connect_id, "SET NAMES 'utf8'");
|
||||
|
||||
// enforce strict mode on databases that support it
|
||||
if (version_compare($this->sql_server_info(true), '5.0.2', '>='))
|
||||
if (mysqli_get_server_version($this->db_connect_id) >= 50002)
|
||||
{
|
||||
$result = @mysqli_query($this->db_connect_id, 'SELECT @@session.sql_mode AS sql_mode');
|
||||
$row = @mysqli_fetch_assoc($result);
|
||||
@mysqli_free_result($result);
|
||||
|
||||
$modes = array_map('trim', explode(',', $row['sql_mode']));
|
||||
|
||||
// TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES
|
||||
@@ -80,28 +78,10 @@ class dbal_mysqli extends dbal
|
||||
|
||||
/**
|
||||
* Version information about used database
|
||||
* @param bool $raw if true, only return the fetched sql_server_version
|
||||
* @return string sql server version
|
||||
*/
|
||||
function sql_server_info($raw = false)
|
||||
function sql_server_info()
|
||||
{
|
||||
global $cache;
|
||||
|
||||
if (empty($cache) || ($this->sql_server_version = $cache->get('mysqli_version')) === false)
|
||||
{
|
||||
$result = @mysqli_query($this->db_connect_id, 'SELECT VERSION() AS version');
|
||||
$row = @mysqli_fetch_assoc($result);
|
||||
@mysqli_free_result($result);
|
||||
|
||||
$this->sql_server_version = $row['version'];
|
||||
|
||||
if (!empty($cache))
|
||||
{
|
||||
$cache->put('mysqli_version', $this->sql_server_version);
|
||||
}
|
||||
}
|
||||
|
||||
return ($raw) ? $this->sql_server_version : 'MySQL(i) ' . $this->sql_server_version;
|
||||
return 'MySQL(i) ' . @mysqli_get_server_info($this->db_connect_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -183,7 +163,7 @@ class dbal_mysqli extends dbal
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->query_result;
|
||||
return ($this->query_result) ? $this->query_result : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -55,31 +55,10 @@ class dbal_oracle extends dbal
|
||||
|
||||
/**
|
||||
* Version information about used database
|
||||
* @param bool $raw if true, only return the fetched sql_server_version
|
||||
* @return string sql server version
|
||||
*/
|
||||
function sql_server_info($raw = false)
|
||||
function sql_server_info()
|
||||
{
|
||||
/*
|
||||
global $cache;
|
||||
|
||||
if (empty($cache) || ($this->sql_server_version = $cache->get('oracle_version')) === false)
|
||||
{
|
||||
$result = @ociparse($this->db_connect_id, 'SELECT * FROM v$version WHERE banner LIKE \'Oracle%\'');
|
||||
@ociexecute($result, OCI_DEFAULT);
|
||||
@ocicommit($this->db_connect_id);
|
||||
|
||||
$row = array();
|
||||
@ocifetchinto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS);
|
||||
@ocifreestatement($result);
|
||||
$this->sql_server_version = trim($row['BANNER']);
|
||||
|
||||
$cache->put('oracle_version', $this->sql_server_version);
|
||||
}
|
||||
*/
|
||||
$this->sql_server_version = @ociserverversion($this->db_connect_id);
|
||||
|
||||
return $this->sql_server_version;
|
||||
return @ociserverversion($this->db_connect_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,7 +168,7 @@ class dbal_oracle extends dbal
|
||||
$out .= ' ' . $val[1] . '(';
|
||||
$in_array = array();
|
||||
|
||||
// constuct each IN() clause
|
||||
// constuct each IN() clause
|
||||
foreach ($in_clause as $in_values)
|
||||
{
|
||||
$in_array[] = $val[2] . ' ' . (isset($val[6]) ? $val[6] : '') . 'IN(' . implode(', ', $in_values) . ')';
|
||||
@@ -376,7 +355,7 @@ class dbal_oracle extends dbal
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->query_result;
|
||||
return ($this->query_result) ? $this->query_result : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -551,7 +530,7 @@ class dbal_oracle extends dbal
|
||||
*/
|
||||
function sql_escape($msg)
|
||||
{
|
||||
return str_replace(array("'", "\0"), array("''", ''), $msg);
|
||||
return str_replace("'", "''", $msg);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -26,7 +26,8 @@ include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);
|
||||
class dbal_postgres extends dbal
|
||||
{
|
||||
var $last_query_text = '';
|
||||
|
||||
var $pgsql_version;
|
||||
|
||||
/**
|
||||
* Connect to server
|
||||
*/
|
||||
@@ -55,7 +56,7 @@ class dbal_postgres extends dbal
|
||||
{
|
||||
$connect_string .= "host=$sqlserver ";
|
||||
}
|
||||
|
||||
|
||||
if ($port)
|
||||
{
|
||||
$connect_string .= "port=$port ";
|
||||
@@ -80,7 +81,24 @@ class dbal_postgres extends dbal
|
||||
|
||||
if ($this->db_connect_id)
|
||||
{
|
||||
if (version_compare($this->sql_server_info(true), '8.2', '>='))
|
||||
// determine what version of PostgreSQL is running, we can be more efficient if they are running 8.2+
|
||||
if (version_compare(PHP_VERSION, '5.0.0', '>='))
|
||||
{
|
||||
$this->pgsql_version = @pg_parameter_status($this->db_connect_id, 'server_version');
|
||||
}
|
||||
else
|
||||
{
|
||||
$query_id = @pg_query($this->db_connect_id, 'SELECT VERSION()');
|
||||
$row = @pg_fetch_assoc($query_id, null);
|
||||
@pg_free_result($query_id);
|
||||
|
||||
if (!empty($row['version']))
|
||||
{
|
||||
$this->pgsql_version = substr($row['version'], 10);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($this->pgsql_version) && $this->pgsql_version[0] >= '8' && $this->pgsql_version[2] >= '2')
|
||||
{
|
||||
$this->multi_insert = true;
|
||||
}
|
||||
@@ -97,28 +115,10 @@ class dbal_postgres extends dbal
|
||||
|
||||
/**
|
||||
* Version information about used database
|
||||
* @param bool $raw if true, only return the fetched sql_server_version
|
||||
* @return string sql server version
|
||||
*/
|
||||
function sql_server_info($raw = false)
|
||||
function sql_server_info()
|
||||
{
|
||||
global $cache;
|
||||
|
||||
if (empty($cache) || ($this->sql_server_version = $cache->get('pgsql_version')) === false)
|
||||
{
|
||||
$query_id = @pg_query($this->db_connect_id, 'SELECT VERSION() AS version');
|
||||
$row = @pg_fetch_assoc($query_id, null);
|
||||
@pg_free_result($query_id);
|
||||
|
||||
$this->sql_server_version = (!empty($row['version'])) ? trim(substr($row['version'], 10)) : 0;
|
||||
|
||||
if (!empty($cache))
|
||||
{
|
||||
$cache->put('pgsql_version', $this->sql_server_version);
|
||||
}
|
||||
}
|
||||
|
||||
return ($raw) ? $this->sql_server_version : 'PostgreSQL ' . $this->sql_server_version;
|
||||
return 'PostgreSQL ' . $this->pgsql_version;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -202,7 +202,7 @@ class dbal_postgres extends dbal
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->query_result;
|
||||
return ($this->query_result) ? $this->query_result : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -224,7 +224,7 @@ class dbal_postgres extends dbal
|
||||
// if $total is set to 0 we do not want to limit the number of rows
|
||||
if ($total == 0)
|
||||
{
|
||||
$total = 'ALL';
|
||||
$total = -1;
|
||||
}
|
||||
|
||||
$query .= "\n LIMIT $total OFFSET $offset";
|
||||
|
@@ -41,31 +41,18 @@ class dbal_sqlite extends dbal
|
||||
if ($this->db_connect_id)
|
||||
{
|
||||
@sqlite_query('PRAGMA short_column_names = 1', $this->db_connect_id);
|
||||
// @sqlite_query('PRAGMA encoding = "UTF-8"', $this->db_connect_id);
|
||||
}
|
||||
|
||||
|
||||
return ($this->db_connect_id) ? true : array('message' => $error);
|
||||
}
|
||||
|
||||
/**
|
||||
* Version information about used database
|
||||
* @param bool $raw if true, only return the fetched sql_server_version
|
||||
* @return string sql server version
|
||||
*/
|
||||
function sql_server_info($raw = false)
|
||||
function sql_server_info()
|
||||
{
|
||||
global $cache;
|
||||
|
||||
if (empty($cache) || ($this->sql_server_version = $cache->get('sqlite_version')) === false)
|
||||
{
|
||||
$result = @sqlite_query('SELECT sqlite_version() AS version', $this->db_connect_id);
|
||||
$row = @sqlite_fetch_array($result, SQLITE_ASSOC);
|
||||
|
||||
$this->sql_server_version = (!empty($row['version'])) ? $row['version'] : 0;
|
||||
$cache->put('sqlite_version', $this->sql_server_version);
|
||||
}
|
||||
|
||||
return ($raw) ? $this->sql_server_version : 'SQLite ' . $this->sql_server_version;
|
||||
return 'SQLite ' . @sqlite_libversion();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,7 +135,7 @@ class dbal_sqlite extends dbal
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->query_result;
|
||||
return ($this->query_result) ? $this->query_result : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -17,7 +17,7 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
/**
|
||||
* Code from pear.php.net, Text_Diff-1.1.0 package
|
||||
* Code from pear.php.net, Text_Diff-0.2.1 (beta) package
|
||||
* http://pear.php.net/package/Text_Diff/
|
||||
*
|
||||
* Modified by phpBB Group to meet our coding standards
|
||||
@@ -26,9 +26,6 @@ if (!defined('IN_PHPBB'))
|
||||
* General API for generating and formatting diffs - the differences between
|
||||
* two sequences of strings.
|
||||
*
|
||||
* Copyright 2004 Geoffrey T. Dairiki <dairiki@dairiki.org>
|
||||
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* @package diff
|
||||
* @author Geoffrey T. Dairiki <dairiki@dairiki.org>
|
||||
*/
|
||||
@@ -48,7 +45,7 @@ class diff
|
||||
*/
|
||||
function diff(&$from_content, &$to_content, $preserve_cr = true)
|
||||
{
|
||||
$diff_engine = new diff_engine();
|
||||
$diff_engine = &new diff_engine();
|
||||
$this->_edits = $diff_engine->diff($from_content, $to_content, $preserve_cr);
|
||||
}
|
||||
|
||||
@@ -60,54 +57,12 @@ class diff
|
||||
return $this->_edits;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the number of new (added) lines in a given diff.
|
||||
*
|
||||
* @since Text_Diff 1.1.0
|
||||
*
|
||||
* @return integer The number of new lines
|
||||
*/
|
||||
function count_added_lines()
|
||||
{
|
||||
$count = 0;
|
||||
|
||||
foreach ($this->_edits as $edit)
|
||||
{
|
||||
if (is_a($edit, 'diff_op_add') || is_a($edit, 'diff_op_change'))
|
||||
{
|
||||
$count += $edit->nfinal();
|
||||
}
|
||||
}
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of deleted (removed) lines in a given diff.
|
||||
*
|
||||
* @since Text_Diff 1.1.0
|
||||
*
|
||||
* @return integer The number of deleted lines
|
||||
*/
|
||||
function count_deleted_lines()
|
||||
{
|
||||
$count = 0;
|
||||
|
||||
foreach ($this->_edits as $edit)
|
||||
{
|
||||
if (is_a($edit, 'diff_op_delete') || is_a($edit, 'diff_op_change'))
|
||||
{
|
||||
$count += $edit->norig();
|
||||
}
|
||||
}
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes a reversed diff.
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* $diff = new diff($lines1, $lines2);
|
||||
* $diff = &new diff($lines1, $lines2);
|
||||
* $rev = $diff->reverse();
|
||||
* </code>
|
||||
*
|
||||
@@ -330,7 +285,7 @@ class diff_op
|
||||
var $orig;
|
||||
var $final;
|
||||
|
||||
function &reverse()
|
||||
function reverse()
|
||||
{
|
||||
trigger_error('[diff] Abstract method', E_USER_ERROR);
|
||||
}
|
||||
@@ -366,7 +321,7 @@ class diff_op_copy extends diff_op
|
||||
|
||||
function &reverse()
|
||||
{
|
||||
$reverse = new diff_op_copy($this->final, $this->orig);
|
||||
$reverse = &new diff_op_copy($this->final, $this->orig);
|
||||
return $reverse;
|
||||
}
|
||||
}
|
||||
@@ -387,7 +342,7 @@ class diff_op_delete extends diff_op
|
||||
|
||||
function &reverse()
|
||||
{
|
||||
$reverse = new diff_op_add($this->orig);
|
||||
$reverse = &new diff_op_add($this->orig);
|
||||
return $reverse;
|
||||
}
|
||||
}
|
||||
@@ -408,7 +363,7 @@ class diff_op_add extends diff_op
|
||||
|
||||
function &reverse()
|
||||
{
|
||||
$reverse = new diff_op_delete($this->final);
|
||||
$reverse = &new diff_op_delete($this->final);
|
||||
return $reverse;
|
||||
}
|
||||
}
|
||||
@@ -429,7 +384,7 @@ class diff_op_change extends diff_op
|
||||
|
||||
function &reverse()
|
||||
{
|
||||
$reverse = new diff_op_change($this->final, $this->orig);
|
||||
$reverse = &new diff_op_change($this->final, $this->orig);
|
||||
return $reverse;
|
||||
}
|
||||
}
|
||||
@@ -458,7 +413,7 @@ class diff3 extends diff
|
||||
*/
|
||||
function diff3(&$orig, &$final1, &$final2)
|
||||
{
|
||||
$diff_engine = new diff_engine();
|
||||
$diff_engine = &new diff_engine();
|
||||
|
||||
$diff_1 = $diff_engine->diff($orig, $final1);
|
||||
$diff_2 = $diff_engine->diff($orig, $final2);
|
||||
@@ -469,37 +424,33 @@ class diff3 extends diff
|
||||
}
|
||||
|
||||
/**
|
||||
* Return number of conflicts
|
||||
*/
|
||||
function get_num_conflicts()
|
||||
{
|
||||
$conflicts = 0;
|
||||
|
||||
foreach ($this->_edits as $edit)
|
||||
{
|
||||
if ($edit->is_conflict())
|
||||
{
|
||||
$conflicts++;
|
||||
}
|
||||
}
|
||||
|
||||
return $conflicts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get conflicts content for download. This is generally a merged file, but preserving conflicts and adding explanations to it.
|
||||
* A user could then go through this file, search for the conflicts and changes the code accordingly.
|
||||
* Return merged output
|
||||
*
|
||||
* @param string $label1 the cvs file version/label from the original set of lines
|
||||
* @param string $label2 the cvs file version/label from the new set of lines
|
||||
* @param string $label_sep the explanation between label1 and label2 - more of a helper for the user
|
||||
* @param bool $get_conflicts if set to true only the number of conflicts is returned
|
||||
* @param bool $merge_new if set to true the merged output will have the new file contents on a conflicting merge
|
||||
*
|
||||
* @return mixed the merged output
|
||||
*/
|
||||
function get_conflicts_content($label1 = 'CURRENT_FILE', $label2 = 'NEW_FILE', $label_sep = 'DIFF_SEP_EXPLAIN')
|
||||
function merged_output($label1 = 'CURRENT_FILE', $label2 = 'NEW_FILE', $label_sep = 'DIFF_SEP_EXPLAIN', $get_conflicts = false, $merge_new = false)
|
||||
{
|
||||
global $user;
|
||||
|
||||
if ($get_conflicts)
|
||||
{
|
||||
foreach ($this->_edits as $edit)
|
||||
{
|
||||
if ($edit->is_conflict())
|
||||
{
|
||||
$this->_conflicting_blocks++;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_conflicting_blocks;
|
||||
}
|
||||
|
||||
$label1 = (!empty($user->lang[$label1])) ? $user->lang[$label1] : $label1;
|
||||
$label2 = (!empty($user->lang[$label2])) ? $user->lang[$label2] : $label2;
|
||||
$label_sep = (!empty($user->lang[$label_sep])) ? $user->lang[$label_sep] : $label_sep;
|
||||
@@ -510,12 +461,14 @@ class diff3 extends diff
|
||||
{
|
||||
if ($edit->is_conflict())
|
||||
{
|
||||
// Start conflict label
|
||||
$label_start = array('<<<<<<< ' . $label1);
|
||||
$label_mid = array('======= ' . $label_sep);
|
||||
$label_end = array('>>>>>>> ' . $label2);
|
||||
|
||||
$lines = array_merge($lines, $label_start, $edit->final1, $label_mid, $edit->final2, $label_end);
|
||||
if (!$merge_new)
|
||||
{
|
||||
$lines = array_merge($lines, array('<<<<<<<' . ($label1 ? ' ' . $label1 : '')), $edit->final1, array('=======' . ($label_sep ? ' ' . $label_sep : '')), $edit->final2, array('>>>>>>>' . ($label2 ? ' ' . $label2 : '')));
|
||||
}
|
||||
else
|
||||
{
|
||||
$lines = array_merge($lines, $edit->final1);
|
||||
}
|
||||
$this->_conflicting_blocks++;
|
||||
}
|
||||
else
|
||||
@@ -527,16 +480,6 @@ class diff3 extends diff
|
||||
return $lines;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return merged output (used by the renderer)
|
||||
*
|
||||
* @return mixed the merged output
|
||||
*/
|
||||
function merged_output()
|
||||
{
|
||||
return $this->get_conflicts_content();
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge the output and use the new file code for conflicts
|
||||
*/
|
||||
@@ -605,7 +548,7 @@ class diff3 extends diff
|
||||
function _diff3(&$edits1, &$edits2)
|
||||
{
|
||||
$edits = array();
|
||||
$bb = new diff3_block_builder();
|
||||
$bb = &new diff3_block_builder();
|
||||
|
||||
$e1 = current($edits1);
|
||||
$e2 = current($edits2);
|
||||
@@ -622,7 +565,7 @@ class diff3 extends diff
|
||||
}
|
||||
|
||||
$ncopy = min($e1->norig(), $e2->norig());
|
||||
$edits[] = new diff3_op_copy(array_slice($e1->orig, 0, $ncopy));
|
||||
$edits[] = &new diff3_op_copy(array_slice($e1->orig, 0, $ncopy));
|
||||
|
||||
if ($e1->norig() > $ncopy)
|
||||
{
|
||||
@@ -816,7 +759,7 @@ class diff3_block_builder
|
||||
}
|
||||
else
|
||||
{
|
||||
$edit = new diff3_op($this->orig, $this->final1, $this->final2);
|
||||
$edit = &new diff3_op($this->orig, $this->final1, $this->final2);
|
||||
$this->_init();
|
||||
return $edit;
|
||||
}
|
||||
|
@@ -17,20 +17,21 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
/**
|
||||
* Code from pear.php.net, Text_Diff-1.1.0 package
|
||||
* http://pear.php.net/package/Text_Diff/ (native engine)
|
||||
* Code from pear.php.net, Text_Diff-0.2.1 (beta) package
|
||||
* http://pear.php.net/package/Text_Diff/
|
||||
*
|
||||
* Modified by phpBB Group to meet our coding standards
|
||||
* and being able to integrate into phpBB
|
||||
*
|
||||
* Class used internally by Text_Diff to actually compute the diffs. This
|
||||
* class is implemented using native PHP code.
|
||||
* Class used internally by Diff to actually compute the diffs. This class is
|
||||
* implemented using native PHP code.
|
||||
*
|
||||
* The algorithm used here is mostly lifted from the perl module
|
||||
* Algorithm::Diff (version 1.06) by Ned Konz, which is available at:
|
||||
* http://www.perl.com/CPAN/authors/id/N/NE/NEDKONZ/Algorithm-Diff-1.06.zip
|
||||
*
|
||||
* More ideas are taken from: http://www.ics.uci.edu/~eppstein/161/960229.html
|
||||
* More ideas are taken from:
|
||||
* http://www.ics.uci.edu/~eppstein/161/960229.html
|
||||
*
|
||||
* Some ideas (and a bit of code) are taken from analyze.c, of GNU
|
||||
* diffutils-2.7, which can be found at:
|
||||
@@ -40,8 +41,6 @@ if (!defined('IN_PHPBB'))
|
||||
* Geoffrey T. Dairiki <dairiki@dairiki.org>. The original PHP version of this
|
||||
* code was written by him, and is used/adapted with his permission.
|
||||
*
|
||||
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* @author Geoffrey T. Dairiki <dairiki@dairiki.org>
|
||||
* @package diff
|
||||
*
|
||||
@@ -160,7 +159,7 @@ class diff_engine
|
||||
|
||||
if ($copy)
|
||||
{
|
||||
$edits[] = new diff_op_copy($copy);
|
||||
$edits[] = &new diff_op_copy($copy);
|
||||
}
|
||||
|
||||
// Find deletes & adds.
|
||||
@@ -178,15 +177,15 @@ class diff_engine
|
||||
|
||||
if ($delete && $add)
|
||||
{
|
||||
$edits[] = new diff_op_change($delete, $add);
|
||||
$edits[] = &new diff_op_change($delete, $add);
|
||||
}
|
||||
else if ($delete)
|
||||
{
|
||||
$edits[] = new diff_op_delete($delete);
|
||||
$edits[] = &new diff_op_delete($delete);
|
||||
}
|
||||
else if ($add)
|
||||
{
|
||||
$edits[] = new diff_op_add($add);
|
||||
$edits[] = &new diff_op_add($add);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +251,7 @@ class diff_engine
|
||||
}
|
||||
}
|
||||
|
||||
$x1 = $xoff + (int)(($numer + ($xlim - $xoff) * $chunk) / $nchunks);
|
||||
$x1 = $xoff + (int)(($numer + ($xlim-$xoff)*$chunk) / $nchunks);
|
||||
|
||||
for (; $x < $x1; $x++)
|
||||
{
|
||||
@@ -263,8 +262,7 @@ class diff_engine
|
||||
}
|
||||
$matches = $ymatches[$line];
|
||||
|
||||
reset($matches);
|
||||
while (list(, $y) = each($matches))
|
||||
foreach ($matches as $y)
|
||||
{
|
||||
if (empty($this->in_seq[$y]))
|
||||
{
|
||||
@@ -275,7 +273,7 @@ class diff_engine
|
||||
}
|
||||
|
||||
// no reset() here
|
||||
while (list(, $y) = each($matches))
|
||||
while (list($junk, $y) = each($matches))
|
||||
{
|
||||
if ($y > $this->seq[$k - 1])
|
||||
{
|
||||
|
@@ -17,7 +17,7 @@ if (!defined('IN_PHPBB'))
|
||||
}
|
||||
|
||||
/**
|
||||
* Code from pear.php.net, Text_Diff-1.1.0 package
|
||||
* Code from pear.php.net, Text_Diff-0.2.1 (beta) package
|
||||
* http://pear.php.net/package/Text_Diff/
|
||||
*
|
||||
* Modified by phpBB Group to meet our coding standards
|
||||
@@ -28,8 +28,6 @@ if (!defined('IN_PHPBB'))
|
||||
* This class renders the diff in classic diff format. It is intended that
|
||||
* this class be customized via inheritance, to obtain fancier outputs.
|
||||
*
|
||||
* Copyright 2004-2008 The Horde Project (http://www.horde.org/)
|
||||
*
|
||||
* @package diff
|
||||
*/
|
||||
class diff_renderer
|
||||
@@ -107,7 +105,7 @@ class diff_renderer
|
||||
|
||||
unset($diff3);
|
||||
|
||||
$diff = new diff($diff_1, $diff_2);
|
||||
$diff = &new diff($diff_1, $diff_2);
|
||||
}
|
||||
|
||||
$nlead = $this->_leading_context_lines;
|
||||
@@ -118,41 +116,33 @@ class diff_renderer
|
||||
|
||||
foreach ($diffs as $i => $edit)
|
||||
{
|
||||
// If these are unchanged (copied) lines, and we want to keep leading or trailing context lines, extract them from the copy block.
|
||||
if (is_a($edit, 'diff_op_copy'))
|
||||
{
|
||||
// Do we have any diff blocks yet?
|
||||
if (is_array($block))
|
||||
{
|
||||
// How many lines to keep as context from the copy block.
|
||||
$keep = ($i == sizeof($diffs) - 1) ? $ntrail : $nlead + $ntrail;
|
||||
if (sizeof($edit->orig) <= $keep)
|
||||
{
|
||||
// We have less lines in the block than we want for context => keep the whole block.
|
||||
$block[] = $edit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($ntrail)
|
||||
{
|
||||
// Create a new block with as many lines as we need for the trailing context.
|
||||
$context = array_slice($edit->orig, 0, $ntrail);
|
||||
$block[] = new diff_op_copy($context);
|
||||
$block[] = &new diff_op_copy($context);
|
||||
}
|
||||
|
||||
$output .= $this->_block($x0, $ntrail + $xi - $x0, $y0, $ntrail + $yi - $y0, $block);
|
||||
$block = false;
|
||||
}
|
||||
}
|
||||
// Keep the copy block as the context for the next block.
|
||||
$context = $edit->orig;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't we have any diff blocks yet?
|
||||
if (!is_array($block))
|
||||
{
|
||||
// Extract context lines from the preceding copy block.
|
||||
$context = array_slice($context, sizeof($context) - $nlead);
|
||||
$x0 = $xi - sizeof($context);
|
||||
$y0 = $yi - sizeof($context);
|
||||
@@ -160,7 +150,7 @@ class diff_renderer
|
||||
|
||||
if ($context)
|
||||
{
|
||||
$block[] = new diff_op_copy($context);
|
||||
$block[] = &new diff_op_copy($context);
|
||||
}
|
||||
}
|
||||
$block[] = $edit;
|
||||
@@ -229,16 +219,6 @@ class diff_renderer
|
||||
$ybeg .= ',' . ($ybeg + $ylen - 1);
|
||||
}
|
||||
|
||||
// this matches the GNU Diff behaviour
|
||||
if ($xlen && !$ylen)
|
||||
{
|
||||
$ybeg--;
|
||||
}
|
||||
else if (!$xlen)
|
||||
{
|
||||
$xbeg--;
|
||||
}
|
||||
|
||||
return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg;
|
||||
}
|
||||
|
||||
@@ -469,11 +449,11 @@ class diff_renderer_inline extends diff_renderer
|
||||
$splitted_text_1 = $this->_split_on_words($text1, $nl);
|
||||
$splitted_text_2 = $this->_split_on_words($text2, $nl);
|
||||
|
||||
$diff = new diff($splitted_text_1, $splitted_text_2);
|
||||
$diff = &new diff($splitted_text_1, $splitted_text_2);
|
||||
unset($splitted_text_1, $splitted_text_2);
|
||||
|
||||
// Get the diff in inline format.
|
||||
$renderer = new diff_renderer_inline(array_merge($this->get_params(), array('split_level' => 'words')));
|
||||
$renderer = &new diff_renderer_inline(array_merge($this->get_params(), array('split_level' => 'words')));
|
||||
|
||||
// Run the diff and get the output.
|
||||
return str_replace($nl, "\n", $renderer->render($diff)) . "\n";
|
||||
|
@@ -32,7 +32,7 @@ function set_var(&$result, $var, $type, $multibyte = false)
|
||||
|
||||
if ($type == 'string')
|
||||
{
|
||||
$result = trim(htmlspecialchars(str_replace(array("\r\n", "\r", "\0"), array("\n", "\n", ''), $result), ENT_COMPAT, 'UTF-8'));
|
||||
$result = trim(htmlspecialchars(str_replace(array("\r\n", "\r"), array("\n", "\n"), $result), ENT_COMPAT, 'UTF-8'));
|
||||
|
||||
if (!empty($result))
|
||||
{
|
||||
@@ -164,37 +164,6 @@ function set_config($config_name, $config_value, $is_dynamic = false)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set dynamic config value with arithmetic operation.
|
||||
*/
|
||||
function set_config_count($config_name, $increment, $is_dynamic = false)
|
||||
{
|
||||
global $db, $cache;
|
||||
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'firebird':
|
||||
$sql_update = 'CAST(CAST(config_value as integer) + ' . (int) $increment . ' as CHAR)';
|
||||
break;
|
||||
|
||||
case 'postgres':
|
||||
$sql_update = 'int4(config_value) + ' . (int) $increment;
|
||||
break;
|
||||
|
||||
// MySQL, SQlite, mssql, mssql_odbc, oracle
|
||||
default:
|
||||
$sql_update = 'config_value + ' . (int) $increment;
|
||||
break;
|
||||
}
|
||||
|
||||
$db->sql_query('UPDATE ' . CONFIG_TABLE . ' SET config_value = ' . $sql_update . " WHERE config_name = '" . $db->sql_escape($config_name) . "'");
|
||||
|
||||
if (!$is_dynamic)
|
||||
{
|
||||
$cache->destroy('config');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates an alphanumeric random string of given length
|
||||
*/
|
||||
@@ -236,11 +205,6 @@ function get_formatted_filesize($bytes, $add_size_lang = true)
|
||||
{
|
||||
global $user;
|
||||
|
||||
if ($bytes >= pow(2, 30))
|
||||
{
|
||||
return ($add_size_lang) ? round($bytes / 1024 / 1024 / 1024, 2) . ' ' . $user->lang['GIB'] : round($bytes / 1024 / 1024 / 1024, 2);
|
||||
}
|
||||
|
||||
if ($bytes >= pow(2, 20))
|
||||
{
|
||||
return ($add_size_lang) ? round($bytes / 1024 / 1024, 2) . ' ' . $user->lang['MIB'] : round($bytes / 1024 / 1024, 2);
|
||||
@@ -356,11 +320,6 @@ function phpbb_hash($password)
|
||||
|
||||
/**
|
||||
* Check for correct password
|
||||
*
|
||||
* @param string $password The password in plain text
|
||||
* @param string $hash The stored password hash
|
||||
*
|
||||
* @return bool Returns true if the password is correct, false if not.
|
||||
*/
|
||||
function phpbb_check_hash($password, $hash)
|
||||
{
|
||||
@@ -495,180 +454,6 @@ function _hash_crypt_private($password, $setting, &$itoa64)
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Global function for chmodding directories and files for internal use
|
||||
*
|
||||
* This function determines owner and group whom the file belongs to and user and group of PHP and then set safest possible file permissions.
|
||||
* The function determines owner and group from common.php file and sets the same to the provided file.
|
||||
* The function uses bit fields to build the permissions.
|
||||
* The function sets the appropiate execute bit on directories.
|
||||
*
|
||||
* Supported constants representing bit fields are:
|
||||
*
|
||||
* CHMOD_ALL - all permissions (7)
|
||||
* CHMOD_READ - read permission (4)
|
||||
* CHMOD_WRITE - write permission (2)
|
||||
* CHMOD_EXECUTE - execute permission (1)
|
||||
*
|
||||
* NOTE: The function uses POSIX extension and fileowner()/filegroup() functions. If any of them is disabled, this function tries to build proper permissions, by calling is_readable() and is_writable() functions.
|
||||
*
|
||||
* @param string $filename The file/directory to be chmodded
|
||||
* @param int $perms Permissions to set
|
||||
*
|
||||
* @return bool true on success, otherwise false
|
||||
* @author faw, phpBB Group
|
||||
*/
|
||||
function phpbb_chmod($filename, $perms = CHMOD_READ)
|
||||
{
|
||||
static $_chmod_info;
|
||||
|
||||
// Return if the file no longer exists.
|
||||
if (!file_exists($filename))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Determine some common vars
|
||||
if (empty($_chmod_info))
|
||||
{
|
||||
if (!function_exists('fileowner') || !function_exists('filegroup'))
|
||||
{
|
||||
// No need to further determine owner/group - it is unknown
|
||||
$_chmod_info['process'] = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
// Determine owner/group of common.php file and the filename we want to change here
|
||||
$common_php_owner = fileowner($phpbb_root_path . 'common.' . $phpEx);
|
||||
$common_php_group = filegroup($phpbb_root_path . 'common.' . $phpEx);
|
||||
|
||||
// And the owner and the groups PHP is running under.
|
||||
$php_uid = (function_exists('posix_getuid')) ? @posix_getuid() : false;
|
||||
$php_gids = (function_exists('posix_getgroups')) ? @posix_getgroups() : false;
|
||||
|
||||
// If we are unable to get owner/group, then do not try to set them by guessing
|
||||
if (!$php_uid || empty($php_gids) || !$common_php_owner || !$common_php_group)
|
||||
{
|
||||
$_chmod_info['process'] = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_chmod_info = array(
|
||||
'process' => true,
|
||||
'common_owner' => $common_php_owner,
|
||||
'common_group' => $common_php_group,
|
||||
'php_uid' => $php_uid,
|
||||
'php_gids' => $php_gids,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($_chmod_info['process'])
|
||||
{
|
||||
$file_uid = fileowner($filename);
|
||||
$file_gid = filegroup($filename);
|
||||
|
||||
// Change owner
|
||||
if (@chown($filename, $_chmod_info['common_owner']))
|
||||
{
|
||||
clearstatcache();
|
||||
$file_uid = fileowner($filename);
|
||||
}
|
||||
|
||||
// Change group
|
||||
if (@chgrp($filename, $_chmod_info['common_group']))
|
||||
{
|
||||
clearstatcache();
|
||||
$file_gid = filegroup($filename);
|
||||
}
|
||||
|
||||
// If the file_uid/gid now match the one from common.php we can process further, else we are not able to change something
|
||||
if ($file_uid != $_chmod_info['common_owner'] || $file_gid != $_chmod_info['common_group'])
|
||||
{
|
||||
$_chmod_info['process'] = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Still able to process?
|
||||
if ($_chmod_info['process'])
|
||||
{
|
||||
if ($file_uid == $_chmod_info['php_uid'])
|
||||
{
|
||||
$php = 'owner';
|
||||
}
|
||||
else if (in_array($file_gid, $_chmod_info['php_gids']))
|
||||
{
|
||||
$php = 'group';
|
||||
}
|
||||
else
|
||||
{
|
||||
// Since we are setting the everyone bit anyway, no need to do expensive operations
|
||||
$_chmod_info['process'] = false;
|
||||
}
|
||||
}
|
||||
|
||||
// We are not able to determine or change something
|
||||
if (!$_chmod_info['process'])
|
||||
{
|
||||
$php = 'other';
|
||||
}
|
||||
|
||||
// Owner always has read/write permission
|
||||
$owner = CHMOD_READ | CHMOD_WRITE;
|
||||
if (is_dir($filename))
|
||||
{
|
||||
$owner |= CHMOD_EXECUTE;
|
||||
|
||||
// Only add execute bit to the permission if the dir needs to be readable
|
||||
if ($perms & CHMOD_READ)
|
||||
{
|
||||
$perms |= CHMOD_EXECUTE;
|
||||
}
|
||||
}
|
||||
|
||||
switch ($php)
|
||||
{
|
||||
case 'owner':
|
||||
$result = @chmod($filename, ($owner << 6) + (0 << 3) + (0 << 0));
|
||||
|
||||
clearstatcache();
|
||||
|
||||
if (is_readable($filename) && is_writable($filename))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case 'group':
|
||||
$result = @chmod($filename, ($owner << 6) + ($perms << 3) + (0 << 0));
|
||||
|
||||
clearstatcache();
|
||||
|
||||
if ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case 'other':
|
||||
$result = @chmod($filename, ($owner << 6) + ($perms << 3) + ($perms << 0));
|
||||
|
||||
clearstatcache();
|
||||
|
||||
if ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
// Compatibility functions
|
||||
|
||||
if (!function_exists('array_combine'))
|
||||
@@ -766,7 +551,7 @@ if (!function_exists('stripos'))
|
||||
*/
|
||||
function is_absolute($path)
|
||||
{
|
||||
return ($path[0] == '/' || (DIRECTORY_SEPARATOR == '\\' && preg_match('#^[a-z]:[/\\\]#i', $path))) ? true : false;
|
||||
return ($path[0] == '/' || (DIRECTORY_SEPARATOR == '\\' && preg_match('#^[a-z]:/#i', $path))) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1037,7 +822,7 @@ function tz_select($default = '', $truncate = false)
|
||||
{
|
||||
if ($truncate)
|
||||
{
|
||||
$zone_trunc = truncate_string($zone, 50, 255, false, '...');
|
||||
$zone_trunc = truncate_string($zone, 50, false, '...');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1128,7 +913,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
||||
$sql_update = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$sql_update[] = (int) $row['forum_id'];
|
||||
$sql_update[] = $row['forum_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
@@ -1894,33 +1679,6 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
|
||||
}
|
||||
}
|
||||
|
||||
$params_is_array = is_array($params);
|
||||
|
||||
// Get anchor
|
||||
$anchor = '';
|
||||
if (strpos($url, '#') !== false)
|
||||
{
|
||||
list($url, $anchor) = explode('#', $url, 2);
|
||||
$anchor = '#' . $anchor;
|
||||
}
|
||||
else if (!$params_is_array && strpos($params, '#') !== false)
|
||||
{
|
||||
list($params, $anchor) = explode('#', $params, 2);
|
||||
$anchor = '#' . $anchor;
|
||||
}
|
||||
|
||||
// Handle really simple cases quickly
|
||||
if ($_SID == '' && $session_id === false && empty($_EXTRA_URL) && !$params_is_array && !$anchor)
|
||||
{
|
||||
if ($params === false)
|
||||
{
|
||||
return $url;
|
||||
}
|
||||
|
||||
$url_delim = (strpos($url, '?') === false) ? '?' : (($is_amp) ? '&' : '&');
|
||||
return $url . ($params !== false ? $url_delim. $params : '');
|
||||
}
|
||||
|
||||
// Assign sid if session id is not specified
|
||||
if ($session_id === false)
|
||||
{
|
||||
@@ -1933,6 +1691,18 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
|
||||
// Appending custom url parameter?
|
||||
$append_url = (!empty($_EXTRA_URL)) ? implode($amp_delim, $_EXTRA_URL) : '';
|
||||
|
||||
$anchor = '';
|
||||
if (strpos($url, '#') !== false)
|
||||
{
|
||||
list($url, $anchor) = explode('#', $url, 2);
|
||||
$anchor = '#' . $anchor;
|
||||
}
|
||||
else if (!is_array($params) && strpos($params, '#') !== false)
|
||||
{
|
||||
list($params, $anchor) = explode('#', $params, 2);
|
||||
$anchor = '#' . $anchor;
|
||||
}
|
||||
|
||||
// Use the short variant if possible ;)
|
||||
if ($params === false)
|
||||
{
|
||||
@@ -1996,7 +1766,6 @@ function generate_board_url($without_script_path = false)
|
||||
$script_path = $config['script_path'];
|
||||
|
||||
$url = $server_protocol . $server_name;
|
||||
$cookie_secure = $config['cookie_secure'];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2007,7 +1776,7 @@ function generate_board_url($without_script_path = false)
|
||||
$script_path = $user->page['root_script_path'];
|
||||
}
|
||||
|
||||
if ($server_port && (($cookie_secure && $server_port <> 443) || (!$cookie_secure && $server_port <> 80)))
|
||||
if ($server_port && (($config['cookie_secure'] && $server_port <> 443) || (!$config['cookie_secure'] && $server_port <> 80)))
|
||||
{
|
||||
// HTTP HOST can carry a port number (we fetch $user->host, but for old versions this may be true)
|
||||
if (strpos($server_name, ':') === false)
|
||||
@@ -2033,12 +1802,8 @@ function generate_board_url($without_script_path = false)
|
||||
/**
|
||||
* Redirects the user to another page then exits the script nicely
|
||||
* This function is intended for urls within the board. It's not meant to redirect to cross-domains.
|
||||
*
|
||||
* @param string $url The url to redirect to
|
||||
* @param bool $return If true, do not redirect but return the sanitized URL. Default is no return.
|
||||
* @param bool $disable_cd_check If true, redirect() will redirect to an external domain. If false, the redirect point to the boards url if it does not match the current domain. Default is false.
|
||||
*/
|
||||
function redirect($url, $return = false, $disable_cd_check = false)
|
||||
function redirect($url, $return = false)
|
||||
{
|
||||
global $db, $cache, $config, $user, $phpbb_root_path;
|
||||
|
||||
@@ -2065,8 +1830,8 @@ function redirect($url, $return = false, $disable_cd_check = false)
|
||||
}
|
||||
else if (!empty($url_parts['scheme']) && !empty($url_parts['host']))
|
||||
{
|
||||
// Attention: only able to redirect within the same domain if $disable_cd_check is false (yourdomain.com -> www.yourdomain.com will not work)
|
||||
if (!$disable_cd_check && $url_parts['host'] !== $user->host)
|
||||
// Attention: only able to redirect within the same domain (yourdomain.com -> www.yourdomain.com will not work)
|
||||
if ($url_parts['host'] !== $user->host)
|
||||
{
|
||||
$url = generate_board_url();
|
||||
}
|
||||
@@ -2133,7 +1898,7 @@ function redirect($url, $return = false, $disable_cd_check = false)
|
||||
$url = substr($url, 1);
|
||||
}
|
||||
|
||||
$url = (!empty($dir) ? $dir . '/' : '') . $url;
|
||||
$url = $dir . '/' . $url;
|
||||
$url = generate_board_url() . '/' . $url;
|
||||
}
|
||||
}
|
||||
@@ -2279,17 +2044,12 @@ function build_url($strip_vars = false)
|
||||
|
||||
/**
|
||||
* Meta refresh assignment
|
||||
* Adds META template variable with meta http tag.
|
||||
*
|
||||
* @param int $time Time in seconds for meta refresh tag
|
||||
* @param string $url URL to redirect to. The url will go through redirect() first before the template variable is assigned
|
||||
* @param bool $disable_cd_check If true, meta_refresh() will redirect to an external domain. If false, the redirect point to the boards url if it does not match the current domain. Default is false.
|
||||
*/
|
||||
function meta_refresh($time, $url, $disable_cd_check = false)
|
||||
function meta_refresh($time, $url)
|
||||
{
|
||||
global $template;
|
||||
|
||||
$url = redirect($url, true, $disable_cd_check);
|
||||
$url = redirect($url, true);
|
||||
$url = str_replace('&', '&', $url);
|
||||
|
||||
// For XHTML compatibility we change back & to &
|
||||
@@ -2302,37 +2062,6 @@ function meta_refresh($time, $url, $disable_cd_check = false)
|
||||
|
||||
//Form validation
|
||||
|
||||
|
||||
/**
|
||||
* Add a secret hash for use in links/GET requests
|
||||
* @param string $link_name The name of the link; has to match the name used in check_link_hash, otherwise no restrictions apply
|
||||
* @return string the hash
|
||||
|
||||
*/
|
||||
function generate_link_hash($link_name)
|
||||
{
|
||||
global $user;
|
||||
|
||||
if (!isset($user->data["hash_$link_name"]))
|
||||
{
|
||||
$user->data["hash_$link_name"] = substr(sha1($user->data['user_form_salt'] . $link_name), 0, 8);
|
||||
}
|
||||
|
||||
return $user->data["hash_$link_name"];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* checks a link hash - for GET requests
|
||||
* @param string $token the submitted token
|
||||
* @param string $link_name The name of the link
|
||||
* @return boolean true if all is fine
|
||||
*/
|
||||
function check_link_hash($token, $link_name)
|
||||
{
|
||||
return $token === generate_link_hash($link_name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a secret token to the form (requires the S_FORM_TOKEN template variable)
|
||||
* @param string $form_name The name of the form; has to match the name used in check_form_key, otherwise no restrictions apply
|
||||
@@ -2340,18 +2069,16 @@ function check_link_hash($token, $link_name)
|
||||
function add_form_key($form_name)
|
||||
{
|
||||
global $config, $template, $user;
|
||||
|
||||
$now = time();
|
||||
$token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : '';
|
||||
$token = sha1($now . $user->data['user_form_salt'] . $form_name . $token_sid);
|
||||
|
||||
$s_fields = build_hidden_fields(array(
|
||||
'creation_time' => $now,
|
||||
'form_token' => $token,
|
||||
'creation_time' => $now,
|
||||
'form_token' => $token,
|
||||
));
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_FORM_TOKEN' => $s_fields,
|
||||
'S_FORM_TOKEN' => $s_fields,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -2377,26 +2104,23 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
|
||||
$creation_time = abs(request_var('creation_time', 0));
|
||||
$token = request_var('form_token', '');
|
||||
|
||||
$diff = time() - $creation_time;
|
||||
$diff = (time() - $creation_time);
|
||||
|
||||
// If creation_time and the time() now is zero we can assume it was not a human doing this (the check for if ($diff)...
|
||||
if ($diff && ($diff <= $timespan || $timespan === -1))
|
||||
if (($diff <= $timespan) || $timespan === -1)
|
||||
{
|
||||
$token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : '';
|
||||
$key = sha1($creation_time . $user->data['user_form_salt'] . $form_name . $token_sid);
|
||||
|
||||
$key = sha1($creation_time . $user->data['user_form_salt'] . $form_name . $token_sid);
|
||||
if ($key === $token)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($trigger)
|
||||
{
|
||||
trigger_error($user->lang['FORM_INVALID'] . $return_page);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2637,7 +2361,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Generate code
|
||||
$code = gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
|
||||
$code = gen_rand_string(mt_rand(5, 8));
|
||||
$confirm_id = md5(unique_id($user->ip));
|
||||
$seed = hexdec(substr(unique_id(), 4, 10));
|
||||
|
||||
@@ -3156,7 +2880,7 @@ function phpbb_checkdnsrr($host, $type = '')
|
||||
}
|
||||
|
||||
// @exec('nslookup -retry=1 -timout=1 -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host), $output);
|
||||
@exec('nslookup -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host) . '.', $output);
|
||||
@exec('nslookup -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host), $output);
|
||||
|
||||
// If output is empty, the nslookup failed
|
||||
if (empty($output))
|
||||
@@ -3182,8 +2906,7 @@ function phpbb_checkdnsrr($host, $type = '')
|
||||
}
|
||||
else if (function_exists('checkdnsrr'))
|
||||
{
|
||||
// The dot indicates to search the DNS root (helps those having DNS prefixes on the same domain)
|
||||
return (checkdnsrr($host . '.', $type)) ? true : false;
|
||||
return (checkdnsrr($host, $type)) ? true : false;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -3232,7 +2955,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
|
||||
}
|
||||
|
||||
// Another quick fix for those having gzip compression enabled, but do not flush if the coder wants to catch "something". ;)
|
||||
if (!empty($config['gzip_compress']))
|
||||
if ($config['gzip_compress'])
|
||||
{
|
||||
if (@extension_loaded('zlib') && !headers_sent() && !ob_get_level())
|
||||
{
|
||||
@@ -3245,7 +2968,6 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
|
||||
$msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text);
|
||||
|
||||
echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
|
||||
// echo '<br /><br />BACKTRACE<br />' . get_backtrace() . '<br />' . "\n";
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -3323,9 +3045,6 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
|
||||
echo '</html>';
|
||||
|
||||
exit_handler();
|
||||
|
||||
// On a fatal error (and E_USER_ERROR *is* fatal) we never want other scripts to continue and force an exit here.
|
||||
exit;
|
||||
break;
|
||||
|
||||
case E_USER_WARNING:
|
||||
@@ -3433,7 +3152,7 @@ function obtain_guest_count($forum_id = 0)
|
||||
AND s.session_time >= ' . ($time - ((int) ($time % 60))) .
|
||||
$reading_sql;
|
||||
}
|
||||
$result = $db->sql_query($sql);
|
||||
$result = $db->sql_query($sql, 60);
|
||||
$guests_online = (int) $db->sql_fetchfield('num_guests');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
@@ -3685,7 +3404,7 @@ function page_header($page_title = '', $display_online_list = true)
|
||||
$s_privmsg_new = false;
|
||||
|
||||
// Obtain number of new private messages if user is logged in
|
||||
if (!empty($user->data['is_registered']))
|
||||
if (isset($user->data['is_registered']) && $user->data['is_registered'])
|
||||
{
|
||||
if ($user->data['user_new_privmsg'])
|
||||
{
|
||||
@@ -3776,14 +3495,14 @@ function page_header($page_title = '', $display_online_list = true)
|
||||
'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' => ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=leaders'),
|
||||
'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_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false,
|
||||
'S_BOARD_DISABLED' => ($config['board_disable']) ? true : false,
|
||||
'S_REGISTERED_USER' => (!empty($user->data['is_registered'])) ? true : false,
|
||||
'S_IS_BOT' => (!empty($user->data['is_bot'])) ? true : false,
|
||||
'S_REGISTERED_USER' => $user->data['is_registered'],
|
||||
'S_IS_BOT' => $user->data['is_bot'],
|
||||
'S_USER_PM_POPUP' => $user->optionget('popuppm'),
|
||||
'S_USER_LANG' => $user_lang,
|
||||
'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'],
|
||||
@@ -3795,14 +3514,13 @@ function page_header($page_title = '', $display_online_list = true)
|
||||
'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' => ($l_online_time) ? 1 : 0,
|
||||
'S_DISPLAY_SEARCH' => (!$config['load_search']) ? 0 : (isset($auth) ? ($auth->acl_get('u_search') && $auth->acl_getf_global('f_search')) : 1),
|
||||
'S_DISPLAY_PM' => ($config['allow_privmsg'] && !empty($user->data['is_registered']) && ($auth->acl_get('u_readpm') || $auth->acl_get('u_sendpm'))) ? true : false,
|
||||
'S_DISPLAY_PM' => ($config['allow_privmsg'] && $user->data['is_registered'] && ($auth->acl_get('u_readpm') || $auth->acl_get('u_sendpm'))) ? true : false,
|
||||
'S_DISPLAY_MEMBERLIST' => (isset($auth)) ? $auth->acl_get('u_viewprofile') : 0,
|
||||
'S_NEW_PM' => ($s_privmsg_new) ? 1 : 0,
|
||||
'S_REGISTER_ENABLED' => ($config['require_activation'] != USER_ACTIVATION_DISABLE) ? true : false,
|
||||
|
||||
'T_THEME_PATH' => "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme',
|
||||
'T_TEMPLATE_PATH' => "{$phpbb_root_path}styles/" . $user->theme['template_path'] . '/template',
|
||||
'T_SUPER_TEMPLATE_PATH' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$phpbb_root_path}styles/" . $user->theme['template_inherit_path'] . '/template' : "{$phpbb_root_path}styles/" . $user->theme['template_path'] . '/template',
|
||||
'T_IMAGESET_PATH' => "{$phpbb_root_path}styles/" . $user->theme['imageset_path'] . '/imageset',
|
||||
'T_IMAGESET_LANG_PATH' => "{$phpbb_root_path}styles/" . $user->theme['imageset_path'] . '/imageset/' . $user->data['user_lang'],
|
||||
'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
|
||||
@@ -3815,10 +3533,8 @@ function page_header($page_title = '', $display_online_list = true)
|
||||
'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : "{$phpbb_root_path}style.$phpEx?sid=$user->session_id&id=" . $user->theme['style_id'] . '&lang=' . $user->data['user_lang'],
|
||||
'T_STYLESHEET_NAME' => $user->theme['theme_name'],
|
||||
|
||||
'SITE_LOGO_IMG' => $user->img('site_logo'),
|
||||
|
||||
'A_COOKIE_SETTINGS' => addslashes('; path=' . $config['cookie_path'] . ((!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain']) . ((!$config['cookie_secure']) ? '' : '; secure')),
|
||||
));
|
||||
'SITE_LOGO_IMG' => $user->img('site_logo'))
|
||||
);
|
||||
|
||||
// application/xhtml+xml not used because of IE
|
||||
header('Content-type: text/html; charset=UTF-8');
|
||||
@@ -3872,7 +3588,7 @@ function page_footer($run_cron = true)
|
||||
'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '',
|
||||
'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
|
||||
|
||||
'U_ACP' => ($auth->acl_get('a_') && !empty($user->data['is_registered'])) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", false, true, $user->session_id) : '')
|
||||
'U_ACP' => ($auth->acl_get('a_') && $user->data['is_registered']) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", false, true, $user->session_id) : '')
|
||||
);
|
||||
|
||||
// Call cron-type script
|
||||
@@ -3961,7 +3677,7 @@ function exit_handler()
|
||||
}
|
||||
|
||||
// As a pre-caution... some setups display a blank page if the flush() is not there.
|
||||
(empty($config['gzip_compress'])) ? @flush() : @ob_flush();
|
||||
(!$config['gzip_compress']) ? @flush() : @ob_flush();
|
||||
|
||||
exit;
|
||||
}
|
||||
|
@@ -97,7 +97,7 @@ function recalc_btree($sql_id, $sql_table, $module_class = '')
|
||||
$item_data['left_id'] = $row['right_id'] + 1;
|
||||
$item_data['right_id'] = $row['right_id'] + 2;
|
||||
}
|
||||
|
||||
|
||||
$sql = "UPDATE $sql_table
|
||||
SET left_id = {$item_data['left_id']}, right_id = {$item_data['right_id']}
|
||||
WHERE $sql_id = " . $item_data[$sql_id];
|
||||
@@ -551,7 +551,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
|
||||
'posts' => ($call_delete_posts) ? delete_posts($where_type, $where_ids, false, true, $post_count_sync, false) : 0,
|
||||
);
|
||||
|
||||
$sql = 'SELECT topic_id, forum_id, topic_approved, topic_moved_id
|
||||
$sql = 'SELECT topic_id, forum_id, topic_approved
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE ' . $where_clause;
|
||||
$result = $db->sql_query($sql);
|
||||
@@ -561,7 +561,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
|
||||
$forum_ids[] = $row['forum_id'];
|
||||
$topic_ids[] = $row['topic_id'];
|
||||
|
||||
if ($row['topic_approved'] && !$row['topic_moved_id'])
|
||||
if ($row['topic_approved'])
|
||||
{
|
||||
$approved_topics++;
|
||||
}
|
||||
@@ -619,7 +619,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
|
||||
|
||||
if ($approved_topics)
|
||||
{
|
||||
set_config_count('num_topics', $approved_topics * (-1), true);
|
||||
set_config('num_topics', $config['num_topics'] - $approved_topics, true);
|
||||
}
|
||||
|
||||
return $return;
|
||||
@@ -652,23 +652,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
|
||||
return false;
|
||||
}
|
||||
|
||||
$where_ids = array_map('intval', $where_ids);
|
||||
|
||||
/* Possible code for splitting post deletion
|
||||
if (sizeof($where_ids) >= 1001)
|
||||
{
|
||||
// Split into chunks of 1000
|
||||
$chunks = array_chunk($where_ids, 1000);
|
||||
|
||||
foreach ($chunks as $_where_ids)
|
||||
{
|
||||
delete_posts($where_type, $_where_ids, $auto_sync, $posted_sync, $post_count_sync, $call_delete_topics);
|
||||
}
|
||||
|
||||
return;
|
||||
}*/
|
||||
|
||||
$where_clause = $db->sql_in_set($where_type, $where_ids);
|
||||
$where_clause = $db->sql_in_set($where_type, array_map('intval', $where_ids));
|
||||
}
|
||||
|
||||
$approved_posts = 0;
|
||||
@@ -681,12 +665,12 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$post_ids[] = (int) $row['post_id'];
|
||||
$poster_ids[] = (int) $row['poster_id'];
|
||||
$topic_ids[] = (int) $row['topic_id'];
|
||||
$forum_ids[] = (int) $row['forum_id'];
|
||||
$post_ids[] = $row['post_id'];
|
||||
$poster_ids[] = $row['poster_id'];
|
||||
$topic_ids[] = $row['topic_id'];
|
||||
$forum_ids[] = $row['forum_id'];
|
||||
|
||||
if ($row['post_postcount'] && $post_count_sync && $row['post_approved'])
|
||||
if ($row['post_postcount'] && $post_count_sync)
|
||||
{
|
||||
$post_counts[$row['poster_id']] = (!empty($post_counts[$row['poster_id']])) ? $post_counts[$row['poster_id']] + 1 : 1;
|
||||
}
|
||||
@@ -725,7 +709,6 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
|
||||
WHERE user_id = ' . $poster_id . '
|
||||
AND user_posts < ' . $substract;
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET user_posts = user_posts - ' . $substract . '
|
||||
WHERE user_id = ' . $poster_id . '
|
||||
@@ -792,7 +775,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
|
||||
|
||||
if ($approved_posts)
|
||||
{
|
||||
set_config_count('num_posts', $approved_posts * (-1), true);
|
||||
set_config('num_posts', $config['num_posts'] - $approved_posts, true);
|
||||
}
|
||||
|
||||
// We actually remove topics now to not be inconsistent (the delete_topics function calls this function too)
|
||||
@@ -807,8 +790,8 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
|
||||
/**
|
||||
* Delete Attachments
|
||||
*
|
||||
* @param string $mode can be: post|message|topic|attach|user
|
||||
* @param mixed $ids can be: post_ids, message_ids, topic_ids, attach_ids, user_ids
|
||||
* @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)
|
||||
@@ -830,68 +813,46 @@ function delete_attachments($mode, $ids, $resync = true)
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql_where = '';
|
||||
$sql_id = ($mode == 'user') ? 'poster_id' : (($mode == 'post') ? 'post_msg_id' : (($mode == 'topic') ? 'topic_id' : 'attach_id'));
|
||||
|
||||
switch ($mode)
|
||||
$post_ids = $topic_ids = $physical = array();
|
||||
|
||||
// Collect post and topics ids for later use
|
||||
if ($mode == 'attach' || $mode == 'user' || ($mode == 'topic' && $resync))
|
||||
{
|
||||
case 'post':
|
||||
case 'message':
|
||||
$sql_id = 'post_msg_id';
|
||||
$sql_where = ' AND in_message = ' . ($mode == 'message' ? 1 : 0);
|
||||
break;
|
||||
|
||||
case 'topic':
|
||||
$sql_id = 'topic_id';
|
||||
break;
|
||||
|
||||
case 'user':
|
||||
$sql_id = 'poster_id';
|
||||
break;
|
||||
|
||||
case 'attach':
|
||||
default:
|
||||
$sql_id = 'attach_id';
|
||||
$mode = 'attach';
|
||||
break;
|
||||
}
|
||||
|
||||
$post_ids = $message_ids = $topic_ids = $physical = array();
|
||||
|
||||
// Collect post and topic ids for later use if we need to touch remaining entries (if resync is enabled)
|
||||
$sql = 'SELECT post_msg_id, topic_id, in_message, physical_filename, thumbnail, filesize, is_orphan
|
||||
$sql = 'SELECT post_msg_id as post_id, topic_id, physical_filename, thumbnail, filesize
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set($sql_id, $ids);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$sql .= $sql_where;
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
// We only need to store post/message/topic ids if resync is enabled and the file is not orphaned
|
||||
if ($resync && !$row['is_orphan'])
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if (!$row['in_message'])
|
||||
{
|
||||
$post_ids[] = $row['post_msg_id'];
|
||||
$topic_ids[] = $row['topic_id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$message_ids[] = $row['post_msg_id'];
|
||||
}
|
||||
$post_ids[] = $row['post_id'];
|
||||
$topic_ids[] = $row['topic_id'];
|
||||
$physical[] = array('filename' => $row['physical_filename'], 'thumbnail' => $row['thumbnail'], 'filesize' => $row['filesize']);
|
||||
}
|
||||
|
||||
$physical[] = array('filename' => $row['physical_filename'], 'thumbnail' => $row['thumbnail'], 'filesize' => $row['filesize'], 'is_orphan' => $row['is_orphan']);
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
if ($mode == 'post')
|
||||
{
|
||||
$sql = 'SELECT topic_id, physical_filename, thumbnail, filesize
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('post_msg_id', $ids) . '
|
||||
AND in_message = 0';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$topic_ids[] = $row['topic_id'];
|
||||
$physical[] = array('filename' => $row['physical_filename'], 'thumbnail' => $row['thumbnail'], 'filesize' => $row['filesize']);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Delete attachments
|
||||
$sql = 'DELETE FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set($sql_id, $ids);
|
||||
|
||||
$sql .= $sql_where;
|
||||
|
||||
$db->sql_query($sql);
|
||||
$num_deleted = $db->sql_affectedrows();
|
||||
|
||||
@@ -904,9 +865,8 @@ function delete_attachments($mode, $ids, $resync = true)
|
||||
$space_removed = $files_removed = 0;
|
||||
foreach ($physical as $file_ary)
|
||||
{
|
||||
if (phpbb_unlink($file_ary['filename'], 'file', true) && !$file_ary['is_orphan'])
|
||||
if (phpbb_unlink($file_ary['filename'], 'file', true))
|
||||
{
|
||||
// Only non-orphaned files count to the file size
|
||||
$space_removed += $file_ary['filesize'];
|
||||
$files_removed++;
|
||||
}
|
||||
@@ -916,72 +876,122 @@ function delete_attachments($mode, $ids, $resync = true)
|
||||
phpbb_unlink($file_ary['filename'], 'thumbnail', true);
|
||||
}
|
||||
}
|
||||
set_config('upload_dir_size', $config['upload_dir_size'] - $space_removed, true);
|
||||
set_config('num_files', $config['num_files'] - $files_removed, true);
|
||||
|
||||
if ($space_removed || $files_removed)
|
||||
{
|
||||
set_config_count('upload_dir_size', $space_removed * (-1), true);
|
||||
set_config_count('num_files', $files_removed * (-1), true);
|
||||
}
|
||||
|
||||
// If we do not resync, we do not need to adjust any message, post, topic or user entries
|
||||
if (!$resync)
|
||||
if ($mode == 'topic' && !$resync)
|
||||
{
|
||||
return $num_deleted;
|
||||
}
|
||||
|
||||
// No more use for the original ids
|
||||
if ($mode == 'post')
|
||||
{
|
||||
$post_ids = $ids;
|
||||
}
|
||||
unset($ids);
|
||||
|
||||
// Now, we need to resync posts, messages, topics. We go through every one of them
|
||||
$post_ids = array_unique($post_ids);
|
||||
$message_ids = array_unique($message_ids);
|
||||
$topic_ids = array_unique($topic_ids);
|
||||
|
||||
// Update post indicators for posts now no longer having attachments
|
||||
// Update post indicators
|
||||
if (sizeof($post_ids))
|
||||
{
|
||||
$sql = 'UPDATE ' . POSTS_TABLE . '
|
||||
SET post_attachment = 0
|
||||
WHERE ' . $db->sql_in_set('post_id', $post_ids);
|
||||
$db->sql_query($sql);
|
||||
if ($mode == 'post' || $mode == 'topic')
|
||||
{
|
||||
$sql = 'UPDATE ' . POSTS_TABLE . '
|
||||
SET post_attachment = 0
|
||||
WHERE ' . $db->sql_in_set('post_id', $post_ids);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
if ($mode == 'user' || $mode == 'attach')
|
||||
{
|
||||
$remaining = array();
|
||||
|
||||
$sql = 'SELECT post_msg_id
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('post_msg_id', $post_ids) . '
|
||||
AND in_message = 0';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$remaining[] = $row['post_msg_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$unset_ids = array_diff($post_ids, $remaining);
|
||||
|
||||
if (sizeof($unset_ids))
|
||||
{
|
||||
$sql = 'UPDATE ' . POSTS_TABLE . '
|
||||
SET post_attachment = 0
|
||||
WHERE ' . $db->sql_in_set('post_id', $unset_ids);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
$remaining = array();
|
||||
|
||||
$sql = 'SELECT post_msg_id
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('post_msg_id', $post_ids) . '
|
||||
AND in_message = 1';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$remaining[] = $row['post_msg_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$unset_ids = array_diff($post_ids, $remaining);
|
||||
|
||||
if (sizeof($unset_ids))
|
||||
{
|
||||
$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
|
||||
SET message_attachment = 0
|
||||
WHERE ' . $db->sql_in_set('msg_id', $unset_ids);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update message table if messages are affected
|
||||
if (sizeof($message_ids))
|
||||
{
|
||||
$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
|
||||
SET message_attachment = 0
|
||||
WHERE ' . $db->sql_in_set('msg_id', $message_ids);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
// Now update the topics. This is a bit trickier, because there could be posts still having attachments within the topic
|
||||
if (sizeof($topic_ids))
|
||||
{
|
||||
// Just check which topics are still having an assigned attachment not orphaned by querying the attachments table (much less entries expected)
|
||||
$sql = 'SELECT topic_id
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . '
|
||||
AND is_orphan = 0';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$remaining_ids = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$remaining_ids[] = $row['topic_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Now only unset those ids remaining
|
||||
$topic_ids = array_diff($topic_ids, $remaining_ids);
|
||||
|
||||
if (sizeof($topic_ids))
|
||||
// Update topic indicator
|
||||
if ($mode == 'topic')
|
||||
{
|
||||
$sql = 'UPDATE ' . TOPICS_TABLE . '
|
||||
SET topic_attachment = 0
|
||||
WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
if ($mode == 'post' || $mode == 'user' || $mode == 'attach')
|
||||
{
|
||||
$remaining = array();
|
||||
|
||||
$sql = 'SELECT topic_id
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('topic_id', $topic_ids);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$remaining[] = $row['topic_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$unset_ids = array_diff($topic_ids, $remaining);
|
||||
|
||||
if (sizeof($unset_ids))
|
||||
{
|
||||
$sql = 'UPDATE ' . TOPICS_TABLE . '
|
||||
SET topic_attachment = 0
|
||||
WHERE ' . $db->sql_in_set('topic_id', $unset_ids);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $num_deleted;
|
||||
@@ -1005,7 +1015,7 @@ function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = true)
|
||||
. $where;
|
||||
$db->sql_query($sql);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
$sql = 'SELECT t.topic_id
|
||||
FROM ' . TOPICS_TABLE . ' t, ' . TOPICS_TABLE . ' t2
|
||||
@@ -1203,7 +1213,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
|
||||
AND t1.forum_id = t2.forum_id";
|
||||
$db->sql_query($sql);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
$sql = 'SELECT t1.topic_id
|
||||
FROM ' .TOPICS_TABLE . ' t1, ' . TOPICS_TABLE . " t2
|
||||
@@ -2359,7 +2369,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
$log_type = LOG_USERS;
|
||||
$sql_forum = 'AND l.reportee_id = ' . (int) $user_id;
|
||||
break;
|
||||
|
||||
|
||||
case 'users':
|
||||
$log_type = LOG_USERS;
|
||||
$sql_forum = '';
|
||||
@@ -2369,7 +2379,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
$log_type = LOG_CRITICAL;
|
||||
$sql_forum = '';
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
@@ -2423,14 +2433,8 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
|
||||
if (isset($user->lang[$row['log_operation']]))
|
||||
{
|
||||
// Check if there are more occurrences of % than arguments, if there are we fill out the arguments array
|
||||
// It doesn't matter if we add more arguments than placeholders
|
||||
if ((substr_count($log[$i]['action'], '%') - sizeof($log_data_ary)) > 0)
|
||||
{
|
||||
$log_data_ary = array_merge($log_data_ary, array_fill(0, substr_count($log[$i]['action'], '%') - sizeof($log_data_ary), ''));
|
||||
}
|
||||
|
||||
$log[$i]['action'] = vsprintf($log[$i]['action'], $log_data_ary);
|
||||
// We supress the warning about inappropriate number of passed parameters here due to possible changes within LOG strings from one version to another.
|
||||
$log[$i]['action'] = @vsprintf($log[$i]['action'], $log_data_ary);
|
||||
|
||||
// If within the admin panel we do not censor text out
|
||||
if (defined('IN_ADMIN'))
|
||||
@@ -2611,7 +2615,7 @@ function update_foes($group_id = false, $user_id = false)
|
||||
{
|
||||
case 'mysqli':
|
||||
case 'mysql4':
|
||||
$sql = 'DELETE ' . (($db->sql_layer === 'mysqli' || version_compare($db->sql_server_info(true), '4.1', '>=')) ? 'z.*' : ZEBRA_TABLE) . '
|
||||
$sql = 'DELETE ' . (($db->sql_layer === 'mysqli' || version_compare($db->mysql_version, '4.1', '>=')) ? 'z.*' : ZEBRA_TABLE) . '
|
||||
FROM ' . ZEBRA_TABLE . ' z, ' . USER_GROUP_TABLE . ' ug
|
||||
WHERE z.zebra_id = ug.user_id
|
||||
AND z.foe = 1
|
||||
@@ -2633,7 +2637,7 @@ function update_foes($group_id = false, $user_id = false)
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (sizeof($users))
|
||||
{
|
||||
{
|
||||
$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('zebra_id', $users) . '
|
||||
AND foe = 1';
|
||||
@@ -2713,7 +2717,7 @@ function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $li
|
||||
$row['inactive_reason'] = $user->lang['INACTIVE_REASON_REMIND'];
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$users[] = $row;
|
||||
}
|
||||
|
||||
@@ -2893,7 +2897,7 @@ function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port
|
||||
@fputs($fsock, "GET $directory/$filename HTTP/1.1\r\n");
|
||||
@fputs($fsock, "HOST: $host\r\n");
|
||||
@fputs($fsock, "Connection: close\r\n\r\n");
|
||||
|
||||
|
||||
$file_info = '';
|
||||
$get_info = false;
|
||||
|
||||
@@ -2932,7 +2936,7 @@ function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $file_info;
|
||||
}
|
||||
|
||||
@@ -2968,7 +2972,7 @@ function tidy_warnings()
|
||||
$sql = 'DELETE FROM ' . WARNINGS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('warning_id', $warning_list);
|
||||
$db->sql_query($sql);
|
||||
|
||||
|
||||
foreach ($user_list as $user_id => $value)
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . " SET user_warnings = user_warnings - $value
|
||||
@@ -3030,7 +3034,7 @@ function add_permission_language()
|
||||
// Now search in acp and mods folder for permissions_ files.
|
||||
foreach (array('acp/', 'mods/') as $path)
|
||||
{
|
||||
$dh = @opendir($user->lang_path . $user->lang_name . '/' . $path);
|
||||
$dh = @opendir($user->lang_path . $path);
|
||||
|
||||
if ($dh)
|
||||
{
|
||||
|
@@ -228,7 +228,7 @@ class compress_zip extends compress
|
||||
{
|
||||
trigger_error("Could not create directory $folder");
|
||||
}
|
||||
phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
|
||||
@chmod($str, 0777);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,7 +257,7 @@ class compress_zip extends compress
|
||||
{
|
||||
trigger_error("Could not create directory $folder");
|
||||
}
|
||||
phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
|
||||
@chmod($str, 0777);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -544,7 +544,7 @@ class compress_tar extends compress
|
||||
{
|
||||
trigger_error("Could not create directory $folder");
|
||||
}
|
||||
phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
|
||||
@chmod($str, 0777);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -571,7 +571,7 @@ class compress_tar extends compress
|
||||
{
|
||||
trigger_error("Could not create directory $folder");
|
||||
}
|
||||
phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
|
||||
@chmod($str, 0777);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -580,7 +580,7 @@ class compress_tar extends compress
|
||||
{
|
||||
trigger_error("Couldn't create file $filename");
|
||||
}
|
||||
phpbb_chmod($target_filename, CHMOD_READ);
|
||||
@chmod($target_filename, 0777);
|
||||
|
||||
// Grab the file contents
|
||||
fwrite($fp, ($filesize) ? $fzread($this->fp, ($filesize + 511) &~ 511) : '', $filesize);
|
||||
|
@@ -41,67 +41,58 @@ if (!defined('IN_PHPBB'))
|
||||
/**
|
||||
* Generate sort selection fields
|
||||
*/
|
||||
function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, &$sort_dir, &$s_limit_days, &$s_sort_key, &$s_sort_dir, &$u_sort_param, $def_st = false, $def_sk = false, $def_sd = false)
|
||||
function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, &$sort_dir, &$s_limit_days, &$s_sort_key, &$s_sort_dir, &$u_sort_param)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
|
||||
|
||||
$sorts = array(
|
||||
'st' => array(
|
||||
'key' => 'sort_days',
|
||||
'default' => $def_st,
|
||||
'options' => $limit_days,
|
||||
'output' => &$s_limit_days,
|
||||
),
|
||||
|
||||
'sk' => array(
|
||||
'key' => 'sort_key',
|
||||
'default' => $def_sk,
|
||||
'options' => $sort_by_text,
|
||||
'output' => &$s_sort_key,
|
||||
),
|
||||
|
||||
'sd' => array(
|
||||
'key' => 'sort_dir',
|
||||
'default' => $def_sd,
|
||||
'options' => $sort_dir_text,
|
||||
'output' => &$s_sort_dir,
|
||||
),
|
||||
);
|
||||
$u_sort_param = '';
|
||||
|
||||
foreach ($sorts as $name => $sort_ary)
|
||||
// Check if the key is selectable. If not, we reset to the first key found.
|
||||
// This ensures the values are always valid.
|
||||
if (!isset($limit_days[$sort_days]))
|
||||
{
|
||||
$key = $sort_ary['key'];
|
||||
$selected = $$sort_ary['key'];
|
||||
|
||||
// Check if the key is selectable. If not, we reset to the default or first key found.
|
||||
// This ensures the values are always valid. We also set $sort_dir/sort_key/etc. to the
|
||||
// correct value, else the protection is void. ;)
|
||||
if (!isset($sort_ary['options'][$selected]))
|
||||
{
|
||||
if ($sort_ary['default'] !== false)
|
||||
{
|
||||
$selected = $$key = $sort_ary['default'];
|
||||
}
|
||||
else
|
||||
{
|
||||
@reset($sort_ary['options']);
|
||||
$selected = $$key = key($sort_ary['options']);
|
||||
}
|
||||
}
|
||||
|
||||
$sort_ary['output'] = '<select name="' . $name . '" id="' . $name . '">';
|
||||
foreach ($sort_ary['options'] as $option => $text)
|
||||
{
|
||||
$sort_ary['output'] .= '<option value="' . $option . '"' . (($selected == $option) ? ' selected="selected"' : '') . '>' . $text . '</option>';
|
||||
}
|
||||
$sort_ary['output'] .= '</select>';
|
||||
|
||||
$u_sort_param .= ($selected !== $sort_ary['default']) ? ((strlen($u_sort_param)) ? '&' : '') . "{$name}={$selected}" : '';
|
||||
@reset($limit_days);
|
||||
$sort_days = key($limit_days);
|
||||
}
|
||||
|
||||
if (!isset($sort_by_text[$sort_key]))
|
||||
{
|
||||
@reset($sort_by_text);
|
||||
$sort_key = key($sort_by_text);
|
||||
}
|
||||
|
||||
if (!isset($sort_dir_text[$sort_dir]))
|
||||
{
|
||||
@reset($sort_dir_text);
|
||||
$sort_dir = key($sort_dir_text);
|
||||
}
|
||||
|
||||
$s_limit_days = '<select name="st" id="st">';
|
||||
foreach ($limit_days as $day => $text)
|
||||
{
|
||||
$selected = ($sort_days == $day) ? ' selected="selected"' : '';
|
||||
$s_limit_days .= '<option value="' . $day . '"' . $selected . '>' . $text . '</option>';
|
||||
}
|
||||
$s_limit_days .= '</select>';
|
||||
|
||||
$s_sort_key = '<select name="sk" id="sk">';
|
||||
foreach ($sort_by_text as $key => $text)
|
||||
{
|
||||
$selected = ($sort_key == $key) ? ' selected="selected"' : '';
|
||||
$s_sort_key .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>';
|
||||
}
|
||||
$s_sort_key .= '</select>';
|
||||
|
||||
$s_sort_dir = '<select name="sd" id="sd">';
|
||||
foreach ($sort_dir_text as $key => $value)
|
||||
{
|
||||
$selected = ($sort_dir == $key) ? ' selected="selected"' : '';
|
||||
$s_sort_dir .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
|
||||
}
|
||||
$s_sort_dir .= '</select>';
|
||||
|
||||
$u_sort_param = "st=$sort_days&sk=$sort_key&sd=$sort_dir";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -248,7 +239,7 @@ function bump_topic_allowed($forum_id, $topic_bumped, $last_post_time, $topic_po
|
||||
function get_context($text, $words, $length = 400)
|
||||
{
|
||||
// first replace all whitespaces with single spaces
|
||||
$text = preg_replace('/ +/', ' ', strtr($text, "\t\n\r\x0C ", ' '));
|
||||
$text = preg_replace('/ +/', ' ', strtr($text, "\t\n\r\x0C ", ' '), $text);
|
||||
|
||||
$word_indizes = array();
|
||||
if (sizeof($words))
|
||||
@@ -501,8 +492,7 @@ function generate_text_for_edit($text, $uid, $flags)
|
||||
*/
|
||||
function make_clickable_callback($type, $whitespace, $url, $relative_url, $class)
|
||||
{
|
||||
$orig_url = $url;
|
||||
$orig_relative = $relative_url;
|
||||
$orig_url = $url . $relative_url;
|
||||
$append = '';
|
||||
$url = htmlspecialchars_decode($url);
|
||||
$relative_url = htmlspecialchars_decode($relative_url);
|
||||
@@ -567,12 +557,6 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class
|
||||
$url = substr($url, 0, -1);
|
||||
}
|
||||
break;
|
||||
|
||||
// set last_char to empty here, so the variable can be used later to
|
||||
// check whether a character was removed
|
||||
default:
|
||||
$last_char = '';
|
||||
break;
|
||||
}
|
||||
|
||||
$short_url = (strlen($url) > 55) ? substr($url, 0, 39) . ' ... ' . substr($url, -10) : $url;
|
||||
@@ -590,7 +574,7 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class
|
||||
// don't touch it and let MAGIC_URL_FULL take care of it.
|
||||
if (!$relative_url)
|
||||
{
|
||||
return $whitespace . $orig_url . '/' . $orig_relative; // slash is taken away by relative url pattern
|
||||
return $whitespace . $orig_url . '/'; // slash is taken away by relative url pattern
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -950,8 +934,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
'S_THUMBNAIL' => true,
|
||||
'THUMB_IMAGE' => $thumbnail_link,
|
||||
);
|
||||
|
||||
$update_count[] = $attachment['attach_id'];
|
||||
break;
|
||||
|
||||
// Windows Media Streams
|
||||
@@ -998,7 +980,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
'S_FLASH_FILE' => true,
|
||||
'WIDTH' => $width,
|
||||
'HEIGHT' => $height,
|
||||
'U_VIEW_LINK' => $download_link . '&view=1',
|
||||
);
|
||||
|
||||
// Viewed/Heared File ... update the download count
|
||||
@@ -1085,16 +1066,8 @@ function extension_allowed($forum_id, $extension, &$extensions)
|
||||
/**
|
||||
* Truncates string while retaining special characters if going over the max length
|
||||
* The default max length is 60 at the moment
|
||||
* The maximum storage length is there to fit the string within the given length. The string may be further truncated due to html entities.
|
||||
* For example: string given is 'a "quote"' (length: 9), would be a stored as 'a "quote"' (length: 19)
|
||||
*
|
||||
* @param string $string The text to truncate to the given length. String is specialchared.
|
||||
* @param int $max_length Maximum length of string (multibyte character count as 1 char / Html entity count as 1 char)
|
||||
* @param int $max_store_length Maximum character length of string (multibyte character count as 1 char / Html entity count as entity chars).
|
||||
* @param bool $allow_reply Allow Re: in front of string
|
||||
* @param string $append String to be appended
|
||||
*/
|
||||
function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = true, $append = '')
|
||||
function truncate_string($string, $max_length = 60, $allow_reply = true, $append = '')
|
||||
{
|
||||
$chars = array();
|
||||
|
||||
@@ -1117,21 +1090,6 @@ function truncate_string($string, $max_length = 60, $max_store_length = 255, $al
|
||||
$stripped = true;
|
||||
}
|
||||
|
||||
// Due to specialchars, we may not be able to store the string...
|
||||
if (utf8_strlen($string) > $max_store_length)
|
||||
{
|
||||
// let's split again, we do not want half-baked strings where entities are split
|
||||
$_chars = utf8_str_split(htmlspecialchars_decode($string));
|
||||
$chars = array_map('utf8_htmlspecialchars', $_chars);
|
||||
|
||||
do
|
||||
{
|
||||
array_pop($chars);
|
||||
$string = implode('', $chars);
|
||||
}
|
||||
while (!empty($chars) && utf8_strlen($string) > $max_store_length);
|
||||
}
|
||||
|
||||
if ($strip_reply)
|
||||
{
|
||||
$string = 'Re: ' . $string;
|
||||
@@ -1147,7 +1105,6 @@ function truncate_string($string, $max_length = 60, $max_store_length = 255, $al
|
||||
|
||||
/**
|
||||
* Get username details for placing into templates.
|
||||
* This function caches all modes on first call, except for no_profile and anonymous user - determined by $user_id.
|
||||
*
|
||||
* @param string $mode Can be profile (for getting an url to the profile), username (for obtaining the username), colour (for obtaining the user colour), full (for obtaining a html string representing a coloured link to the users profile) or no_profile (the same as full but forcing no profile link)
|
||||
* @param int $user_id The users id
|
||||
@@ -1157,92 +1114,81 @@ function truncate_string($string, $max_length = 60, $max_store_length = 255, $al
|
||||
* @param string $custom_profile_url optional parameter to specify a profile url. The user id get appended to this url as &u={user_id}
|
||||
*
|
||||
* @return string A string consisting of what is wanted based on $mode.
|
||||
* @author BartVB, Acyd Burn
|
||||
*/
|
||||
function get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false)
|
||||
{
|
||||
static $_profile_cache;
|
||||
global $phpbb_root_path, $phpEx, $user, $auth;
|
||||
|
||||
// We cache some common variables we need within this function
|
||||
if (empty($_profile_cache))
|
||||
$profile_url = '';
|
||||
$username_colour = ($username_colour) ? '#' . $username_colour : '';
|
||||
|
||||
if ($guest_username === false)
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
$_profile_cache['base_url'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u={USER_ID}');
|
||||
$_profile_cache['tpl_noprofile'] = '{USERNAME}';
|
||||
$_profile_cache['tpl_noprofile_colour'] = '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>';
|
||||
$_profile_cache['tpl_profile'] = '<a href="{PROFILE_URL}">{USERNAME}</a>';
|
||||
$_profile_cache['tpl_profile_colour'] = '<a href="{PROFILE_URL}" style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</a>';
|
||||
$username = ($username) ? $username : $user->lang['GUEST'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$username = ($user_id && $user_id != ANONYMOUS) ? $username : ((!empty($guest_username)) ? $guest_username : $user->lang['GUEST']);
|
||||
}
|
||||
|
||||
global $user, $auth;
|
||||
// Only show the link if not anonymous
|
||||
if ($mode != 'no_profile' && $user_id && $user_id != ANONYMOUS)
|
||||
{
|
||||
// Do not show the link if the user is already logged in but do not have u_viewprofile permissions (relevant for bots mostly).
|
||||
// For all others the link leads to a login page or the profile.
|
||||
if ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile'))
|
||||
{
|
||||
$profile_url = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . (int) $user_id);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$profile_url = '';
|
||||
}
|
||||
|
||||
// This switch makes sure we only run code required for the mode
|
||||
switch ($mode)
|
||||
{
|
||||
case 'full':
|
||||
case 'no_profile':
|
||||
case 'colour':
|
||||
|
||||
// Build correct username colour
|
||||
$username_colour = ($username_colour) ? '#' . $username_colour : '';
|
||||
|
||||
// Return colour
|
||||
if ($mode == 'colour')
|
||||
{
|
||||
return $username_colour;
|
||||
}
|
||||
|
||||
// no break;
|
||||
case 'profile':
|
||||
return $profile_url;
|
||||
break;
|
||||
|
||||
case 'username':
|
||||
return $username;
|
||||
break;
|
||||
|
||||
// Build correct username
|
||||
if ($guest_username === false)
|
||||
case 'colour':
|
||||
return $username_colour;
|
||||
break;
|
||||
|
||||
case 'no_profile':
|
||||
case 'full':
|
||||
default:
|
||||
|
||||
$tpl = '';
|
||||
if (!$profile_url && !$username_colour)
|
||||
{
|
||||
$username = ($username) ? $username : $user->lang['GUEST'];
|
||||
$tpl = '{USERNAME}';
|
||||
}
|
||||
else
|
||||
else if (!$profile_url && $username_colour)
|
||||
{
|
||||
$username = ($user_id && $user_id != ANONYMOUS) ? $username : ((!empty($guest_username)) ? $guest_username : $user->lang['GUEST']);
|
||||
$tpl = '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>';
|
||||
}
|
||||
else if ($profile_url && !$username_colour)
|
||||
{
|
||||
$tpl = '<a href="{PROFILE_URL}">{USERNAME}</a>';
|
||||
}
|
||||
else if ($profile_url && $username_colour)
|
||||
{
|
||||
$tpl = '<a href="{PROFILE_URL}" style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</a>';
|
||||
}
|
||||
|
||||
// Return username
|
||||
if ($mode == 'username')
|
||||
{
|
||||
return $username;
|
||||
}
|
||||
|
||||
// no break;
|
||||
|
||||
case 'profile':
|
||||
|
||||
// Build correct profile url - only show if not anonymous and permission to view profile if registered user
|
||||
// For anonymous the link leads to a login page.
|
||||
if ($user_id && $user_id != ANONYMOUS && ($user->data['user_id'] == ANONYMOUS || $auth->acl_get('u_viewprofile')))
|
||||
{
|
||||
$profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : str_replace(array('={USER_ID}', '=%7BUSER_ID%7D'), '=' . (int) $user_id, $_profile_cache['base_url']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$profile_url = '';
|
||||
}
|
||||
|
||||
// Return profile
|
||||
if ($mode == 'profile')
|
||||
{
|
||||
return $profile_url;
|
||||
}
|
||||
|
||||
// no break;
|
||||
return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), $tpl);
|
||||
break;
|
||||
}
|
||||
|
||||
if (($mode == 'full' && !$profile_url) || $mode == 'no_profile')
|
||||
{
|
||||
return str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_noprofile'] : $_profile_cache['tpl_noprofile_colour']);
|
||||
}
|
||||
|
||||
return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -148,7 +148,7 @@ function auto_id($pad = 0)
|
||||
{
|
||||
return $convert_row['max_id'] + $pad;
|
||||
}
|
||||
|
||||
|
||||
return $auto_id + $pad;
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ function get_config_value($config_name)
|
||||
{
|
||||
$convert_config = get_config();
|
||||
}
|
||||
|
||||
|
||||
if (!isset($convert_config[$config_name]))
|
||||
{
|
||||
return false;
|
||||
@@ -669,12 +669,12 @@ function import_avatar($source, $use_target = false, $user_id = false)
|
||||
{
|
||||
$convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_AVATAR_PATH'], 'import_avatar()'), __LINE__, __FILE__);
|
||||
}
|
||||
|
||||
|
||||
if ($use_target === false && $user_id !== false)
|
||||
{
|
||||
$use_target = $config['avatar_salt'] . '_' . $user_id . '.' . substr(strrchr($source, '.'), 1);
|
||||
}
|
||||
|
||||
|
||||
$result = _import_check('avatar_path', $source, $use_target);
|
||||
|
||||
return ((!empty($user_id)) ? $user_id : $use_target) . '.' . substr(strrchr($source, '.'), 1);
|
||||
@@ -946,7 +946,7 @@ function get_remote_avatar_dim($src, $axis)
|
||||
unset($remote_avatar_cache);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
|
||||
$url_info = @parse_url($src);
|
||||
if (empty($url_info['host']))
|
||||
{
|
||||
@@ -962,19 +962,19 @@ function get_remote_avatar_dim($src, $axis)
|
||||
case 'ftp':
|
||||
$port = 21;
|
||||
break;
|
||||
|
||||
|
||||
case 'https':
|
||||
$port = 443;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
$port = 80;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$timeout = @ini_get('default_socket_timeout');
|
||||
@ini_set('default_socket_timeout', 2);
|
||||
|
||||
|
||||
// We're just trying to reach the server to avoid timeouts
|
||||
$fp = @fsockopen($host, $port, $errno, $errstr, 1);
|
||||
if ($fp)
|
||||
@@ -982,11 +982,11 @@ function get_remote_avatar_dim($src, $axis)
|
||||
$remote_avatar_cache[$src] = @getimagesize($src);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
|
||||
$default_x = (defined('DEFAULT_AVATAR_X_CUSTOM')) ? DEFAULT_AVATAR_X_CUSTOM : DEFAULT_AVATAR_X;
|
||||
$default_y = (defined('DEFAULT_AVATAR_Y_CUSTOM')) ? DEFAULT_AVATAR_Y_CUSTOM : DEFAULT_AVATAR_Y;
|
||||
$default = array($default_x, $default_y);
|
||||
|
||||
|
||||
if (empty($remote_avatar_cache[$src]) || empty($remote_avatar_cache[$src][0]) || empty($remote_avatar_cache[$src][1]))
|
||||
{
|
||||
$remote_avatar_cache[$src] = $default;
|
||||
@@ -1002,7 +1002,7 @@ function get_remote_avatar_dim($src, $axis)
|
||||
$remote_avatar_cache[$src][1] = (int)($remote_avatar_cache[$src][1] * $ratio);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ini_set('default_socket_timeout', $timeout);
|
||||
return $remote_avatar_cache[$src][$axis];
|
||||
}
|
||||
@@ -1112,7 +1112,7 @@ function words_unique(&$words)
|
||||
function add_user_group($group_id, $user_id, $group_leader=false)
|
||||
{
|
||||
global $convert, $phpbb_root_path, $config, $user, $db;
|
||||
|
||||
|
||||
$sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' ' . $db->sql_build_array('INSERT', array(
|
||||
'group_id' => $group_id,
|
||||
'user_id' => $user_id,
|
||||
@@ -1282,7 +1282,7 @@ function restore_config($schema)
|
||||
// Most are...
|
||||
if (is_string($config_value))
|
||||
{
|
||||
$config_value = truncate_string(utf8_htmlspecialchars($config_value), 255, 255, false);
|
||||
$config_value = truncate_string(utf8_htmlspecialchars($config_value), 255, false);
|
||||
}
|
||||
|
||||
set_config($config_name, $config_value);
|
||||
@@ -1744,7 +1744,6 @@ function sync_post_count($offset, $limit)
|
||||
$sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE post_postcount = 1
|
||||
AND post_approved = 1
|
||||
GROUP BY poster_id
|
||||
ORDER BY poster_id';
|
||||
$result = $db->sql_query_limit($sql, $limit, $offset);
|
||||
@@ -1952,7 +1951,7 @@ function update_dynamic_config()
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE is_orphan = 0';
|
||||
$result = $db->sql_query($sql);
|
||||
set_config('upload_dir_size', (float) $db->sql_fetchfield('stat'), true);
|
||||
set_config('upload_dir_size', (int) $db->sql_fetchfield('stat'), true);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
/**
|
||||
@@ -2444,7 +2443,7 @@ function get_smiley_display()
|
||||
function fill_dateformat($user_dateformat)
|
||||
{
|
||||
global $config;
|
||||
|
||||
|
||||
return ((empty($user_dateformat)) ? $config['default_dateformat'] : $user_dateformat);
|
||||
}
|
||||
|
||||
|
@@ -205,12 +205,6 @@ 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'];
|
||||
$subforums[$parent_id][$forum_id]['children'] = array();
|
||||
|
||||
if (isset($subforums[$parent_id][$row['parent_id']]) && !$row['display_on_index'])
|
||||
{
|
||||
$subforums[$parent_id][$row['parent_id']]['children'][] = $forum_id;
|
||||
}
|
||||
|
||||
$forum_rows[$parent_id]['forum_topics'] += $row['forum_topics'];
|
||||
|
||||
@@ -237,30 +231,23 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
// Handle marking posts
|
||||
if ($mark_read == 'forums' || $mark_read == 'all')
|
||||
{
|
||||
$redirect = build_url(array('mark', 'hash'));
|
||||
$token = request_var('hash', '');
|
||||
if (check_link_hash($token, 'global'))
|
||||
$redirect = build_url('mark');
|
||||
|
||||
if ($mark_read == 'all')
|
||||
{
|
||||
if ($mark_read == 'all')
|
||||
{
|
||||
markread('all');
|
||||
$message = sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>');
|
||||
}
|
||||
else
|
||||
{
|
||||
markread('topics', $forum_ids);
|
||||
$message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>');
|
||||
}
|
||||
meta_refresh(3, $redirect);
|
||||
trigger_error($user->lang['FORUMS_MARKED'] . '<br /><br />' . $message);
|
||||
markread('all');
|
||||
|
||||
$message = sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>');
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>');
|
||||
meta_refresh(3, $redirect);
|
||||
trigger_error($message);
|
||||
markread('topics', $forum_ids);
|
||||
|
||||
$message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>');
|
||||
}
|
||||
|
||||
meta_refresh(3, $redirect);
|
||||
trigger_error($user->lang['FORUMS_MARKED'] . '<br /><br />' . $message);
|
||||
}
|
||||
|
||||
// Grab moderators ... if necessary
|
||||
@@ -310,19 +297,6 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
{
|
||||
$subforum_unread = (isset($forum_tracking_info[$subforum_id]) && $subforum_row['orig_forum_last_post_time'] > $forum_tracking_info[$subforum_id]) ? true : false;
|
||||
|
||||
if (!$subforum_unread && !empty($subforum_row['children']))
|
||||
{
|
||||
foreach ($subforum_row['children'] as $child_id)
|
||||
{
|
||||
if (isset($forum_tracking_info[$child_id]) && $subforums[$forum_id][$child_id]['orig_forum_last_post_time'] > $forum_tracking_info[$child_id])
|
||||
{
|
||||
// Once we found an unread child forum, we can drop out of this loop
|
||||
$subforum_unread = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($subforum_row['display'] && $subforum_row['name'])
|
||||
{
|
||||
$subforums_list[] = array(
|
||||
@@ -470,7 +444,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . '&f=' . $root_data['forum_id'] . '&mark=forums') : '',
|
||||
'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? 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_topic_latest', 'VIEW_LATEST_POST'))
|
||||
@@ -656,7 +630,7 @@ function topic_generate_pagination($replies, $url)
|
||||
*/
|
||||
function get_moderators(&$forum_moderators, $forum_id = false)
|
||||
{
|
||||
global $config, $template, $db, $phpbb_root_path, $phpEx, $user, $auth;
|
||||
global $config, $template, $db, $phpbb_root_path, $phpEx;
|
||||
|
||||
// Have we disabled the display of moderators? If so, then return
|
||||
// from whence we came ...
|
||||
@@ -715,16 +689,7 @@ function get_moderators(&$forum_moderators, $forum_id = false)
|
||||
}
|
||||
else
|
||||
{
|
||||
$group_name = (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']);
|
||||
|
||||
if ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile'))
|
||||
{
|
||||
$forum_moderators[$row['forum_id']][] = '<span' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . '>' . $group_name . '</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_moderators[$row['forum_id']][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . $group_name . '</a>';
|
||||
}
|
||||
$forum_moderators[$row['forum_id']][] = '<a' . (($row['group_colour']) ? ' 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);
|
||||
@@ -807,8 +772,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold
|
||||
$folder = 'topic_read';
|
||||
$folder_new = 'topic_unread';
|
||||
|
||||
// Hot topic threshold is for posts in a topic, which is replies + the first post. ;)
|
||||
if ($config['hot_threshold'] && ($replies + 1) >= $config['hot_threshold'] && $topic_row['topic_status'] != ITEM_LOCKED)
|
||||
if ($config['hot_threshold'] && $replies >= $config['hot_threshold'] && $topic_row['topic_status'] != ITEM_LOCKED)
|
||||
{
|
||||
$folder .= '_hot';
|
||||
$folder_new .= '_hot';
|
||||
@@ -846,7 +810,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold
|
||||
*/
|
||||
function display_custom_bbcodes()
|
||||
{
|
||||
global $db, $template, $user;
|
||||
global $db, $template;
|
||||
|
||||
// Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing)
|
||||
$num_predefined_bbcodes = 22;
|
||||
@@ -860,12 +824,6 @@ function display_custom_bbcodes()
|
||||
$i = 0;
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
// If the helpline is defined within the language file, we will use the localised version, else just use the database entry...
|
||||
if (isset($user->lang[strtoupper($row['bbcode_helpline'])]))
|
||||
{
|
||||
$row['bbcode_helpline'] = $user->lang[strtoupper($row['bbcode_helpline'])];
|
||||
}
|
||||
|
||||
$template->assign_block_vars('custom_tags', array(
|
||||
'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
|
||||
'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2),
|
||||
@@ -1030,8 +988,8 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
$table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE;
|
||||
$where_sql = ($mode == 'forum') ? 'forum_id' : 'topic_id';
|
||||
$match_id = ($mode == 'forum') ? $forum_id : $topic_id;
|
||||
$u_url = "uid={$user->data['user_id']}";
|
||||
$u_url .= ($mode == 'forum') ? '&f' : '&f=' . $forum_id . '&t';
|
||||
|
||||
$u_url = ($mode == 'forum') ? 'f' : 'f=' . $forum_id . '&t';
|
||||
|
||||
// Is user watching this thread?
|
||||
if ($user_id != ANONYMOUS)
|
||||
@@ -1052,16 +1010,8 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
|
||||
if (!is_null($notify_status) && $notify_status !== '')
|
||||
{
|
||||
|
||||
if (isset($_GET['unwatch']))
|
||||
{
|
||||
$uid = request_var('uid', 0);
|
||||
if ($uid != $user_id)
|
||||
{
|
||||
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
|
||||
$message = $user->lang['ERR_UNWATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
|
||||
trigger_error($message);
|
||||
}
|
||||
if ($_GET['unwatch'] == $mode)
|
||||
{
|
||||
$is_watching = 0;
|
||||
@@ -1097,25 +1047,19 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
{
|
||||
if (isset($_GET['watch']))
|
||||
{
|
||||
$token = request_var('hash', '');
|
||||
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
|
||||
|
||||
if ($_GET['watch'] == $mode && check_link_hash($token, "{$mode}_$match_id"))
|
||||
if ($_GET['watch'] == $mode)
|
||||
{
|
||||
$is_watching = true;
|
||||
|
||||
$sql = 'INSERT INTO ' . $table_sql . " (user_id, $where_sql, notify_status)
|
||||
VALUES ($user_id, $match_id, 0)";
|
||||
$db->sql_query($sql);
|
||||
$message = $user->lang['ARE_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = $user->lang['ERR_WATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
|
||||
}
|
||||
|
||||
$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="' . $redirect_url . '">', '</a>');
|
||||
trigger_error($message);
|
||||
}
|
||||
else
|
||||
@@ -1139,7 +1083,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
|
||||
if ($can_watch)
|
||||
{
|
||||
$s_watching['link'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start&hash=" . generate_link_hash("{$mode}_$match_id"));
|
||||
$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)];
|
||||
$s_watching['is_watching'] = $is_watching;
|
||||
}
|
||||
@@ -1156,7 +1100,6 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
* @param string &$rank_img the rank image as full img tag is stored here after execution
|
||||
* @param string &$rank_img_src the rank image source is stored here after execution
|
||||
*
|
||||
* Note: since we do not want to break backwards-compatibility, this function will only properly assign ranks to guests if you call it for them with user_posts == false
|
||||
*/
|
||||
function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
|
||||
{
|
||||
@@ -1174,7 +1117,7 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
|
||||
$rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '<img src="' . $phpbb_root_path . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] . '" alt="' . $ranks['special'][$user_rank]['rank_title'] . '" title="' . $ranks['special'][$user_rank]['rank_title'] . '" />' : '';
|
||||
$rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? $phpbb_root_path . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : '';
|
||||
}
|
||||
else if ($user_posts !== false)
|
||||
else
|
||||
{
|
||||
if (!empty($ranks['normal']))
|
||||
{
|
||||
@@ -1226,7 +1169,7 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $
|
||||
}
|
||||
|
||||
$avatar_img .= $avatar;
|
||||
return '<img src="' . (str_replace(' ', '%20', $avatar_img)) . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
|
||||
return '<img src="' . $avatar_img . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
|
||||
}
|
||||
|
||||
?>
|
@@ -20,7 +20,7 @@ if (!defined('IN_PHPBB'))
|
||||
*
|
||||
* Jabber class from Flyspray project
|
||||
*
|
||||
* @version class.jabber2.php 1595 2008-09-19 (0.9.9)
|
||||
* @version class.jabber2.php 1488 2007-11-25
|
||||
* @copyright 2006 Flyspray.org
|
||||
* @author Florian Schmitz (floele)
|
||||
*
|
||||
@@ -35,7 +35,6 @@ class jabber
|
||||
var $timeout = 10;
|
||||
|
||||
var $server;
|
||||
var $connect_server;
|
||||
var $port;
|
||||
var $username;
|
||||
var $password;
|
||||
@@ -51,23 +50,9 @@ class jabber
|
||||
*/
|
||||
function jabber($server, $port, $username, $password, $use_ssl = false)
|
||||
{
|
||||
$this->connect_server = ($server) ? $server : 'localhost';
|
||||
$this->server = ($server) ? $server : 'localhost';
|
||||
$this->port = ($port) ? $port : 5222;
|
||||
|
||||
// Get the server and the username
|
||||
if (strpos($username, '@') === false)
|
||||
{
|
||||
$this->server = $this->connect_server;
|
||||
$this->username = $username;
|
||||
}
|
||||
else
|
||||
{
|
||||
$jid = explode('@', $username, 2);
|
||||
|
||||
$this->username = $jid[0];
|
||||
$this->server = $jid[1];
|
||||
}
|
||||
|
||||
$this->username = $username;
|
||||
$this->password = $password;
|
||||
$this->use_ssl = ($use_ssl && $this->can_use_ssl()) ? true : false;
|
||||
|
||||
@@ -138,7 +123,7 @@ class jabber
|
||||
|
||||
$this->session['ssl'] = $this->use_ssl;
|
||||
|
||||
if ($this->open_socket($this->connect_server, $this->port, $this->use_ssl))
|
||||
if ($this->open_socket($this->server, $this->port, $this->use_ssl))
|
||||
{
|
||||
$this->send("<?xml version='1.0' encoding='UTF-8' ?" . ">\n");
|
||||
$this->send("<stream:stream to='{$this->server}' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>\n");
|
||||
@@ -414,11 +399,13 @@ class jabber
|
||||
$second_time = isset($this->session['id']);
|
||||
$this->session['id'] = $xml['stream:stream'][0]['@']['id'];
|
||||
|
||||
/** Currently commented out due to problems with some jabber server - reason unknown
|
||||
if ($second_time)
|
||||
{
|
||||
// If we are here for the second time after TLS, we need to continue logging in
|
||||
return $this->login();
|
||||
}
|
||||
$this->login();
|
||||
return;
|
||||
}*/
|
||||
|
||||
// go on with authentication?
|
||||
if (isset($this->features['stream:features'][0]['#']['bind']) || !empty($this->session['tls']))
|
||||
@@ -514,7 +501,14 @@ class jabber
|
||||
}
|
||||
|
||||
// better generate a cnonce, maybe it's needed
|
||||
$decoded['cnonce'] = base64_encode(md5(uniqid(mt_rand(), true)));
|
||||
$str = '';
|
||||
mt_srand((double)microtime()*10000000);
|
||||
|
||||
for ($i = 0; $i < 32; $i++)
|
||||
{
|
||||
$str .= chr(mt_rand(0, 255));
|
||||
}
|
||||
$decoded['cnonce'] = base64_encode($str);
|
||||
|
||||
// second challenge?
|
||||
if (isset($decoded['rspauth']))
|
||||
|
@@ -28,7 +28,6 @@ class messenger
|
||||
var $mail_priority = MAIL_NORMAL_PRIORITY;
|
||||
var $use_queue = true;
|
||||
var $tpl_msg = array();
|
||||
var $eol = "\n";
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -39,10 +38,6 @@ class messenger
|
||||
|
||||
$this->use_queue = (!$config['email_package_size']) ? false : $use_queue;
|
||||
$this->subject = '';
|
||||
|
||||
// Determine EOL character (\n for UNIX, \r\n for Windows and \r for Mac)
|
||||
$this->eol = (!defined('PHP_EOL')) ? (($eol = strtolower(substr(PHP_OS, 0, 3))) == 'win') ? "\r\n" : (($eol == 'mac') ? "\r" : "\n") : PHP_EOL;
|
||||
$this->eol = (!$this->eol) ? "\n" : $this->eol;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,11 +57,6 @@ class messenger
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (!trim($address))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$pos = isset($this->addresses['to']) ? sizeof($this->addresses['to']) : 0;
|
||||
|
||||
$this->addresses['to'][$pos]['email'] = trim($address);
|
||||
@@ -87,11 +77,6 @@ class messenger
|
||||
*/
|
||||
function cc($address, $realname = '')
|
||||
{
|
||||
if (!trim($address))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$pos = isset($this->addresses['cc']) ? sizeof($this->addresses['cc']) : 0;
|
||||
$this->addresses['cc'][$pos]['email'] = trim($address);
|
||||
$this->addresses['cc'][$pos]['name'] = trim($realname);
|
||||
@@ -102,11 +87,6 @@ class messenger
|
||||
*/
|
||||
function bcc($address, $realname = '')
|
||||
{
|
||||
if (!trim($address))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$pos = isset($this->addresses['bcc']) ? sizeof($this->addresses['bcc']) : 0;
|
||||
$this->addresses['bcc'][$pos]['email'] = trim($address);
|
||||
$this->addresses['bcc'][$pos]['name'] = trim($realname);
|
||||
@@ -117,12 +97,6 @@ class messenger
|
||||
*/
|
||||
function im($address, $realname = '')
|
||||
{
|
||||
// IM-Addresses could be empty
|
||||
if (!trim($address))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$pos = isset($this->addresses['im']) ? sizeof($this->addresses['im']) : 0;
|
||||
$this->addresses['im'][$pos]['uid'] = trim($address);
|
||||
$this->addresses['im'][$pos]['name'] = trim($realname);
|
||||
@@ -173,7 +147,7 @@ class messenger
|
||||
*/
|
||||
function template($template_file, $template_lang = '')
|
||||
{
|
||||
global $config, $phpbb_root_path, $user;
|
||||
global $config, $phpbb_root_path;
|
||||
|
||||
if (!trim($template_file))
|
||||
{
|
||||
@@ -187,8 +161,7 @@ class messenger
|
||||
|
||||
if (empty($this->tpl_msg[$template_lang . $template_file]))
|
||||
{
|
||||
$tpl_file = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
|
||||
$tpl_file .= $template_lang . "/email/$template_file.txt";
|
||||
$tpl_file = "{$phpbb_root_path}language/$template_lang/email/$template_file.txt";
|
||||
|
||||
if (!file_exists($tpl_file))
|
||||
{
|
||||
@@ -330,7 +303,6 @@ class messenger
|
||||
{
|
||||
global $config;
|
||||
|
||||
// We could use keys here, but we won't do this for 3.0.x to retain backwards compatibility
|
||||
$headers = array();
|
||||
|
||||
$headers[] = 'From: ' . $this->from;
|
||||
@@ -360,12 +332,15 @@ class messenger
|
||||
$headers[] = 'X-MimeOLE: phpBB3';
|
||||
$headers[] = 'X-phpBB-Origin: phpbb://' . str_replace(array('http://', 'https://'), array('', ''), generate_board_url());
|
||||
|
||||
// We use \n here instead of \r\n because our smtp mailer is adjusting it to \r\n automatically, whereby the php mail function only works
|
||||
// if using \n.
|
||||
|
||||
if (sizeof($this->extra_headers))
|
||||
{
|
||||
$headers = array_merge($headers, $this->extra_headers);
|
||||
$headers[] = implode("\n", $this->extra_headers);
|
||||
}
|
||||
|
||||
return $headers;
|
||||
return implode("\n", $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -380,13 +355,6 @@ class messenger
|
||||
return false;
|
||||
}
|
||||
|
||||
// Addresses to send to?
|
||||
if (empty($this->addresses) || (empty($this->addresses['to']) && empty($this->addresses['cc']) && empty($this->addresses['bcc'])))
|
||||
{
|
||||
// Send was successful. ;)
|
||||
return true;
|
||||
}
|
||||
|
||||
$use_queue = false;
|
||||
if ($config['email_package_size'] && $this->use_queue)
|
||||
{
|
||||
@@ -438,10 +406,6 @@ class messenger
|
||||
}
|
||||
else
|
||||
{
|
||||
// We use the EOL character for the OS here because the PHP mail function does not correctly transform line endings. On Windows SMTP is used (SMTP is \r\n), on UNIX a command is used...
|
||||
// Reference: http://bugs.php.net/bug.php?id=15841
|
||||
$headers = implode($this->eol, $headers);
|
||||
|
||||
ob_start();
|
||||
$result = $config['email_function_name']($mail_to, mail_encode($this->subject), wordwrap(utf8_wordwrap($this->msg), 997, "\n", true), $headers);
|
||||
$err_msg = ob_get_clean();
|
||||
@@ -479,12 +443,6 @@ class messenger
|
||||
return false;
|
||||
}
|
||||
|
||||
if (empty($this->addresses['im']))
|
||||
{
|
||||
// Send was successful. ;)
|
||||
return true;
|
||||
}
|
||||
|
||||
$use_queue = false;
|
||||
if ($config['jab_package_size'] && $this->use_queue)
|
||||
{
|
||||
@@ -550,7 +508,6 @@ class queue
|
||||
var $queue_data = array();
|
||||
var $package_size = 0;
|
||||
var $cache_file = '';
|
||||
var $eol = "\n";
|
||||
|
||||
/**
|
||||
* constructor
|
||||
@@ -561,10 +518,6 @@ class queue
|
||||
|
||||
$this->data = array();
|
||||
$this->cache_file = "{$phpbb_root_path}cache/queue.$phpEx";
|
||||
|
||||
// Determine EOL character (\n for UNIX, \r\n for Windows and \r for Mac)
|
||||
$this->eol = (!defined('PHP_EOL')) ? (($eol = strtolower(substr(PHP_OS, 0, 3))) == 'win') ? "\r\n" : (($eol == 'mac') ? "\r" : "\n") : PHP_EOL;
|
||||
$this->eol = (!$this->eol) ? "\n" : $this->eol;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -609,7 +562,7 @@ class queue
|
||||
|
||||
$fp = @fopen($this->cache_file . '.lock', 'wb');
|
||||
fclose($fp);
|
||||
@chmod($this->cache_file . '.lock', 0777);
|
||||
@chmod($this->cache_file . '.lock', 0666);
|
||||
|
||||
include($this->cache_file);
|
||||
|
||||
@@ -688,7 +641,7 @@ class queue
|
||||
else
|
||||
{
|
||||
ob_start();
|
||||
$result = $config['email_function_name']($to, mail_encode($subject), wordwrap(utf8_wordwrap($msg), 997, "\n", true), implode($this->eol, $headers));
|
||||
$result = $config['email_function_name']($to, mail_encode($subject), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $headers);
|
||||
$err_msg = ob_get_clean();
|
||||
}
|
||||
|
||||
@@ -730,21 +683,21 @@ class queue
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!sizeof($this->queue_data))
|
||||
{
|
||||
@unlink($this->cache_file);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($fp = @fopen($this->cache_file, 'wb'))
|
||||
if ($fp = @fopen($this->cache_file, 'w'))
|
||||
{
|
||||
@flock($fp, LOCK_EX);
|
||||
fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$this->queue_data = unserialize(" . var_export(serialize($this->queue_data), true) . ");\n\n?>");
|
||||
fwrite($fp, "<?php\n\$this->queue_data = " . var_export($this->queue_data, true) . ";\n?>");
|
||||
@flock($fp, LOCK_UN);
|
||||
fclose($fp);
|
||||
|
||||
phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
|
||||
@chmod($this->cache_file, 0666);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -760,11 +713,11 @@ class queue
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (file_exists($this->cache_file))
|
||||
{
|
||||
include($this->cache_file);
|
||||
|
||||
|
||||
foreach ($this->queue_data as $object => $data_ary)
|
||||
{
|
||||
if (isset($this->data[$object]) && sizeof($this->data[$object]))
|
||||
@@ -781,11 +734,11 @@ class queue
|
||||
if ($fp = @fopen($this->cache_file, 'w'))
|
||||
{
|
||||
@flock($fp, LOCK_EX);
|
||||
fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$this->queue_data = unserialize(" . var_export(serialize($this->data), true) . ");\n\n?>");
|
||||
fwrite($fp, "<?php\n\$this->queue_data = " . var_export($this->data, true) . ";\n?>");
|
||||
@flock($fp, LOCK_UN);
|
||||
fclose($fp);
|
||||
|
||||
phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
|
||||
@chmod($this->cache_file, 0666);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -793,37 +746,40 @@ class queue
|
||||
/**
|
||||
* Replacement or substitute for PHP's mail command
|
||||
*/
|
||||
function smtpmail($addresses, $subject, $message, &$err_msg, $headers = false)
|
||||
function smtpmail($addresses, $subject, $message, &$err_msg, $headers = '')
|
||||
{
|
||||
global $config, $user;
|
||||
|
||||
// Fix any bare linefeeds in the message to make it RFC821 Compliant.
|
||||
$message = preg_replace("#(?<!\r)\n#si", "\r\n", $message);
|
||||
|
||||
if ($headers !== false)
|
||||
if ($headers != '')
|
||||
{
|
||||
if (!is_array($headers))
|
||||
if (is_array($headers))
|
||||
{
|
||||
// Make sure there are no bare linefeeds in the headers
|
||||
$headers = preg_replace('#(?<!\r)\n#si', "\n", $headers);
|
||||
$headers = explode("\n", $headers);
|
||||
$headers = (sizeof($headers) > 1) ? join("\n", $headers) : $headers[0];
|
||||
}
|
||||
$headers = chop($headers);
|
||||
|
||||
// Make sure there are no bare linefeeds in the headers
|
||||
$headers = preg_replace('#(?<!\r)\n#si', "\r\n", $headers);
|
||||
|
||||
// Ok this is rather confusing all things considered,
|
||||
// but we have to grab bcc and cc headers and treat them differently
|
||||
// Something we really didn't take into consideration originally
|
||||
$headers_used = array();
|
||||
$header_array = explode("\r\n", $headers);
|
||||
$headers = '';
|
||||
|
||||
foreach ($headers as $header)
|
||||
foreach ($header_array as $header)
|
||||
{
|
||||
if (strpos(strtolower($header), 'cc:') === 0 || strpos(strtolower($header), 'bcc:') === 0)
|
||||
{
|
||||
continue;
|
||||
$header = '';
|
||||
}
|
||||
$headers_used[] = trim($header);
|
||||
$headers .= ($header != '') ? $header . "\r\n" : '';
|
||||
}
|
||||
|
||||
$headers = chop(implode("\r\n", $headers_used));
|
||||
$headers = chop($headers);
|
||||
}
|
||||
|
||||
if (trim($subject) == '')
|
||||
@@ -979,10 +935,7 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $headers = false)
|
||||
}
|
||||
|
||||
// Now any custom headers....
|
||||
if ($headers !== false)
|
||||
{
|
||||
$smtp->server_send("$headers\r\n");
|
||||
}
|
||||
$smtp->server_send("$headers\r\n");
|
||||
|
||||
// Ok now we are ready for the message...
|
||||
$smtp->server_send($message);
|
||||
@@ -1094,7 +1047,7 @@ class smtp_class
|
||||
$err_msg .= $message;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Log into server and get possible auth codes if neccessary
|
||||
*/
|
||||
@@ -1103,7 +1056,7 @@ class smtp_class
|
||||
global $user;
|
||||
|
||||
$err_msg = '';
|
||||
$local_host = (function_exists('php_uname')) ? gethostbyaddr(gethostbyname(php_uname('n'))) : $user->host;
|
||||
$local_host = (function_exists('php_uname')) ? php_uname('n') : $user->host;
|
||||
|
||||
// If we are authenticating through pop-before-smtp, we
|
||||
// have to login ones before we get authenticated
|
||||
@@ -1155,7 +1108,7 @@ class smtp_class
|
||||
return false;
|
||||
}
|
||||
|
||||
// If EHLO fails, we try HELO
|
||||
// If EHLO fails, we try HELO
|
||||
$this->server_send("HELO {$local_host}");
|
||||
if ($err_msg = $this->server_parse('250', __LINE__))
|
||||
{
|
||||
@@ -1176,7 +1129,7 @@ class smtp_class
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!isset($this->commands['AUTH']))
|
||||
{
|
||||
return (isset($user->lang['SMTP_NO_AUTH_SUPPORT'])) ? $user->lang['SMTP_NO_AUTH_SUPPORT'] : 'SMTP server does not support authentication';
|
||||
@@ -1337,7 +1290,7 @@ class smtp_class
|
||||
}
|
||||
|
||||
$md5_challenge = base64_decode($this->responses[0]);
|
||||
|
||||
|
||||
// Parse the md5 challenge - from AUTH_SASL (PEAR)
|
||||
$tokens = array();
|
||||
while (preg_match('/^([a-z-]+)=("[^"]+(?<!\\\)"|[^,]+)/i', $md5_challenge, $matches))
|
||||
@@ -1447,10 +1400,9 @@ function mail_encode($str)
|
||||
// define start delimimter, end delimiter and spacer
|
||||
$start = "=?UTF-8?B?";
|
||||
$end = "?=";
|
||||
$delimiter = "\r\n ";
|
||||
$spacer = $end . ' ' . $start;
|
||||
$split_length = 64;
|
||||
|
||||
// Maximum length is 75. $split_length *must* be a multiple of 4, but <= 75 - strlen($start . $delimiter . $end)!!!
|
||||
$split_length = 60;
|
||||
$encoded_str = base64_encode($str);
|
||||
|
||||
// If encoded string meets the limits, we just return with the correct data.
|
||||
@@ -1462,7 +1414,7 @@ function mail_encode($str)
|
||||
// If there is only ASCII data, we just return what we want, correctly splitting the lines.
|
||||
if (strlen($str) === utf8_strlen($str))
|
||||
{
|
||||
return $start . implode($end . $delimiter . $start, str_split($encoded_str, $split_length)) . $end;
|
||||
return $start . implode($spacer, str_split($encoded_str, $split_length)) . $end;
|
||||
}
|
||||
|
||||
// UTF-8 data, compose encoded lines
|
||||
@@ -1478,10 +1430,10 @@ function mail_encode($str)
|
||||
$text .= array_shift($array);
|
||||
}
|
||||
|
||||
$str .= $start . base64_encode($text) . $end . $delimiter;
|
||||
$str .= $start . base64_encode($text) . $end . ' ';
|
||||
}
|
||||
|
||||
return substr($str, 0, -strlen($delimiter));
|
||||
return substr($str, 0, -1);
|
||||
}
|
||||
|
||||
?>
|
@@ -28,47 +28,11 @@ class p_master
|
||||
var $p_mode;
|
||||
var $p_parent;
|
||||
|
||||
var $include_path = false;
|
||||
var $active_module = false;
|
||||
var $active_module_row_id = false;
|
||||
var $acl_forum_id = false;
|
||||
var $module_ary = array();
|
||||
|
||||
/**
|
||||
* Constuctor
|
||||
* Set module include path
|
||||
*/
|
||||
function p_master($include_path = false)
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
|
||||
$this->include_path = ($include_path !== false) ? $include_path : $phpbb_root_path . 'includes/';
|
||||
|
||||
// Make sure the path ends with /
|
||||
if (substr($this->include_path, -1) !== '/')
|
||||
{
|
||||
$this->include_path .= '/';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set custom include path for modules
|
||||
* Schema for inclusion is include_path . modulebase
|
||||
*
|
||||
* @param string $include_path include path to be used.
|
||||
* @access public
|
||||
*/
|
||||
function set_custom_include_path($include_path)
|
||||
{
|
||||
$this->include_path = $include_path;
|
||||
|
||||
// Make sure the path ends with /
|
||||
if (substr($this->include_path, -1) !== '/')
|
||||
{
|
||||
$this->include_path .= '/';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* List modules
|
||||
*
|
||||
@@ -431,7 +395,7 @@ class p_master
|
||||
{
|
||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user;
|
||||
|
||||
$module_path = $this->include_path . $this->p_class;
|
||||
$module_path = $phpbb_root_path . 'includes/' . $this->p_class;
|
||||
$icat = request_var('icat', '');
|
||||
|
||||
if ($this->active_module === false)
|
||||
@@ -854,11 +818,11 @@ class p_master
|
||||
{
|
||||
global $user, $phpEx;
|
||||
|
||||
if (file_exists($user->lang_path . $user->lang_name . '/mods'))
|
||||
if (file_exists($user->lang_path . 'mods'))
|
||||
{
|
||||
$add_files = array();
|
||||
|
||||
$dir = @opendir($user->lang_path . $user->lang_name . '/mods');
|
||||
$dir = @opendir($user->lang_path . 'mods');
|
||||
|
||||
if ($dir)
|
||||
{
|
||||
|
@@ -362,7 +362,7 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
|
||||
{
|
||||
$upload->set_disallowed_content(explode('|', $config['mime_triggers']));
|
||||
}
|
||||
|
||||
|
||||
if (!$local)
|
||||
{
|
||||
$filedata['post_attach'] = ($upload->is_valid($form_name)) ? true : false;
|
||||
@@ -614,7 +614,7 @@ function create_thumbnail($source, $destination, $mimetype)
|
||||
list($new_width, $new_height) = get_img_size_format($width, $height);
|
||||
|
||||
// Do not create a thumbnail if the resulting width/height is bigger than the original one
|
||||
if ($new_width >= $width && $new_height >= $height)
|
||||
if ($new_width > $width && $new_height > $height)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -629,7 +629,7 @@ function create_thumbnail($source, $destination, $mimetype)
|
||||
$config['img_imagick'] .= '/';
|
||||
}
|
||||
|
||||
@passthru(escapeshellcmd($config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -quality 85 -geometry ' . $new_width . 'x' . $new_height . ' "' . str_replace('\\', '/', $source) . '" "' . str_replace('\\', '/', $destination) . '"');
|
||||
@passthru(escapeshellcmd($config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -quality 85 -antialias -sample ' . $new_width . 'x' . $new_height . ' "' . str_replace('\\', '/', $source) . '" +profile "*" "' . str_replace('\\', '/', $destination) . '"');
|
||||
|
||||
if (file_exists($destination))
|
||||
{
|
||||
@@ -688,10 +688,6 @@ function create_thumbnail($source, $destination, $mimetype)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Preserve alpha transparency (png for example)
|
||||
@imagealphablending($new_image, false);
|
||||
@imagesavealpha($new_image, true);
|
||||
|
||||
imagecopyresampled($new_image, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
|
||||
}
|
||||
|
||||
@@ -733,7 +729,7 @@ function create_thumbnail($source, $destination, $mimetype)
|
||||
return false;
|
||||
}
|
||||
|
||||
phpbb_chmod($destination, CHMOD_READ | CHMOD_WRITE);
|
||||
@chmod($destination, 0666);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -765,20 +761,20 @@ function posting_gen_inline_attachments(&$attachment_data)
|
||||
/**
|
||||
* Generate inline attachment entry
|
||||
*/
|
||||
function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_attach_box = true)
|
||||
function posting_gen_attachment_entry($attachment_data, &$filename_data)
|
||||
{
|
||||
global $template, $config, $phpbb_root_path, $phpEx, $user, $auth;
|
||||
global $template, $config, $phpbb_root_path, $phpEx, $user;
|
||||
|
||||
// Some default template variables
|
||||
$template->assign_vars(array(
|
||||
'S_SHOW_ATTACH_BOX' => $show_attach_box,
|
||||
'S_HAS_ATTACHMENTS' => sizeof($attachment_data),
|
||||
'FILESIZE' => $config['max_filesize'],
|
||||
'FILE_COMMENT' => (isset($filename_data['filecomment'])) ? $filename_data['filecomment'] : '',
|
||||
));
|
||||
'S_SHOW_ATTACH_BOX' => true)
|
||||
);
|
||||
|
||||
if (sizeof($attachment_data))
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_HAS_ATTACHMENTS' => true)
|
||||
);
|
||||
|
||||
// We display the posted attachments within the desired order.
|
||||
($config['display_order']) ? krsort($attachment_data) : ksort($attachment_data);
|
||||
|
||||
@@ -808,6 +804,11 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_a
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'FILE_COMMENT' => $filename_data['filecomment'],
|
||||
'FILESIZE' => $config['max_filesize'])
|
||||
);
|
||||
|
||||
return sizeof($attachment_data);
|
||||
}
|
||||
|
||||
@@ -963,20 +964,13 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
||||
}
|
||||
|
||||
$sql = $db->sql_build_query('SELECT', array(
|
||||
'SELECT' => 'u.username, u.user_id, u.user_colour, p.*, z.friend, z.foe',
|
||||
'SELECT' => 'u.username, u.user_id, u.user_colour, p.*',
|
||||
|
||||
'FROM' => array(
|
||||
USERS_TABLE => 'u',
|
||||
POSTS_TABLE => 'p',
|
||||
),
|
||||
|
||||
'LEFT_JOIN' => array(
|
||||
array(
|
||||
'FROM' => array(ZEBRA_TABLE => 'z'),
|
||||
'ON' => 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id'
|
||||
)
|
||||
),
|
||||
|
||||
'WHERE' => $db->sql_in_set('p.post_id', $post_list) . '
|
||||
AND u.user_id = p.poster_id'
|
||||
));
|
||||
@@ -1067,9 +1061,6 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
||||
|
||||
$post_subject = censor_text($post_subject);
|
||||
|
||||
$post_anchor = ($mode == 'post_review') ? 'ppr' . $row['post_id'] : 'pr' . $row['post_id'];
|
||||
$u_show_post = append_sid($phpbb_root_path . 'viewtopic.' . $phpEx, "f=$forum_id&t=$topic_id&p={$row['post_id']}&view=show#p{$row['post_id']}");
|
||||
|
||||
$template->assign_block_vars($mode . '_row', array(
|
||||
'POST_AUTHOR_FULL' => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
|
||||
'POST_AUTHOR_COLOUR' => get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
|
||||
@@ -1077,9 +1068,6 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
|
||||
'U_POST_AUTHOR' => get_username_string('profile', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
|
||||
|
||||
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
|
||||
'S_FRIEND' => ($row['friend']) ? true : false,
|
||||
'S_IGNORE_POST' => ($row['foe']) ? true : false,
|
||||
'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), "<a href=\"{$u_show_post}\" onclick=\"dE('{$post_anchor}', 1); return false;\">", '</a>') : '',
|
||||
|
||||
'POST_SUBJECT' => $post_subject,
|
||||
'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']),
|
||||
@@ -1126,7 +1114,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
|
||||
|
||||
if (!$topic_notification && !$forum_notification)
|
||||
{
|
||||
trigger_error('NO_MODE');
|
||||
trigger_error('WRONG_NOTIFICATION_MODE');
|
||||
}
|
||||
|
||||
if (($topic_notification && !$config['allow_topic_notify']) || ($forum_notification && !$config['allow_forum_notify']))
|
||||
@@ -1263,7 +1251,6 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
|
||||
$msg_list_ary[$row['template']][$pos]['jabber'] = $row['user_jabber'];
|
||||
$msg_list_ary[$row['template']][$pos]['name'] = $row['username'];
|
||||
$msg_list_ary[$row['template']][$pos]['lang'] = $row['user_lang'];
|
||||
$msg_list_ary[$row['template']][$pos]['user_id']= $row['user_id'];
|
||||
}
|
||||
unset($msg_users);
|
||||
|
||||
@@ -1284,8 +1271,8 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
|
||||
'U_FORUM' => generate_board_url() . "/viewforum.$phpEx?f=$forum_id",
|
||||
'U_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t=$topic_id",
|
||||
'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?uid={$addr['user_id']}&f=$forum_id&t=$topic_id&unwatch=topic",
|
||||
'U_STOP_WATCHING_FORUM' => generate_board_url() . "/viewforum.$phpEx?uid={$addr['user_id']}&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']);
|
||||
@@ -1358,7 +1345,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
|
||||
else if ($data['topic_first_post_id'] == $post_id)
|
||||
{
|
||||
$post_mode = 'delete_first_post';
|
||||
}
|
||||
}
|
||||
else if ($data['topic_last_post_id'] == $post_id)
|
||||
{
|
||||
$post_mode = 'delete_last_post';
|
||||
@@ -1450,7 +1437,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
|
||||
$sql_data[FORUMS_TABLE] = ($data['post_approved']) ? 'forum_posts = forum_posts - 1' : '';
|
||||
}
|
||||
|
||||
$sql_data[TOPICS_TABLE] = 'topic_poster = ' . intval($row['poster_id']) . ', topic_first_post_id = ' . intval($row['post_id']) . ", topic_first_poster_colour = '" . $db->sql_escape($row['user_colour']) . "', topic_first_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "'";
|
||||
$sql_data[TOPICS_TABLE] = 'topic_first_post_id = ' . intval($row['post_id']) . ", topic_first_poster_colour = '" . $db->sql_escape($row['user_colour']) . "', topic_first_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "'";
|
||||
|
||||
// Decrementing topic_replies here is fine because this case only happens if there is more than one post within the topic - basically removing one "reply"
|
||||
$sql_data[TOPICS_TABLE] .= ', topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : '');
|
||||
@@ -1617,18 +1604,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
$data['post_approved'] = $topic_row['post_approved'];
|
||||
}
|
||||
|
||||
// This variable indicates if the user is able to post or put into the queue - it is used later for all code decisions regarding approval
|
||||
$post_approval = 1;
|
||||
|
||||
// Check the permissions for post approval, as well as the queue trigger where users are put on approval with a post count lower than specified. Moderators are not affected.
|
||||
if ((($config['enable_queue_trigger'] && $user->data['user_posts'] < $config['queue_trigger_posts']) || !$auth->acl_get('f_noapprove', $data['forum_id'])) && !$auth->acl_get('m_approve', $data['forum_id']))
|
||||
{
|
||||
$post_approval = 0;
|
||||
}
|
||||
|
||||
// Start the transaction here
|
||||
$db->sql_transaction('begin');
|
||||
|
||||
|
||||
// Collect Information
|
||||
switch ($post_mode)
|
||||
{
|
||||
@@ -1640,7 +1619,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
'icon_id' => $data['icon_id'],
|
||||
'poster_ip' => $user->ip,
|
||||
'post_time' => $current_time,
|
||||
'post_approved' => $post_approval,
|
||||
'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'],
|
||||
@@ -1672,7 +1651,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
// Display edit info if edit reason given or user is editing his post, which is not the last within the topic.
|
||||
if ($data['post_edit_reason'] || (!$auth->acl_get('m_edit', $data['forum_id']) && ($post_mode == 'edit' || $post_mode == 'edit_first_post')))
|
||||
{
|
||||
$data['post_edit_reason'] = truncate_string($data['post_edit_reason'], 255, 255, false);
|
||||
$data['post_edit_reason'] = truncate_string($data['post_edit_reason'], 255, false);
|
||||
|
||||
$sql_data[POSTS_TABLE]['sql'] = array(
|
||||
'post_edit_time' => $current_time,
|
||||
@@ -1706,7 +1685,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'],
|
||||
'poster_id' => $data['poster_id'],
|
||||
'icon_id' => $data['icon_id'],
|
||||
'post_approved' => (!$post_approval) ? 0 : $data['post_approved'],
|
||||
'post_approved' => (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? 0 : $data['post_approved'],
|
||||
'enable_bbcode' => $data['enable_bbcode'],
|
||||
'enable_smilies' => $data['enable_smilies'],
|
||||
'enable_magic_url' => $data['enable_urls'],
|
||||
@@ -1738,10 +1717,9 @@ 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,
|
||||
'topic_last_view_time' => $current_time,
|
||||
'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'],
|
||||
'icon_id' => $data['icon_id'],
|
||||
'topic_approved' => $post_approval,
|
||||
'topic_approved' => (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1,
|
||||
'topic_title' => $subject,
|
||||
'topic_first_poster_name' => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''),
|
||||
'topic_first_poster_colour' => $user->data['user_colour'],
|
||||
@@ -1752,50 +1730,33 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
|
||||
if (isset($poll['poll_options']) && !empty($poll['poll_options']))
|
||||
{
|
||||
$poll_start = ($poll['poll_start']) ? $poll['poll_start'] : $current_time;
|
||||
$poll_length = $poll['poll_length'] * 86400;
|
||||
if ($poll_length < 0)
|
||||
{
|
||||
$poll_start = $poll_start + $poll_length;
|
||||
if ($poll_start < 0)
|
||||
{
|
||||
$poll_start = 0;
|
||||
}
|
||||
$poll_length = 1;
|
||||
}
|
||||
|
||||
$sql_data[TOPICS_TABLE]['sql'] = array_merge($sql_data[TOPICS_TABLE]['sql'], array(
|
||||
'poll_title' => $poll['poll_title'],
|
||||
'poll_start' => $poll_start,
|
||||
'poll_start' => ($poll['poll_start']) ? $poll['poll_start'] : $current_time,
|
||||
'poll_max_options' => $poll['poll_max_options'],
|
||||
'poll_length' => $poll_length,
|
||||
'poll_length' => ($poll['poll_length'] * 86400),
|
||||
'poll_vote_change' => $poll['poll_vote_change'])
|
||||
);
|
||||
}
|
||||
|
||||
$sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id']) && $post_approval) ? ', user_posts = user_posts + 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 ($topic_type != POST_GLOBAL)
|
||||
{
|
||||
if ($post_approval)
|
||||
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' . (($post_approval) ? ', 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_last_view_time = ' . $current_time . ',
|
||||
topic_replies_real = topic_replies_real + 1,
|
||||
topic_bumped = 0,
|
||||
topic_bumper = 0' .
|
||||
(($post_approval) ? ', topic_replies = topic_replies + 1' : '') .
|
||||
((!empty($data['attachment_data']) || (isset($data['topic_attachment']) && $data['topic_attachment'])) ? ', topic_attachment = 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' : '') . ((!empty($data['attachment_data']) || (isset($data['topic_attachment']) && $data['topic_attachment'])) ? ', topic_attachment = 1' : '');
|
||||
|
||||
$sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id']) && $post_approval) ? ', user_posts = user_posts + 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 ($post_approval && $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';
|
||||
}
|
||||
@@ -1803,41 +1764,26 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
|
||||
case 'edit_topic':
|
||||
case 'edit_first_post':
|
||||
if (isset($poll['poll_options']) && !empty($poll['poll_options']))
|
||||
{
|
||||
$poll_start = ($poll['poll_start']) ? $poll['poll_start'] : $current_time;
|
||||
$poll_length = $poll['poll_length'] * 86400;
|
||||
if ($poll_length < 0)
|
||||
{
|
||||
$poll_start = $poll_start + $poll_length;
|
||||
if ($poll_start < 0)
|
||||
{
|
||||
$poll_start = 0;
|
||||
}
|
||||
$poll_length = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$sql_data[TOPICS_TABLE]['sql'] = array(
|
||||
'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'],
|
||||
'icon_id' => $data['icon_id'],
|
||||
'topic_approved' => (!$post_approval) ? 0 : $data['topic_approved'],
|
||||
'topic_approved' => (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? 0 : $data['topic_approved'],
|
||||
'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,
|
||||
'poll_title' => (isset($poll['poll_options'])) ? $poll['poll_title'] : '',
|
||||
'poll_start' => (isset($poll['poll_options'])) ? $poll_start : 0,
|
||||
'poll_start' => (isset($poll['poll_options'])) ? (($poll['poll_start']) ? $poll['poll_start'] : $current_time) : 0,
|
||||
'poll_max_options' => (isset($poll['poll_options'])) ? $poll['poll_max_options'] : 1,
|
||||
'poll_length' => (isset($poll['poll_options'])) ? $poll_length : 0,
|
||||
'poll_length' => (isset($poll['poll_options'])) ? ($poll['poll_length'] * 86400) : 0,
|
||||
'poll_vote_change' => (isset($poll['poll_vote_change'])) ? $poll['poll_vote_change'] : 0,
|
||||
'topic_last_view_time' => $current_time,
|
||||
|
||||
'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : (isset($data['topic_attachment']) ? $data['topic_attachment'] : 0),
|
||||
);
|
||||
|
||||
// Correctly set back the topic replies and forum posts... only if the topic was approved before and now gets disapproved
|
||||
if (!$post_approval && $data['topic_approved'])
|
||||
if (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id']) && $data['topic_approved'])
|
||||
{
|
||||
// Do we need to grab some topic informations?
|
||||
if (!sizeof($topic_row))
|
||||
@@ -1857,14 +1803,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
$sql_data[FORUMS_TABLE]['stat'][] = 'forum_topics = forum_topics - 1';
|
||||
$sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts - ' . ($topic_row['topic_replies'] + 1);
|
||||
|
||||
set_config_count('num_topics', -1, true);
|
||||
set_config_count('num_posts', ($topic_row['topic_replies'] + 1) * (-1), true);
|
||||
|
||||
// Only decrement this post, since this is the one non-approved now
|
||||
if ($auth->acl_get('f_postcount', $data['forum_id']))
|
||||
{
|
||||
$sql_data[USERS_TABLE]['stat'][] = 'user_posts = user_posts - 1';
|
||||
}
|
||||
set_config('num_topics', $config['num_topics'] - 1, true);
|
||||
set_config('num_posts', $config['num_posts'] - ($topic_row['topic_replies'] + 1), true);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1873,17 +1813,12 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
case 'edit_last_post':
|
||||
|
||||
// Correctly set back the topic replies and forum posts... but only if the post was approved before.
|
||||
if (!$post_approval && $data['post_approved'])
|
||||
if (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id']) && $data['post_approved'])
|
||||
{
|
||||
$sql_data[TOPICS_TABLE]['stat'][] = 'topic_replies = topic_replies - 1, topic_last_view_time = ' . $current_time;
|
||||
$sql_data[TOPICS_TABLE]['stat'][] = 'topic_replies = topic_replies - 1';
|
||||
$sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts - 1';
|
||||
|
||||
set_config_count('num_posts', -1, true);
|
||||
|
||||
if ($auth->acl_get('f_postcount', $data['forum_id']))
|
||||
{
|
||||
$sql_data[USERS_TABLE]['stat'][] = 'user_posts = user_posts - 1';
|
||||
}
|
||||
set_config('num_posts', $config['num_posts'] - 1, true);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -2145,8 +2080,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
|
||||
if ($space_taken && $files_added)
|
||||
{
|
||||
set_config_count('upload_dir_size', $space_taken, true);
|
||||
set_config_count('num_files', $files_added, true);
|
||||
set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true);
|
||||
set_config('num_files', $config['num_files'] + $files_added, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2184,20 +2119,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
// this post is the latest post in the forum, better update
|
||||
if ($row['forum_last_post_id'] == $data['post_id'])
|
||||
{
|
||||
// If post approved and subject changed, or poster is anonymous, we need to update the forum_last* rows
|
||||
if ($post_approved && ($row['forum_last_post_subject'] !== $subject || $data['poster_id'] == ANONYMOUS))
|
||||
if ($post_approved && $row['forum_last_post_subject'] !== $subject)
|
||||
{
|
||||
// the post's subject changed
|
||||
if ($row['forum_last_post_subject'] !== $subject)
|
||||
{
|
||||
$sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_subject = \'' . $db->sql_escape($subject) . '\'';
|
||||
}
|
||||
|
||||
// Update the user name if poster is anonymous... just in case an admin changed it
|
||||
if ($data['poster_id'] == ANONYMOUS)
|
||||
{
|
||||
$sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape($username) . "'";
|
||||
}
|
||||
// the only data that can really be changed is the post's subject
|
||||
$sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_subject = \'' . $db->sql_escape($subject) . '\'';
|
||||
}
|
||||
else if ($data['post_approved'] !== $post_approved)
|
||||
{
|
||||
@@ -2334,12 +2259,6 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
{
|
||||
// only the subject can be changed from edit
|
||||
$sql_data[TOPICS_TABLE]['stat'][] = "topic_last_post_subject = '" . $db->sql_escape($subject) . "'";
|
||||
|
||||
// Maybe not only the subject, but also changing anonymous usernames. ;)
|
||||
if ($data['poster_id'] == ANONYMOUS)
|
||||
{
|
||||
$sql_data[TOPICS_TABLE]['stat'][] = "topic_last_poster_name = '" . $db->sql_escape($username) . "'";
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!$data['post_approved'] && ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies'])))
|
||||
@@ -2375,22 +2294,22 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
}
|
||||
|
||||
// Update total post count, do not consider moderated posts/topics
|
||||
if ($post_approval)
|
||||
if ($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id']))
|
||||
{
|
||||
if ($post_mode == 'post')
|
||||
{
|
||||
set_config_count('num_topics', 1, true);
|
||||
set_config_count('num_posts', 1, true);
|
||||
set_config('num_topics', $config['num_topics'] + 1, true);
|
||||
set_config('num_posts', $config['num_posts'] + 1, true);
|
||||
}
|
||||
|
||||
if ($post_mode == 'reply')
|
||||
{
|
||||
set_config_count('num_posts', 1, true);
|
||||
set_config('num_posts', $config['num_posts'] + 1, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Update forum stats
|
||||
$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 = ' . $poster_id);
|
||||
$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']);
|
||||
|
||||
foreach ($sql_data as $table => $update_ary)
|
||||
{
|
||||
@@ -2507,14 +2426,14 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
}
|
||||
|
||||
// Send Notifications
|
||||
if ($mode != 'edit' && $mode != 'delete' && $post_approval)
|
||||
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']);
|
||||
}
|
||||
|
||||
$params = $add_anchor = '';
|
||||
|
||||
if ($post_approval)
|
||||
if ($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id']))
|
||||
{
|
||||
$params .= '&t=' . $data['topic_id'];
|
||||
|
||||
|
@@ -930,7 +930,7 @@ function handle_mark_actions($user_id, $mark_action)
|
||||
*/
|
||||
function delete_pm($user_id, $msg_ids, $folder_id)
|
||||
{
|
||||
global $db, $user, $phpbb_root_path, $phpEx;
|
||||
global $db, $user;
|
||||
|
||||
$user_id = (int) $user_id;
|
||||
$folder_id = (int) $folder_id;
|
||||
@@ -979,8 +979,6 @@ function delete_pm($user_id, $msg_ids, $folder_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
$db->sql_transaction('begin');
|
||||
|
||||
// if no one has read the message yet (meaning it is in users outbox)
|
||||
// then mark the message as deleted...
|
||||
if ($folder_id == PRIVMSGS_OUTBOX)
|
||||
@@ -1058,21 +1056,11 @@ function delete_pm($user_id, $msg_ids, $folder_id)
|
||||
|
||||
if (sizeof($delete_ids))
|
||||
{
|
||||
// Check if there are any attachments we need to remove
|
||||
if (!function_exists('delete_attachments'))
|
||||
{
|
||||
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
||||
}
|
||||
|
||||
delete_attachments('message', $delete_ids, false);
|
||||
|
||||
$sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('msg_id', $delete_ids);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
$db->sql_transaction('commit');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1341,17 +1329,12 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
|
||||
|
||||
if (isset($data['address_list']['g']) && sizeof($data['address_list']['g']))
|
||||
{
|
||||
// We need to check the PM status of group members (do they want to receive PM's?)
|
||||
// Only check if not a moderator or admin, since they are allowed to override this user setting
|
||||
$sql_allow_pm = (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) ? ' AND u.user_allow_pm = 1' : '';
|
||||
|
||||
$sql = 'SELECT u.user_type, ug.group_id, ug.user_id
|
||||
FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug
|
||||
WHERE ' . $db->sql_in_set('ug.group_id', array_keys($data['address_list']['g'])) . '
|
||||
AND ug.user_pending = 0
|
||||
AND u.user_id = ug.user_id
|
||||
AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')' .
|
||||
$sql_allow_pm;
|
||||
AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
@@ -1571,8 +1554,8 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
|
||||
|
||||
if ($space_taken && $files_added)
|
||||
{
|
||||
set_config_count('upload_dir_size', $space_taken, true);
|
||||
set_config_count('num_files', $files_added, true);
|
||||
set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true);
|
||||
set_config('num_files', $config['num_files'] + $files_added, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1763,14 +1746,8 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
|
||||
$url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
|
||||
$next_history_pm = $previous_history_pm = $prev_id = 0;
|
||||
|
||||
// Re-order rowset to be able to get the next/prev message rows...
|
||||
$rowset = array_values($rowset);
|
||||
|
||||
for ($i = 0, $size = sizeof($rowset); $i < $size; $i++)
|
||||
foreach ($rowset as $id => $row)
|
||||
{
|
||||
$row = &$rowset[$i];
|
||||
$id = (int) $row['msg_id'];
|
||||
|
||||
$author_id = $row['author_id'];
|
||||
$folder_id = (int) $row['folder_id'];
|
||||
|
||||
@@ -1779,16 +1756,6 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
|
||||
|
||||
$message = censor_text($message);
|
||||
|
||||
$decoded_message = false;
|
||||
|
||||
if ($in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS && $author_id != $user->data['user_id'])
|
||||
{
|
||||
$decoded_message = $message;
|
||||
decode_message($decoded_message, $row['bbcode_uid']);
|
||||
|
||||
$decoded_message = bbcode_nl2br($decoded_message);
|
||||
}
|
||||
|
||||
if ($row['bbcode_bitfield'])
|
||||
{
|
||||
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
|
||||
@@ -1801,22 +1768,21 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
|
||||
|
||||
if ($id == $msg_id)
|
||||
{
|
||||
$next_history_pm = (isset($rowset[$i + 1])) ? (int) $rowset[$i + 1]['msg_id'] : 0;
|
||||
$next_history_pm = next($rowset);
|
||||
$next_history_pm = (sizeof($next_history_pm)) ? (int) $next_history_pm['msg_id'] : 0;
|
||||
$previous_history_pm = $prev_id;
|
||||
}
|
||||
|
||||
$template->assign_block_vars('history_row', array(
|
||||
'MESSAGE_AUTHOR_QUOTE' => (($decoded_message) ? addslashes(get_username_string('username', $author_id, $row['username'], $row['user_colour'], $row['username'])) : ''),
|
||||
'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $row['username'], $row['user_colour'], $row['username']),
|
||||
'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $author_id, $row['username'], $row['user_colour'], $row['username']),
|
||||
'MESSAGE_AUTHOR' => get_username_string('username', $author_id, $row['username'], $row['user_colour'], $row['username']),
|
||||
'U_MESSAGE_AUTHOR' => get_username_string('profile', $author_id, $row['username'], $row['user_colour'], $row['username']),
|
||||
|
||||
'SUBJECT' => $subject,
|
||||
'SENT_DATE' => $user->format_date($row['message_time']),
|
||||
'MESSAGE' => $message,
|
||||
'FOLDER' => implode(', ', $row['folder']),
|
||||
'DECODED_MESSAGE' => $decoded_message,
|
||||
'SUBJECT' => $subject,
|
||||
'SENT_DATE' => $user->format_date($row['message_time']),
|
||||
'MESSAGE' => $message,
|
||||
'FOLDER' => implode(', ', $row['folder']),
|
||||
|
||||
'S_CURRENT_MSG' => ($row['msg_id'] == $msg_id),
|
||||
'S_AUTHOR_DELETED' => ($author_id == ANONYMOUS) ? true : false,
|
||||
|
@@ -39,15 +39,15 @@ class custom_profile
|
||||
switch ($mode)
|
||||
{
|
||||
case 'register':
|
||||
// If the field is required we show it on the registration page
|
||||
$sql_where .= ' AND f.field_show_on_reg = 1';
|
||||
// If the field is required we show it on the registration page and do not show hidden fields
|
||||
$sql_where .= ' AND (f.field_show_on_reg = 1 OR f.field_required = 1) AND f.field_hide = 0';
|
||||
break;
|
||||
|
||||
case 'profile':
|
||||
// Show hidden fields to moderators/admins
|
||||
if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
|
||||
{
|
||||
$sql_where .= ' AND f.field_show_profile = 1';
|
||||
$sql_where .= ' AND f.field_hide = 0';
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -106,7 +106,7 @@ class custom_profile
|
||||
{
|
||||
case FIELD_DATE:
|
||||
$field_validate = explode('-', $field_value);
|
||||
|
||||
|
||||
$day = (isset($field_validate[0])) ? (int) $field_validate[0] : 0;
|
||||
$month = (isset($field_validate[1])) ? (int) $field_validate[1] : 0;
|
||||
$year = (isset($field_validate[2])) ? (int) $field_validate[2] : 0;
|
||||
@@ -154,14 +154,14 @@ class custom_profile
|
||||
return 'FIELD_TOO_LARGE';
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case FIELD_DROPDOWN:
|
||||
if ($field_value == $field_data['field_novalue'] && $field_data['field_required'])
|
||||
{
|
||||
return 'FIELD_REQUIRED';
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case FIELD_STRING:
|
||||
case FIELD_TEXT:
|
||||
if (empty($field_value) && !$field_data['field_required'])
|
||||
@@ -205,7 +205,7 @@ class custom_profile
|
||||
global $db, $user, $auth;
|
||||
|
||||
$this->profile_cache = array();
|
||||
|
||||
|
||||
// Display hidden/no_view fields for admin/moderator
|
||||
$sql = 'SELECT l.*, f.*
|
||||
FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . ' f
|
||||
@@ -234,7 +234,7 @@ class custom_profile
|
||||
if ($preview)
|
||||
{
|
||||
$lang_options = (!is_array($this->vars['lang_options'])) ? explode("\n", $this->vars['lang_options']) : $this->vars['lang_options'];
|
||||
|
||||
|
||||
foreach ($lang_options as $num => $var)
|
||||
{
|
||||
$this->options_lang[$field_id][$lang_id][($num + 1)] = $var;
|
||||
@@ -270,15 +270,15 @@ class custom_profile
|
||||
switch ($mode)
|
||||
{
|
||||
case 'register':
|
||||
// If the field is required we show it on the registration page
|
||||
$sql_where .= ' AND f.field_show_on_reg = 1';
|
||||
// If the field is required we show it on the registration page and do not show hidden fields
|
||||
$sql_where .= ' AND (f.field_show_on_reg = 1 OR f.field_required = 1) AND f.field_hide = 0';
|
||||
break;
|
||||
|
||||
case 'profile':
|
||||
// Show hidden fields to moderators/admins
|
||||
if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
|
||||
{
|
||||
$sql_where .= ' AND f.field_show_profile = 1';
|
||||
$sql_where .= ' AND f.field_hide = 0';
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -316,12 +316,12 @@ class custom_profile
|
||||
case 'FIELD_TOO_SMALL':
|
||||
$error = sprintf($user->lang[$cp_result], $row['lang_name'], $row['field_minlen']);
|
||||
break;
|
||||
|
||||
|
||||
case 'FIELD_TOO_LONG':
|
||||
case 'FIELD_TOO_LARGE':
|
||||
$error = sprintf($user->lang[$cp_result], $row['lang_name'], $row['field_maxlen']);
|
||||
break;
|
||||
|
||||
|
||||
case 'FIELD_INVALID_CHARS':
|
||||
switch ($row['field_validation'])
|
||||
{
|
||||
@@ -339,7 +339,7 @@ class custom_profile
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ($error != '')
|
||||
{
|
||||
$cp_error[] = $error;
|
||||
@@ -434,7 +434,7 @@ class custom_profile
|
||||
'S_PROFILE_' . strtoupper($ident) => true
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return $tpl_fields;
|
||||
}
|
||||
else
|
||||
@@ -589,7 +589,7 @@ class custom_profile
|
||||
else
|
||||
{
|
||||
$value = (isset($_REQUEST[$profile_row['field_ident']])) ? request_var($profile_row['field_ident'], $default_value, true) : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]);
|
||||
|
||||
|
||||
if (gettype($value) == 'string')
|
||||
{
|
||||
$value = utf8_normalize_nfc($value);
|
||||
@@ -672,7 +672,7 @@ class custom_profile
|
||||
$profile_row['s_year_options'] .= '<option value="' . $i . '"' . (($i == $year) ? ' selected="selected"' : '') . ">$i</option>";
|
||||
}
|
||||
unset($now);
|
||||
|
||||
|
||||
$profile_row['field_value'] = 0;
|
||||
$template->assign_block_vars($this->profile_types[$profile_row['field_type']], array_change_key_case($profile_row, CASE_UPPER));
|
||||
}
|
||||
@@ -826,7 +826,7 @@ class custom_profile
|
||||
$cp_data['pf_' . $row['field_ident']] = (in_array($row['field_type'], array(FIELD_TEXT, FIELD_STRING))) ? $row['lang_default_value'] : $row['field_default_value'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
return $cp_data;
|
||||
}
|
||||
|
||||
@@ -838,9 +838,9 @@ class custom_profile
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
global $config;
|
||||
|
||||
|
||||
$var_name = 'pf_' . $profile_row['field_ident'];
|
||||
|
||||
|
||||
switch ($profile_row['field_type'])
|
||||
{
|
||||
case FIELD_DATE:
|
||||
@@ -860,7 +860,7 @@ class custom_profile
|
||||
$month = request_var($var_name . '_month', 0);
|
||||
$year = request_var($var_name . '_year', 0);
|
||||
}
|
||||
|
||||
|
||||
$var = sprintf('%2d-%2d-%4d', $day, $month, $year);
|
||||
break;
|
||||
|
||||
@@ -931,7 +931,7 @@ class custom_profile_admin extends custom_profile
|
||||
|
||||
return $validate_options;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get string options for second step in ACP
|
||||
*/
|
||||
|
@@ -50,7 +50,7 @@ class template_compile
|
||||
{
|
||||
$this->template = &$template;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load template source from file
|
||||
* @access private
|
||||
@@ -74,7 +74,7 @@ class template_compile
|
||||
global $db, $user;
|
||||
|
||||
$sql_ary = array(
|
||||
'template_id' => $this->template->files_template[$handle],
|
||||
'template_id' => $user->theme['template_id'],
|
||||
'template_filename' => $this->template->filename[$handle],
|
||||
'template_included' => '',
|
||||
'template_mtime' => time(),
|
||||
@@ -223,12 +223,9 @@ class template_compile
|
||||
// There will be a number of occasions where we switch into and out of
|
||||
// PHP mode instantaneously. Rather than "burden" the parser with this
|
||||
// we'll strip out such occurences, minimising such switching
|
||||
if ($no_echo)
|
||||
{
|
||||
return "\$$echo_var .= '" . str_replace(' ?><?php ', ' ', $template_php) . "'";
|
||||
}
|
||||
$template_php = str_replace(' ?><?php ', ' ', $template_php);
|
||||
|
||||
return str_replace(' ?><?php ', ' ', $template_php);
|
||||
return (!$no_echo) ? $template_php : "\$$echo_var .= '" . $template_php . "'";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,19 +253,19 @@ class template_compile
|
||||
// transform vars prefixed by L_ into their language variable pendant if nothing is set within the tpldata array
|
||||
if (strpos($text_blocks, '{L_') !== false)
|
||||
{
|
||||
$text_blocks = preg_replace('#\{L_([A-Z0-9\-_]+)\}#', "<?php echo ((isset(\$this->_rootref['L_\\1'])) ? \$this->_rootref['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '{ \\1 }')); ?>", $text_blocks);
|
||||
$text_blocks = preg_replace('#\{L_([a-z0-9\-_]*)\}#is', "<?php echo ((isset(\$this->_rootref['L_\\1'])) ? \$this->_rootref['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '{ \\1 }')); ?>", $text_blocks);
|
||||
}
|
||||
|
||||
// Handle addslashed language variables prefixed with LA_
|
||||
// If a template variable already exist, it will be used in favor of it...
|
||||
if (strpos($text_blocks, '{LA_') !== false)
|
||||
{
|
||||
$text_blocks = preg_replace('#\{LA_([A-Z0-9\-_]+)\}#', "<?php echo ((isset(\$this->_rootref['LA_\\1'])) ? \$this->_rootref['LA_\\1'] : ((isset(\$this->_rootref['L_\\1'])) ? addslashes(\$this->_rootref['L_\\1']) : ((isset(\$user->lang['\\1'])) ? addslashes(\$user->lang['\\1']) : '{ \\1 }'))); ?>", $text_blocks);
|
||||
$text_blocks = preg_replace('#\{LA_([a-z0-9\-_]*)\}#is', "<?php echo ((isset(\$this->_rootref['LA_\\1'])) ? \$this->_rootref['LA_\\1'] : ((isset(\$this->_rootref['L_\\1'])) ? addslashes(\$this->_rootref['L_\\1']) : ((isset(\$user->lang['\\1'])) ? addslashes(\$user->lang['\\1']) : '{ \\1 }'))); ?>", $text_blocks);
|
||||
}
|
||||
|
||||
// Handle remaining varrefs
|
||||
$text_blocks = preg_replace('#\{([A-Z0-9\-_]+)\}#', "<?php echo (isset(\$this->_rootref['\\1'])) ? \$this->_rootref['\\1'] : ''; ?>", $text_blocks);
|
||||
$text_blocks = preg_replace('#\{\$([A-Z0-9\-_]+)\}#', "<?php echo (isset(\$this->_tpldata['DEFINE']['.']['\\1'])) ? \$this->_tpldata['DEFINE']['.']['\\1'] : ''; ?>", $text_blocks);
|
||||
$text_blocks = preg_replace('#\{([a-z0-9\-_]*)\}#is', "<?php echo (isset(\$this->_rootref['\\1'])) ? \$this->_rootref['\\1'] : ''; ?>", $text_blocks);
|
||||
$text_blocks = preg_replace('#\{\$([a-z0-9\-_]*)\}#is', "<?php echo (isset(\$this->_tpldata['DEFINE']['.']['\\1'])) ? \$this->_tpldata['DEFINE']['.']['\\1'] : ''; ?>", $text_blocks);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -518,20 +515,11 @@ class template_compile
|
||||
}
|
||||
$token = "sizeof($varref)";
|
||||
}
|
||||
else if (!empty($token))
|
||||
{
|
||||
$token = '(' . $token . ')';
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If there are no valid tokens left or only control/compare characters left, we do skip this statement
|
||||
if (!sizeof($tokens) || str_replace(array(' ', '=', '!', '<', '>', '&', '|', '%', '(', ')'), '', implode('', $tokens)) == '')
|
||||
{
|
||||
$tokens = array('false');
|
||||
}
|
||||
return (($elseif) ? '} else if (' : 'if (') . (implode(' ', $tokens) . ') { ');
|
||||
}
|
||||
|
||||
@@ -751,8 +739,6 @@ class template_compile
|
||||
|
||||
$filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . '.' . $phpEx;
|
||||
|
||||
$data = "<?php if (!defined('IN_PHPBB')) exit;" . ((strpos($data, '<?php') === 0) ? substr($data, 5) : ' ?>' . $data);
|
||||
|
||||
if ($fp = @fopen($filename, 'wb'))
|
||||
{
|
||||
@flock($fp, LOCK_EX);
|
||||
@@ -760,7 +746,7 @@ class template_compile
|
||||
@flock($fp, LOCK_UN);
|
||||
@fclose($fp);
|
||||
|
||||
phpbb_chmod($filename, CHMOD_READ | CHMOD_WRITE);
|
||||
@chmod($filename, 0666);
|
||||
}
|
||||
|
||||
return;
|
||||
|
@@ -206,7 +206,7 @@ class transfer
|
||||
$directory = $this->root_path . str_replace($phpbb_root_path, '', $directory);
|
||||
|
||||
$this->_chdir($directory);
|
||||
$result = $this->_ls();
|
||||
$result = $this->_ls('');
|
||||
|
||||
if ($result !== false && is_array($result))
|
||||
{
|
||||
@@ -460,24 +460,7 @@ class ftp extends transfer
|
||||
*/
|
||||
function _ls($dir = './')
|
||||
{
|
||||
$list = @ftp_nlist($this->connection, $dir);
|
||||
|
||||
// Remove path if prepended
|
||||
foreach ($list as $key => $item)
|
||||
{
|
||||
// Use same separator for item and dir
|
||||
$item = str_replace('\\', '/', $item);
|
||||
$dir = str_replace('\\', '/', $dir);
|
||||
|
||||
if (strpos($item, $dir) === 0)
|
||||
{
|
||||
$item = substr($item, strlen($dir));
|
||||
}
|
||||
|
||||
$list[$key] = $item;
|
||||
}
|
||||
|
||||
return $list;
|
||||
return @ftp_nlist($this->connection, $dir);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -727,24 +710,6 @@ class ftp_fsock extends transfer
|
||||
}
|
||||
$this->_close_data_connection();
|
||||
|
||||
// Clear buffer
|
||||
$this->_check_command();
|
||||
|
||||
// Remove path if prepended
|
||||
foreach ($list as $key => $item)
|
||||
{
|
||||
// Use same separator for item and dir
|
||||
$item = str_replace('\\', '/', $item);
|
||||
$dir = str_replace('\\', '/', $dir);
|
||||
|
||||
if (strpos($item, $dir) === 0)
|
||||
{
|
||||
$item = substr($item, strlen($dir));
|
||||
}
|
||||
|
||||
$list[$key] = $item;
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
@@ -121,9 +121,9 @@ class filespec
|
||||
case 'avatar':
|
||||
$this->extension = strtolower($this->extension);
|
||||
$this->realname = $prefix . $user_id . '.' . $this->extension;
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'unique_ext':
|
||||
default:
|
||||
$this->realname = $prefix . md5(unique_id()) . '.' . $this->extension;
|
||||
@@ -228,8 +228,8 @@ class filespec
|
||||
{
|
||||
return @filesize($filename);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Check the first 256 bytes for forbidden content
|
||||
*/
|
||||
@@ -239,7 +239,7 @@ class filespec
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
$fp = @fopen($this->filename, 'rb');
|
||||
|
||||
if ($fp !== false)
|
||||
@@ -263,11 +263,10 @@ class filespec
|
||||
*
|
||||
* @param string $destination_path Destination path, for example $config['avatar_path']
|
||||
* @param bool $overwrite If set to true, an already existing file will be overwritten
|
||||
* @param string $chmod Permission mask for chmodding the file after a successful move. The mode entered here reflects the mode defined by {@link phpbb_chmod()}
|
||||
*
|
||||
* @param octal $chmod Permission mask for chmodding the file after a successful move
|
||||
* @access public
|
||||
*/
|
||||
function move_file($destination, $overwrite = false, $skip_image_check = false, $chmod = false)
|
||||
function move_file($destination, $overwrite = false, $skip_image_check = false, $chmod = 0666)
|
||||
{
|
||||
global $user, $phpbb_root_path;
|
||||
|
||||
@@ -276,8 +275,6 @@ class filespec
|
||||
return false;
|
||||
}
|
||||
|
||||
$chmod = ($chmod === false) ? CHMOD_READ | CHMOD_WRITE : $chmod;
|
||||
|
||||
// We need to trust the admin in specifying valid upload directories and an attacker not being able to overwrite it...
|
||||
$this->destination_path = $phpbb_root_path . $destination;
|
||||
|
||||
@@ -348,7 +345,7 @@ class filespec
|
||||
break;
|
||||
}
|
||||
|
||||
phpbb_chmod($this->destination_file, $chmod);
|
||||
@chmod($this->destination_file, $chmod);
|
||||
}
|
||||
|
||||
// Try to get real filesize from destination folder
|
||||
@@ -419,7 +416,7 @@ class filespec
|
||||
{
|
||||
$size_lang = ($this->upload->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->upload->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES'] );
|
||||
$max_filesize = get_formatted_filesize($this->upload->max_filesize, false);
|
||||
|
||||
|
||||
$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang);
|
||||
|
||||
return false;
|
||||
@@ -531,7 +528,7 @@ class fileupload
|
||||
$this->max_filesize = (int) $max_filesize;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set disallowed strings
|
||||
*/
|
||||
@@ -594,18 +591,7 @@ class fileupload
|
||||
// PHP Upload filesize exceeded
|
||||
if ($file->get('filename') == 'none')
|
||||
{
|
||||
$max_filesize = @ini_get('upload_max_filesize');
|
||||
$unit = 'MB';
|
||||
|
||||
if (!empty($max_filesize))
|
||||
{
|
||||
$unit = strtolower(substr($max_filesize, -1, 1));
|
||||
$max_filesize = (int) $max_filesize;
|
||||
|
||||
$unit = ($unit == 'k') ? 'KB' : (($unit == 'g') ? 'GB' : 'MB');
|
||||
}
|
||||
|
||||
$file->error[] = (empty($max_filesize)) ? $user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf($user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], $max_filesize, $user->lang[$unit]);
|
||||
$file->error[] = (@ini_get('upload_max_filesize') == '') ? $user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf($user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], @ini_get('upload_max_filesize'));
|
||||
return $file;
|
||||
}
|
||||
|
||||
@@ -681,18 +667,7 @@ class fileupload
|
||||
// PHP Upload filesize exceeded
|
||||
if ($file->get('filename') == 'none')
|
||||
{
|
||||
$max_filesize = @ini_get('upload_max_filesize');
|
||||
$unit = 'MB';
|
||||
|
||||
if (!empty($max_filesize))
|
||||
{
|
||||
$unit = strtolower(substr($max_filesize, -1, 1));
|
||||
$max_filesize = (int) $max_filesize;
|
||||
|
||||
$unit = ($unit == 'k') ? 'KB' : (($unit == 'g') ? 'GB' : 'MB');
|
||||
}
|
||||
|
||||
$file->error[] = (empty($max_filesize)) ? $user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf($user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], $max_filesize, $user->lang[$unit]);
|
||||
$file->error[] = (@ini_get('upload_max_filesize') == '') ? $user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf($user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], @ini_get('upload_max_filesize'));
|
||||
return $file;
|
||||
}
|
||||
|
||||
@@ -840,18 +815,7 @@ class fileupload
|
||||
switch ($errorcode)
|
||||
{
|
||||
case 1:
|
||||
$max_filesize = @ini_get('upload_max_filesize');
|
||||
$unit = 'MB';
|
||||
|
||||
if (!empty($max_filesize))
|
||||
{
|
||||
$unit = strtolower(substr($max_filesize, -1, 1));
|
||||
$max_filesize = (int) $max_filesize;
|
||||
|
||||
$unit = ($unit == 'k') ? 'KB' : (($unit == 'g') ? 'GB' : 'MB');
|
||||
}
|
||||
|
||||
$error = (empty($max_filesize)) ? $user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf($user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], $max_filesize, $user->lang[$unit]);
|
||||
$error = (@ini_get('upload_max_filesize') == '') ? $user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf($user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], @ini_get('upload_max_filesize'));
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@@ -908,7 +872,7 @@ class fileupload
|
||||
{
|
||||
$file->error[] = sprintf($user->lang[$this->error_prefix . 'DISALLOWED_EXTENSION'], $file->get('extension'));
|
||||
}
|
||||
|
||||
|
||||
// MIME Sniffing
|
||||
if (!$this->valid_content($file))
|
||||
{
|
||||
|
@@ -147,7 +147,7 @@ function user_update_name($old_name, $new_name)
|
||||
*
|
||||
* @param mixed $user_row An array containing the following keys (and the appropriate values): username, group_id (the group to place the user in), user_email and the user_type(usually 0). Additional entries not overridden by defaults will be forwarded.
|
||||
* @param string $cp_data custom profile fields, see custom_profile::build_insert_sql_array
|
||||
* @return the new user's ID.
|
||||
* @return: the new user's ID.
|
||||
*/
|
||||
function user_add($user_row, $cp_data = false)
|
||||
{
|
||||
@@ -280,7 +280,7 @@ function user_add($user_row, $cp_data = false)
|
||||
{
|
||||
set_config('newest_user_id', $user_id, true);
|
||||
set_config('newest_username', $user_row['username'], true);
|
||||
set_config_count('num_users', 1, true);
|
||||
set_config('num_users', $config['num_users'] + 1, true);
|
||||
|
||||
$sql = 'SELECT group_colour
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
@@ -315,6 +315,8 @@ function user_delete($mode, $user_id, $post_username = false)
|
||||
return false;
|
||||
}
|
||||
|
||||
$db->sql_transaction('begin');
|
||||
|
||||
// Before we begin, we will remove the reports the user issued.
|
||||
$sql = 'SELECT r.post_id, p.topic_id
|
||||
FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p
|
||||
@@ -383,8 +385,6 @@ function user_delete($mode, $user_id, $post_username = false)
|
||||
{
|
||||
case 'retain':
|
||||
|
||||
$db->sql_transaction('begin');
|
||||
|
||||
if ($post_username === false)
|
||||
{
|
||||
$post_username = $user->lang['GUEST'];
|
||||
@@ -432,9 +432,6 @@ function user_delete($mode, $user_id, $post_username = false)
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
$db->sql_transaction('commit');
|
||||
|
||||
break;
|
||||
|
||||
case 'remove':
|
||||
@@ -488,9 +485,7 @@ function user_delete($mode, $user_id, $post_username = false)
|
||||
break;
|
||||
}
|
||||
|
||||
$db->sql_transaction('begin');
|
||||
|
||||
$table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE);
|
||||
$table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE);
|
||||
|
||||
foreach ($table_ary as $table)
|
||||
{
|
||||
@@ -501,16 +496,6 @@ function user_delete($mode, $user_id, $post_username = false)
|
||||
|
||||
$cache->destroy('sql', MODERATOR_CACHE_TABLE);
|
||||
|
||||
// Delete the user_id from the banlist
|
||||
$sql = 'DELETE FROM ' . BANLIST_TABLE . '
|
||||
WHERE ban_userid = ' . $user_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Delete the user_id from the session table
|
||||
$sql = 'DELETE FROM ' . SESSIONS_TABLE . '
|
||||
WHERE session_user_id = ' . $user_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Remove any undelivered mails...
|
||||
$sql = 'SELECT msg_id, user_id
|
||||
FROM ' . PRIVMSGS_TO_TABLE . '
|
||||
@@ -568,8 +553,6 @@ function user_delete($mode, $user_id, $post_username = false)
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
$db->sql_transaction('commit');
|
||||
|
||||
// Reset newest user info if appropriate
|
||||
if ($config['newest_user_id'] == $user_id)
|
||||
{
|
||||
@@ -579,9 +562,11 @@ function user_delete($mode, $user_id, $post_username = false)
|
||||
// Decrement number of users if this user is active
|
||||
if ($user_row['user_type'] != USER_INACTIVE && $user_row['user_type'] != USER_IGNORE)
|
||||
{
|
||||
set_config_count('num_users', -1, true);
|
||||
set_config('num_users', $config['num_users'] - 1, true);
|
||||
}
|
||||
|
||||
$db->sql_transaction('commit');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -660,12 +645,12 @@ function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)
|
||||
|
||||
if ($deactivated)
|
||||
{
|
||||
set_config_count('num_users', $deactivated * (-1), true);
|
||||
set_config('num_users', $config['num_users'] - $deactivated, true);
|
||||
}
|
||||
|
||||
if ($activated)
|
||||
{
|
||||
set_config_count('num_users', $activated, true);
|
||||
set_config('num_users', $config['num_users'] + $activated, true);
|
||||
}
|
||||
|
||||
// Update latest username
|
||||
@@ -749,65 +734,70 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
case 'user':
|
||||
$type = 'ban_userid';
|
||||
|
||||
// At the moment we do not support wildcard username banning
|
||||
|
||||
// Select the relevant user_ids.
|
||||
$sql_usernames = array();
|
||||
|
||||
foreach ($ban_list as $username)
|
||||
if (in_array('*', $ban_list))
|
||||
{
|
||||
$username = trim($username);
|
||||
if ($username != '')
|
||||
{
|
||||
$clean_name = utf8_clean_string($username);
|
||||
if ($clean_name == $user->data['username_clean'])
|
||||
{
|
||||
trigger_error('CANNOT_BAN_YOURSELF', E_USER_WARNING);
|
||||
}
|
||||
if (in_array($clean_name, $founder_names))
|
||||
{
|
||||
trigger_error('CANNOT_BAN_FOUNDER', E_USER_WARNING);
|
||||
}
|
||||
$sql_usernames[] = $clean_name;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure we have been given someone to ban
|
||||
if (!sizeof($sql_usernames))
|
||||
{
|
||||
trigger_error('NO_USER_SPECIFIED');
|
||||
}
|
||||
|
||||
$sql = 'SELECT user_id
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('username_clean', $sql_usernames);
|
||||
|
||||
// Do not allow banning yourself
|
||||
if (sizeof($founder))
|
||||
{
|
||||
$sql .= ' AND ' . $db->sql_in_set('user_id', array_merge(array_keys($founder), array($user->data['user_id'])), true);
|
||||
// Ban all users (it's a good thing that you can exclude people)
|
||||
$banlist_ary[] = '*';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql .= ' AND user_id <> ' . $user->data['user_id'];
|
||||
}
|
||||
// Select the relevant user_ids.
|
||||
$sql_usernames = array();
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
foreach ($ban_list as $username)
|
||||
{
|
||||
$banlist_ary[] = (int) $row['user_id'];
|
||||
$username = trim($username);
|
||||
if ($username != '')
|
||||
{
|
||||
$clean_name = utf8_clean_string($username);
|
||||
if ($clean_name == $user->data['username_clean'])
|
||||
{
|
||||
trigger_error('CANNOT_BAN_YOURSELF', E_USER_WARNING);
|
||||
}
|
||||
if (in_array($clean_name, $founder_names))
|
||||
{
|
||||
trigger_error('CANNOT_BAN_FOUNDER', E_USER_WARNING);
|
||||
}
|
||||
$sql_usernames[] = $clean_name;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure we have been given someone to ban
|
||||
if (!sizeof($sql_usernames))
|
||||
{
|
||||
trigger_error('NO_USER_SPECIFIED');
|
||||
}
|
||||
|
||||
$sql = 'SELECT user_id
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('username_clean', $sql_usernames);
|
||||
|
||||
// Do not allow banning yourself
|
||||
if (sizeof($founder))
|
||||
{
|
||||
$sql .= ' AND ' . $db->sql_in_set('user_id', array_merge(array_keys($founder), array($user->data['user_id'])), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql .= ' AND user_id <> ' . $user->data['user_id'];
|
||||
}
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$banlist_ary[] = (int) $row['user_id'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error('NO_USERS');
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->sql_freeresult($result);
|
||||
trigger_error('NO_USERS');
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
@@ -949,7 +939,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
$sql = "SELECT $type
|
||||
FROM " . BANLIST_TABLE . "
|
||||
WHERE $sql_where
|
||||
AND ban_exclude = " . (int) $ban_exclude;
|
||||
AND ban_exclude = $ban_exclude";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
// Reset $sql_where, because we use it later...
|
||||
@@ -1007,7 +997,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
switch ($mode)
|
||||
{
|
||||
case 'user':
|
||||
$sql_where = 'WHERE ' . $db->sql_in_set('session_user_id', $banlist_ary);
|
||||
$sql_where = (in_array('*', $banlist_ary)) ? '' : 'WHERE ' . $db->sql_in_set('session_user_id', $banlist_ary);
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
@@ -1144,8 +1134,6 @@ function user_unban($mode, $ban)
|
||||
|
||||
/**
|
||||
* Whois facility
|
||||
*
|
||||
* @link http://tools.ietf.org/html/rfc3912 RFC3912: WHOIS Protocol Specification
|
||||
*/
|
||||
function user_ipwhois($ip)
|
||||
{
|
||||
@@ -1158,10 +1146,16 @@ function user_ipwhois($ip)
|
||||
return '';
|
||||
}
|
||||
|
||||
$match = array(
|
||||
'#RIPE\.NET#is' => 'whois.ripe.net',
|
||||
'#whois\.apnic\.net#is' => 'whois.apnic.net',
|
||||
'#nic\.ad\.jp#is' => 'whois.nic.ad.jp',
|
||||
'#whois\.registro\.br#is' => 'whois.registro.br'
|
||||
);
|
||||
|
||||
if (($fsk = @fsockopen('whois.arin.net', 43)))
|
||||
{
|
||||
// CRLF as per RFC3912
|
||||
fputs($fsk, "$ip\r\n");
|
||||
fputs($fsk, "$ip\n");
|
||||
while (!feof($fsk))
|
||||
{
|
||||
$ipwhois .= fgets($fsk, 1024);
|
||||
@@ -1169,38 +1163,22 @@ function user_ipwhois($ip)
|
||||
@fclose($fsk);
|
||||
}
|
||||
|
||||
$match = array();
|
||||
|
||||
// Test for referrals from ARIN to other whois databases, roll on rwhois
|
||||
if (preg_match('#ReferralServer: whois://(.+)#im', $ipwhois, $match))
|
||||
foreach (array_keys($match) as $server)
|
||||
{
|
||||
if (strpos($match[1], ':') !== false)
|
||||
if (preg_match($server, $ipwhois))
|
||||
{
|
||||
$pos = strrpos($match[1], ':');
|
||||
$server = substr($match[1], 0, $pos);
|
||||
$port = (int) substr($match[1], $pos + 1);
|
||||
unset($pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
$server = $match[1];
|
||||
$port = 43;
|
||||
}
|
||||
|
||||
$buffer = '';
|
||||
|
||||
if (($fsk = @fsockopen($server, $port)))
|
||||
{
|
||||
fputs($fsk, "$ip\r\n");
|
||||
while (!feof($fsk))
|
||||
$ipwhois = '';
|
||||
if (($fsk = @fsockopen($match[$server], 43)))
|
||||
{
|
||||
$buffer .= fgets($fsk, 1024);
|
||||
fputs($fsk, "$ip\n");
|
||||
while (!feof($fsk))
|
||||
{
|
||||
$ipwhois .= fgets($fsk, 1024);
|
||||
}
|
||||
@fclose($fsk);
|
||||
}
|
||||
@fclose($fsk);
|
||||
break;
|
||||
}
|
||||
|
||||
// Use the result from ARIN if we don't get any result here
|
||||
$ipwhois = (empty($buffer)) ? $ipwhois : $buffer;
|
||||
}
|
||||
|
||||
$ipwhois = htmlspecialchars($ipwhois);
|
||||
@@ -1436,7 +1414,7 @@ function validate_username($username, $allowed_username = false)
|
||||
}
|
||||
else if ($mbstring)
|
||||
{
|
||||
$regex = '[-\]_+ \[[:upper:][:lower:][:digit:]]+';
|
||||
$regex = '[-\]_+ [[:upper:][:lower:][:digit:]]+';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1461,7 +1439,8 @@ function validate_username($username, $allowed_username = false)
|
||||
}
|
||||
else if ($mbstring)
|
||||
{
|
||||
mb_ereg_search_init($username, '^' . $regex . '$');
|
||||
$matches = array();
|
||||
mb_ereg_search_init('^' . $username . '$', $regex, $matches);
|
||||
if (!mb_ereg_search())
|
||||
{
|
||||
return 'INVALID_CHARS';
|
||||
@@ -2323,29 +2302,22 @@ function avatar_process_user(&$error, $custom_userdata = false)
|
||||
// Do we actually have any data to update?
|
||||
if (sizeof($sql_ary))
|
||||
{
|
||||
$ext_new = $ext_old = '';
|
||||
if (isset($sql_ary['user_avatar']))
|
||||
{
|
||||
$userdata = ($custom_userdata === false) ? $user->data : $custom_userdata;
|
||||
$ext_new = (empty($sql_ary['user_avatar'])) ? '' : substr(strrchr($sql_ary['user_avatar'], '.'), 1);
|
||||
$ext_old = (empty($userdata['user_avatar'])) ? '' : substr(strrchr($userdata['user_avatar'], '.'), 1);
|
||||
|
||||
if ($userdata['user_avatar_type'] == AVATAR_UPLOAD)
|
||||
{
|
||||
// Delete old avatar if present
|
||||
if ((!empty($userdata['user_avatar']) && empty($sql_ary['user_avatar']))
|
||||
|| ( !empty($userdata['user_avatar']) && !empty($sql_ary['user_avatar']) && $ext_new !== $ext_old))
|
||||
{
|
||||
avatar_delete('user', $userdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
WHERE user_id = ' . (($custom_userdata === false) ? $user->data['user_id'] : $custom_userdata['user_id']);
|
||||
$db->sql_query($sql);
|
||||
|
||||
if (isset($sql_ary['user_avatar']))
|
||||
{
|
||||
$userdata = ($custom_userdata === false) ? $user->data : $custom_userdata;
|
||||
|
||||
// Delete old avatar if present
|
||||
if ((!empty($userdata['user_avatar']) && empty($sql_ary['user_avatar']) && $userdata['user_avatar_type'] == AVATAR_UPLOAD)
|
||||
|| ( !empty($userdata['user_avatar']) && !empty($sql_ary['user_avatar']) && $userdata['user_avatar_type'] == AVATAR_UPLOAD && $sql_ary['user_avatar_type'] != AVATAR_UPLOAD))
|
||||
{
|
||||
avatar_delete('user', $userdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2376,13 +2348,12 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
|
||||
'group_receive_pm' => 'int',
|
||||
'group_legend' => 'int',
|
||||
'group_message_limit' => 'int',
|
||||
'group_max_recipients' => 'int',
|
||||
|
||||
'group_founder_manage' => 'int',
|
||||
);
|
||||
|
||||
// Those are group-only attributes
|
||||
$group_only_ary = array('group_receive_pm', 'group_legend', 'group_message_limit', 'group_max_recipients', 'group_founder_manage');
|
||||
$group_only_ary = array('group_receive_pm', 'group_legend', 'group_message_limit', 'group_founder_manage');
|
||||
|
||||
// Check data. Limit group name length.
|
||||
if (!utf8_strlen($name) || utf8_strlen($name) > 60)
|
||||
@@ -2734,16 +2705,9 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
|
||||
*/
|
||||
function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false)
|
||||
{
|
||||
global $db, $auth, $config;
|
||||
global $db, $auth;
|
||||
|
||||
if ($config['coppa_enable'])
|
||||
{
|
||||
$group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'REGISTERED_COPPA', 'REGISTERED', 'BOTS', 'GUESTS');
|
||||
}
|
||||
else
|
||||
{
|
||||
$group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'REGISTERED', 'BOTS', 'GUESTS');
|
||||
}
|
||||
$group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'REGISTERED_COPPA', 'REGISTERED', 'BOTS', 'GUESTS');
|
||||
|
||||
// We need both username and user_id info
|
||||
$result = user_get_id_name($user_id_ary, $username_ary);
|
||||
@@ -2807,14 +2771,13 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false,
|
||||
$temp_ary = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if ($default_groups[$row['user_id']] == $group_id && (!isset($temp_ary[$row['user_id']]) || $group_order_id[$row['group_name']] < $temp_ary[$row['user_id']]))
|
||||
if ($default_groups[$row['user_id']] == $group_id && (!isset($temp_ary[$row['user_id']]) || array_search($row['group_name'], $group_order) < $temp_ary[$row['user_id']]))
|
||||
{
|
||||
$temp_ary[$row['user_id']] = $row['group_id'];
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// sql_where_ary holds the new default groups and their users
|
||||
$sql_where_ary = array();
|
||||
foreach ($temp_ary as $uid => $gid)
|
||||
{
|
||||
@@ -2826,7 +2789,7 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false,
|
||||
{
|
||||
if (isset($sql_where_ary[$gid]) && sizeof($sql_where_ary[$gid]))
|
||||
{
|
||||
remove_default_rank($gid, $sql_where_ary[$gid]);
|
||||
remove_default_rank($group_id, $sql_where_ary[$gid]);
|
||||
remove_default_avatar($group_id, $sql_where_ary[$gid]);
|
||||
group_set_user_default($gid, $sql_where_ary[$gid], $default_data_ary);
|
||||
}
|
||||
@@ -2960,7 +2923,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
|
||||
{
|
||||
case 'demote':
|
||||
case 'promote':
|
||||
|
||||
|
||||
$sql = 'SELECT user_id FROM ' . USER_GROUP_TABLE . "
|
||||
WHERE group_id = $group_id
|
||||
AND user_pending = 1
|
||||
@@ -2972,7 +2935,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
|
||||
{
|
||||
return 'NO_VALID_USERS';
|
||||
}
|
||||
|
||||
|
||||
$sql = 'UPDATE ' . USER_GROUP_TABLE . '
|
||||
SET group_leader = ' . (($action == 'promote') ? 1 : 0) . "
|
||||
WHERE group_id = $group_id
|
||||
@@ -3122,7 +3085,7 @@ function group_validate_groupname($group_id, $group_name)
|
||||
/**
|
||||
* Set users default group
|
||||
*
|
||||
* @access private
|
||||
* @private
|
||||
*/
|
||||
function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false)
|
||||
{
|
||||
|
@@ -246,7 +246,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
|
||||
'LAST_POST_SUBJECT' => $row['topic_last_post_subject'],
|
||||
'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
|
||||
|
||||
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && empty($row['topic_moved_id']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false,
|
||||
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false,
|
||||
'S_TOPIC_UNAPPROVED' => $topic_unapproved,
|
||||
'S_POSTS_UNAPPROVED' => $posts_unapproved,
|
||||
'S_UNREAD_TOPIC' => $unread_topic,
|
||||
|
@@ -27,7 +27,7 @@ function mcp_front_view($id, $mode, $action)
|
||||
// Latest 5 unapproved
|
||||
if ($module->loaded('queue'))
|
||||
{
|
||||
$forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_approve')));
|
||||
$forum_list = get_forum_list('m_approve');
|
||||
$post_list = array();
|
||||
$forum_names = array();
|
||||
|
||||
@@ -81,7 +81,7 @@ function mcp_front_view($id, $mode, $action)
|
||||
|
||||
if ($total)
|
||||
{
|
||||
$sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.username, u.username_clean, u.user_colour, t.topic_id, t.topic_title, t.topic_first_post_id, p.forum_id
|
||||
$sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.username, u.username_clean, t.topic_id, t.topic_title, t.topic_first_post_id, p.forum_id
|
||||
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u
|
||||
WHERE ' . $db->sql_in_set('p.post_id', $post_list) . '
|
||||
AND t.topic_id = p.topic_id
|
||||
@@ -103,15 +103,12 @@ function mcp_front_view($id, $mode, $action)
|
||||
'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=topic_view&f=' . $row['forum_id'] . '&t=' . $row['topic_id']),
|
||||
'U_FORUM' => (!$global_topic) ? 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']),
|
||||
|
||||
'AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour']),
|
||||
'AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour']),
|
||||
'AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour']),
|
||||
'U_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour']),
|
||||
'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['poster_id']),
|
||||
|
||||
'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'],
|
||||
'POST_ID' => $row['post_id'],
|
||||
'TOPIC_TITLE' => $row['topic_title'],
|
||||
'AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? (($row['post_username']) ? $row['post_username'] : $user->lang['GUEST']) : $row['username'],
|
||||
'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
|
||||
'POST_TIME' => $user->format_date($row['post_time']))
|
||||
);
|
||||
@@ -143,7 +140,7 @@ function mcp_front_view($id, $mode, $action)
|
||||
// Latest 5 reported
|
||||
if ($module->loaded('reports'))
|
||||
{
|
||||
$forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_report')));
|
||||
$forum_list = get_forum_list('m_report');
|
||||
|
||||
$template->assign_var('S_SHOW_REPORTS', (!empty($forum_list)) ? true : false);
|
||||
|
||||
@@ -246,7 +243,7 @@ function mcp_front_view($id, $mode, $action)
|
||||
// Latest 5 logs
|
||||
if ($module->loaded('logs'))
|
||||
{
|
||||
$forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_')));
|
||||
$forum_list = get_forum_list('m_');
|
||||
|
||||
if (!empty($forum_list))
|
||||
{
|
||||
|
@@ -63,7 +63,7 @@ class mcp_logs
|
||||
$this->tpl_name = 'mcp_logs';
|
||||
$this->page_title = 'MCP_LOGS';
|
||||
|
||||
$forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_')));
|
||||
$forum_list = get_forum_list('m_');
|
||||
$forum_list[] = 0;
|
||||
|
||||
$forum_id = $topic_id = 0;
|
||||
|
@@ -594,67 +594,44 @@ function mcp_move_topic($topic_ids)
|
||||
$topic_data = get_topic_data($topic_ids);
|
||||
$leave_shadow = (isset($_POST['move_leave_shadow'])) ? true : false;
|
||||
|
||||
$topics_moved = sizeof($topic_ids);
|
||||
$topics_authed_moved = 0;
|
||||
$forum_sync_data = array();
|
||||
|
||||
$forum_sync_data[$forum_id] = current($topic_data);
|
||||
$forum_sync_data[$to_forum_id] = $forum_data;
|
||||
|
||||
// Real topics added to target forum
|
||||
$topics_moved = sizeof($topic_data);
|
||||
|
||||
// Approved topics added to target forum
|
||||
$topics_authed_moved = 0;
|
||||
|
||||
// Posts (topic replies + topic post if approved) added to target forum
|
||||
$topic_posts_added = 0;
|
||||
|
||||
// Posts (topic replies + topic post if approved and not global announcement) removed from source forum
|
||||
$topic_posts_removed = 0;
|
||||
|
||||
// Real topics removed from source forum (all topics without global announcements)
|
||||
$topics_removed = 0;
|
||||
|
||||
// Approved topics removed from source forum (except global announcements)
|
||||
$topics_authed_removed = 0;
|
||||
|
||||
foreach ($topic_data as $topic_id => $topic_info)
|
||||
{
|
||||
if ($topic_info['topic_approved'])
|
||||
if ($topic_info['topic_approved'] == '1')
|
||||
{
|
||||
$topics_authed_moved++;
|
||||
$topic_posts_added++;
|
||||
}
|
||||
|
||||
$topic_posts_added += $topic_info['topic_replies'];
|
||||
|
||||
if ($topic_info['topic_type'] != POST_GLOBAL)
|
||||
{
|
||||
$topics_removed++;
|
||||
$topic_posts_removed += $topic_info['topic_replies'];
|
||||
|
||||
if ($topic_info['topic_approved'])
|
||||
{
|
||||
$topics_authed_removed++;
|
||||
$topic_posts_removed++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$db->sql_transaction('begin');
|
||||
|
||||
$sql = 'SELECT SUM(t.topic_replies + t.topic_approved) as topic_posts
|
||||
FROM ' . TOPICS_TABLE . ' t
|
||||
WHERE ' . $db->sql_in_set('t.topic_id', $topic_ids);
|
||||
$result = $db->sql_query($sql);
|
||||
$row_data = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sync_sql = array();
|
||||
|
||||
if ($topic_posts_added)
|
||||
if ($row_data['topic_posts'])
|
||||
{
|
||||
$sync_sql[$to_forum_id][] = 'forum_posts = forum_posts + ' . $topic_posts_added;
|
||||
$sync_sql[$forum_id][] = 'forum_posts = forum_posts - ' . (int) $row_data['topic_posts'];
|
||||
$sync_sql[$to_forum_id][] = 'forum_posts = forum_posts + ' . (int) $row_data['topic_posts'];
|
||||
}
|
||||
|
||||
if ($topics_authed_moved)
|
||||
{
|
||||
$sync_sql[$to_forum_id][] = 'forum_topics = forum_topics + ' . (int) $topics_authed_moved;
|
||||
$sync_sql[$to_forum_id][] = 'forum_topics = forum_topics + ' . (int) $topics_authed_moved;
|
||||
}
|
||||
|
||||
$sync_sql[$to_forum_id][] = 'forum_topics_real = forum_topics_real + ' . (int) $topics_moved;
|
||||
$sync_sql[$to_forum_id][] = 'forum_topics_real = forum_topics_real + ' . (int) $topics_moved;
|
||||
|
||||
// Move topics, but do not resync yet
|
||||
move_topics($topic_ids, $to_forum_id, false);
|
||||
@@ -664,7 +641,7 @@ function mcp_move_topic($topic_ids)
|
||||
{
|
||||
// Get the list of forums to resync, add a log entry
|
||||
$forum_ids[] = $row['forum_id'];
|
||||
add_log('mod', $to_forum_id, $topic_id, 'LOG_MOVE', $row['forum_name'], $forum_data['forum_name']);
|
||||
add_log('mod', $to_forum_id, $topic_id, 'LOG_MOVE', $row['forum_name']);
|
||||
|
||||
// If we have moved a global announcement, we need to correct the topic type
|
||||
if ($row['topic_type'] == POST_GLOBAL)
|
||||
@@ -682,8 +659,8 @@ function mcp_move_topic($topic_ids)
|
||||
'forum_id' => (int) $row['forum_id'],
|
||||
'icon_id' => (int) $row['icon_id'],
|
||||
'topic_attachment' => (int) $row['topic_attachment'],
|
||||
'topic_approved' => 1, // a shadow topic is always approved
|
||||
'topic_reported' => 0, // a shadow topic is never reported
|
||||
'topic_approved' => 1,
|
||||
'topic_reported' => (int) $row['topic_reported'],
|
||||
'topic_title' => (string) $row['topic_title'],
|
||||
'topic_poster' => (int) $row['topic_poster'],
|
||||
'topic_time' => (int) $row['topic_time'],
|
||||
@@ -715,26 +692,17 @@ function mcp_move_topic($topic_ids)
|
||||
|
||||
$db->sql_query('INSERT INTO ' . TOPICS_TABLE . $db->sql_build_array('INSERT', $shadow));
|
||||
|
||||
// Shadow topics only count on new "topics" and not posts... a shadow topic alone has 0 posts
|
||||
$topics_removed--;
|
||||
$topics_authed_removed--;
|
||||
$topics_authed_moved--;
|
||||
$topics_moved--;
|
||||
}
|
||||
}
|
||||
unset($topic_data);
|
||||
|
||||
if ($topic_posts_removed)
|
||||
{
|
||||
$sync_sql[$forum_id][] = 'forum_posts = forum_posts - ' . $topic_posts_removed;
|
||||
}
|
||||
$sync_sql[$forum_id][] = 'forum_topics_real = forum_topics_real - ' . (int) $topics_moved;
|
||||
|
||||
if ($topics_removed)
|
||||
if ($topics_authed_moved)
|
||||
{
|
||||
$sync_sql[$forum_id][] = 'forum_topics_real = forum_topics_real - ' . (int) $topics_removed;
|
||||
}
|
||||
|
||||
if ($topics_authed_removed)
|
||||
{
|
||||
$sync_sql[$forum_id][] = 'forum_topics = forum_topics - ' . (int) $topics_authed_removed;
|
||||
$sync_sql[$forum_id][] = 'forum_topics = forum_topics - ' . (int) $topics_authed_moved;
|
||||
}
|
||||
|
||||
$success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_MOVED_SUCCESS' : 'TOPICS_MOVED_SUCCESS';
|
||||
@@ -813,7 +781,7 @@ function mcp_delete_topic($topic_ids)
|
||||
|
||||
foreach ($data as $topic_id => $row)
|
||||
{
|
||||
add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_' . ($row['topic_moved_id'] ? 'SHADOW_' : '') . 'TOPIC', $row['topic_title']);
|
||||
add_log('mod', $row['forum_id'], 0, 'LOG_TOPIC_DELETED', $row['topic_title']);
|
||||
}
|
||||
|
||||
$return = delete_topics('topic_id', $topic_ids);
|
||||
@@ -823,17 +791,8 @@ function mcp_delete_topic($topic_ids)
|
||||
confirm_box(false, (sizeof($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS', $s_hidden_fields);
|
||||
}
|
||||
|
||||
if (!isset($_REQUEST['quickmod']))
|
||||
{
|
||||
$redirect = request_var('redirect', "index.$phpEx");
|
||||
$redirect = reapply_sid($redirect);
|
||||
$redirect_message = 'PAGE';
|
||||
}
|
||||
else
|
||||
{
|
||||
$redirect = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
|
||||
$redirect_message = 'FORUM';
|
||||
}
|
||||
$redirect = request_var('redirect', "index.$phpEx");
|
||||
$redirect = reapply_sid($redirect);
|
||||
|
||||
if (!$success_msg)
|
||||
{
|
||||
@@ -841,8 +800,9 @@ function mcp_delete_topic($topic_ids)
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_refresh(3, $redirect);
|
||||
trigger_error($user->lang[$success_msg] . '<br /><br />' . sprintf($user->lang['RETURN_' . $redirect_message], '<a href="' . $redirect . '">', '</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>'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -961,11 +921,6 @@ function mcp_delete_post($post_ids)
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($affected_topics != 1 || $deleted_topics || !$topic_id)
|
||||
{
|
||||
$redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&i=main&mode=forum_view", false);
|
||||
}
|
||||
|
||||
meta_refresh(3, $redirect);
|
||||
trigger_error($success_msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>') . '<br /><br />' . implode('<br /><br />', $return_link));
|
||||
}
|
||||
@@ -1226,8 +1181,8 @@ function mcp_fork_topic($topic_ids)
|
||||
}
|
||||
|
||||
sync('forum', 'forum_id', $to_forum_id);
|
||||
set_config_count('num_topics', sizeof($new_topic_id_list), true);
|
||||
set_config_count('num_posts', $total_posts, true);
|
||||
set_config('num_topics', $config['num_topics'] + sizeof($new_topic_id_list), true);
|
||||
set_config('num_posts', $config['num_posts'] + $total_posts, true);
|
||||
|
||||
foreach ($new_topic_id_list as $topic_id => $new_topic_id)
|
||||
{
|
||||
|
@@ -226,16 +226,13 @@ class mcp_notes
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&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,
|
||||
|
||||
'USERNAME_FULL' => get_username_string('full', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),
|
||||
'USERNAME_COLOUR' => get_username_string('colour', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),
|
||||
'USERNAME' => get_username_string('username', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),
|
||||
'U_PROFILE' => get_username_string('profile', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),
|
||||
|
||||
'AVATAR_IMG' => $avatar_img,
|
||||
'RANK_IMG' => $rank_img,
|
||||
)
|
||||
|
@@ -415,8 +415,8 @@ function change_poster(&$post_info, $userdata)
|
||||
sync('forum', 'forum_id', $post_info['forum_id'], false, false);
|
||||
}
|
||||
|
||||
// Adjust post counts... only if the post is approved (else, it was not added the users post count anyway)
|
||||
if ($post_info['post_postcount'] && $post_info['post_approved'])
|
||||
// Adjust post counts
|
||||
if ($post_info['post_postcount'])
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET user_posts = user_posts - 1
|
||||
@@ -470,11 +470,11 @@ function change_poster(&$post_info, $userdata)
|
||||
if (file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
|
||||
{
|
||||
require("{$phpbb_root_path}includes/search/$search_type.$phpEx");
|
||||
|
||||
|
||||
// We do some additional checks in the module to ensure it can actually be utilised
|
||||
$error = false;
|
||||
$search = new $search_type($error);
|
||||
|
||||
|
||||
if (!$error && method_exists($search, 'destroy_cache'))
|
||||
{
|
||||
$search->destroy_cache(array(), array($post_info['user_id'], $userdata['user_id']));
|
||||
|
@@ -242,17 +242,6 @@ class mcp_queue
|
||||
}
|
||||
|
||||
$forum_list_approve = get_forum_list('m_approve', false, true);
|
||||
$forum_list_read = array_flip(get_forum_list('f_read', true, true)); // Flipped so we can isset() the forum IDs
|
||||
|
||||
// Remove forums we cannot read
|
||||
foreach ($forum_list_approve as $k => $forum_data)
|
||||
{
|
||||
if (!isset($forum_list_read[$forum_data['forum_id']]))
|
||||
{
|
||||
unset($forum_list_approve[$k]);
|
||||
}
|
||||
}
|
||||
unset($forum_list_read);
|
||||
|
||||
if (!$forum_id)
|
||||
{
|
||||
@@ -492,18 +481,11 @@ function approve_post($post_id_list, $id, $mode)
|
||||
|
||||
$total_topics = $total_posts = 0;
|
||||
$forum_topics_posts = $topic_approve_sql = $topic_replies_sql = $post_approve_sql = $topic_id_list = $forum_id_list = $approve_log = array();
|
||||
$user_posts_sql = $post_approved_list = array();
|
||||
|
||||
$update_forum_information = false;
|
||||
|
||||
foreach ($post_info as $post_id => $post_data)
|
||||
{
|
||||
if ($post_data['post_approved'])
|
||||
{
|
||||
$post_approved_list[] = $post_id;
|
||||
continue;
|
||||
}
|
||||
|
||||
$topic_id_list[$post_data['topic_id']] = 1;
|
||||
|
||||
if ($post_data['forum_id'])
|
||||
@@ -511,13 +493,6 @@ function approve_post($post_id_list, $id, $mode)
|
||||
$forum_id_list[$post_data['forum_id']] = 1;
|
||||
}
|
||||
|
||||
// User post update (we do not care about topic or post, since user posts are strictly connected to posts)
|
||||
// But we care about forums where post counts get not increased. ;)
|
||||
if ($post_data['post_postcount'])
|
||||
{
|
||||
$user_posts_sql[$post_data['poster_id']] = (empty($user_posts_sql[$post_data['poster_id']])) ? 1 : $user_posts_sql[$post_data['poster_id']] + 1;
|
||||
}
|
||||
|
||||
// Topic or Post. ;)
|
||||
if ($post_data['topic_first_post_id'] == $post_id)
|
||||
{
|
||||
@@ -545,6 +520,12 @@ function approve_post($post_id_list, $id, $mode)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isset($topic_replies_sql[$post_data['topic_id']]))
|
||||
{
|
||||
$topic_replies_sql[$post_data['topic_id']] = 0;
|
||||
}
|
||||
$topic_replies_sql[$post_data['topic_id']]++;
|
||||
|
||||
$approve_log[] = array(
|
||||
'type' => 'post',
|
||||
'post_subject' => $post_data['post_subject'],
|
||||
@@ -553,15 +534,6 @@ function approve_post($post_id_list, $id, $mode)
|
||||
);
|
||||
}
|
||||
|
||||
if ($post_data['topic_replies_real'] > 0)
|
||||
{
|
||||
if (!isset($topic_replies_sql[$post_data['topic_id']]))
|
||||
{
|
||||
$topic_replies_sql[$post_data['topic_id']] = 0;
|
||||
}
|
||||
$topic_replies_sql[$post_data['topic_id']]++;
|
||||
}
|
||||
|
||||
if ($post_data['forum_id'])
|
||||
{
|
||||
if (!isset($forum_topics_posts[$post_data['forum_id']]))
|
||||
@@ -592,11 +564,6 @@ function approve_post($post_id_list, $id, $mode)
|
||||
$update_forum_information = true;
|
||||
}
|
||||
}
|
||||
$post_id_list = array_values(array_diff($post_id_list, $post_approved_list));
|
||||
for ($i = 0, $size = sizeof($post_approved_list); $i < $size; $i++)
|
||||
{
|
||||
unset($post_info[$post_approved_list[$i]]);
|
||||
}
|
||||
|
||||
if (sizeof($topic_approve_sql))
|
||||
{
|
||||
@@ -645,33 +612,14 @@ function approve_post($post_id_list, $id, $mode)
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($user_posts_sql))
|
||||
{
|
||||
// Try to minimize the query count by merging users with the same post count additions
|
||||
$user_posts_update = array();
|
||||
|
||||
foreach ($user_posts_sql as $user_id => $user_posts)
|
||||
{
|
||||
$user_posts_update[$user_posts][] = $user_id;
|
||||
}
|
||||
|
||||
foreach ($user_posts_update as $user_posts => $user_id_ary)
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET user_posts = user_posts + ' . $user_posts . '
|
||||
WHERE ' . $db->sql_in_set('user_id', $user_id_ary);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
if ($total_topics)
|
||||
{
|
||||
set_config_count('num_topics', $total_topics, true);
|
||||
set_config('num_topics', $config['num_topics'] + $total_topics, true);
|
||||
}
|
||||
|
||||
if ($total_posts)
|
||||
{
|
||||
set_config_count('num_posts', $total_posts, true);
|
||||
set_config('num_posts', $config['num_posts'] + $total_posts, true);
|
||||
}
|
||||
unset($topic_approve_sql, $topic_replies_sql, $post_approve_sql);
|
||||
|
||||
@@ -747,7 +695,7 @@ function approve_post($post_id_list, $id, $mode)
|
||||
}
|
||||
else
|
||||
{
|
||||
$success_msg = (sizeof($post_id_list) + sizeof($post_approved_list) == 1) ? 'POST_APPROVED_SUCCESS' : 'POSTS_APPROVED_SUCCESS';
|
||||
$success_msg = (sizeof($post_id_list) == 1) ? 'POST_APPROVED_SUCCESS' : 'POSTS_APPROVED_SUCCESS';
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -845,13 +793,6 @@ function disapprove_post($post_id_list, $id, $mode)
|
||||
// If the reason is defined within the language file, we will use the localized version, else just use the database entry...
|
||||
$disapprove_reason = (strtolower($row['reason_title']) != 'other') ? ((isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])] : $row['reason_description']) : '';
|
||||
$disapprove_reason .= ($reason) ? "\n\n" . $reason : '';
|
||||
|
||||
if (isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]))
|
||||
{
|
||||
$disapprove_reason_lang = strtoupper($row['reason_title']);
|
||||
}
|
||||
|
||||
$email_disapprove_reason = $disapprove_reason;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -971,8 +912,6 @@ function disapprove_post($post_id_list, $id, $mode)
|
||||
// Notify Poster?
|
||||
if ($notify_poster)
|
||||
{
|
||||
$lang_reasons = array();
|
||||
|
||||
foreach ($post_info as $post_id => $post_data)
|
||||
{
|
||||
if ($post_data['poster_id'] == ANONYMOUS)
|
||||
@@ -980,35 +919,6 @@ function disapprove_post($post_id_list, $id, $mode)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isset($disapprove_reason_lang))
|
||||
{
|
||||
// Okay we need to get the reason from the posters language
|
||||
if (!isset($lang_reasons[$post_data['user_lang']]))
|
||||
{
|
||||
// Assign the current users translation as the default, this is not ideal but getting the board default adds another layer of complexity.
|
||||
$lang_reasons[$post_data['user_lang']] = $user->lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang];
|
||||
|
||||
// Only load up the language pack if the language is different to the current one
|
||||
if ($post_data['user_lang'] != $user->lang_name && file_exists($phpbb_root_path . '/language/' . $post_data['user_lang'] . '/mcp.' . $phpEx))
|
||||
{
|
||||
// Load up the language pack
|
||||
$lang = array();
|
||||
@include($phpbb_root_path . '/language/' . $post_data['user_lang'] . '/mcp.' . $phpEx);
|
||||
|
||||
// If we find the reason in this language pack use it
|
||||
if (isset($lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang]))
|
||||
{
|
||||
$lang_reasons[$post_data['user_lang']] = $lang['report_reasons']['DESCRIPTION'][$disapprove_reason_lang];
|
||||
}
|
||||
|
||||
unset($lang); // Free memory
|
||||
}
|
||||
}
|
||||
|
||||
$email_disapprove_reason = $lang_reasons[$post_data['user_lang']];
|
||||
$email_disapprove_reason .= ($reason) ? "\n\n" . $reason : '';
|
||||
}
|
||||
|
||||
$email_template = ($post_data['post_id'] == $post_data['topic_first_post_id'] && $post_data['post_id'] == $post_data['topic_last_post_id']) ? 'topic_disapproved' : 'post_disapproved';
|
||||
|
||||
$messenger->template($email_template, $post_data['user_lang']);
|
||||
@@ -1018,17 +928,15 @@ function disapprove_post($post_id_list, $id, $mode)
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($post_data['username']),
|
||||
'REASON' => htmlspecialchars_decode($email_disapprove_reason),
|
||||
'REASON' => htmlspecialchars_decode($disapprove_reason),
|
||||
'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_data['post_subject'])),
|
||||
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_data['topic_title'])))
|
||||
);
|
||||
|
||||
$messenger->send($post_data['user_notify_type']);
|
||||
}
|
||||
|
||||
unset($lang_reasons);
|
||||
}
|
||||
unset($post_info, $disapprove_reason, $email_disapprove_reason, $disapprove_reason_lang);
|
||||
unset($post_info, $disapprove_reason);
|
||||
|
||||
$messenger->save_queue();
|
||||
|
||||
|
@@ -65,7 +65,7 @@ class mcp_reports
|
||||
{
|
||||
case 'report_details':
|
||||
|
||||
$user->add_lang(array('posting', 'viewforum', 'viewtopic'));
|
||||
$user->add_lang('posting');
|
||||
|
||||
$post_id = request_var('p', 0);
|
||||
|
||||
@@ -200,7 +200,6 @@ class mcp_reports
|
||||
'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']),
|
||||
'U_MCP_WARN_REPORTER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $report['user_id']) : '',
|
||||
'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '',
|
||||
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $post_info['forum_id']),
|
||||
'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
|
||||
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']),
|
||||
|
||||
@@ -246,17 +245,6 @@ class mcp_reports
|
||||
|
||||
$forum_info = array();
|
||||
$forum_list_reports = get_forum_list('m_report', false, true);
|
||||
$forum_list_read = array_flip(get_forum_list('f_read', true, true)); // Flipped so we can isset() the forum IDs
|
||||
|
||||
// Remove forums we cannot read
|
||||
foreach ($forum_list_reports as $k => $forum_data)
|
||||
{
|
||||
if (!isset($forum_list_read[$forum_data['forum_id']]))
|
||||
{
|
||||
unset($forum_list_reports[$k]);
|
||||
}
|
||||
}
|
||||
unset($forum_list_read);
|
||||
|
||||
if ($topic_id && $forum_id)
|
||||
{
|
||||
@@ -567,8 +555,7 @@ function close_report($report_id_list, $mode, $action)
|
||||
{
|
||||
$sql = 'UPDATE ' . TOPICS_TABLE . '
|
||||
SET topic_reported = 0
|
||||
WHERE ' . $db->sql_in_set('topic_id', $close_report_topics) . '
|
||||
OR ' . $db->sql_in_set('topic_moved_id', $close_report_topics);
|
||||
WHERE ' . $db->sql_in_set('topic_id', $close_report_topics);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
@@ -647,7 +634,7 @@ function close_report($report_id_list, $mode, $action)
|
||||
$return_topic = '';
|
||||
if (sizeof($topic_ids == 1))
|
||||
{
|
||||
$return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . '&f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
|
||||
$return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
|
||||
}
|
||||
|
||||
trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'));
|
||||
|
@@ -46,9 +46,8 @@ function mcp_topic_view($id, $mode, $action)
|
||||
$forum_id = request_var('f', 0);
|
||||
$to_topic_id = request_var('to_topic_id', 0);
|
||||
$to_forum_id = request_var('to_forum_id', 0);
|
||||
$post_id_list = request_var('post_id_list', array(0));
|
||||
$sort = isset($_POST['sort']) ? true : false;
|
||||
$submitted_id_list = request_var('post_ids', array(0));
|
||||
$checked_ids = $post_id_list = request_var('post_id_list', array(0));
|
||||
|
||||
// Split Topic?
|
||||
if ($action == 'split_all' || $action == 'split_beyond')
|
||||
@@ -114,18 +113,11 @@ function mcp_topic_view($id, $mode, $action)
|
||||
{
|
||||
$posts_per_page = $total;
|
||||
}
|
||||
|
||||
if ((!empty($sort_days_old) && $sort_days_old != $sort_days) || $total <= $posts_per_page)
|
||||
if (!empty($sort_days_old) && $sort_days_old != $sort_days)
|
||||
{
|
||||
$start = 0;
|
||||
}
|
||||
|
||||
// Make sure $start is set to the last page if it exceeds the amount
|
||||
if ($start < 0 || $start >= $total)
|
||||
{
|
||||
$start = ($start < 0) ? 0 : floor(($total - 1) / $posts_per_page) * $posts_per_page;
|
||||
}
|
||||
|
||||
$sql = 'SELECT u.username, u.username_clean, u.user_colour, p.*
|
||||
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
|
||||
WHERE ' . (($action == 'reports') ? 'p.post_reported = 1 AND ' : '') . '
|
||||
@@ -234,7 +226,7 @@ function mcp_topic_view($id, $mode, $action)
|
||||
|
||||
'S_POST_REPORTED' => ($row['post_reported']) ? true : false,
|
||||
'S_POST_UNAPPROVED' => ($row['post_approved']) ? false : true,
|
||||
'S_CHECKED' => (($submitted_id_list && !in_array(intval($row['post_id']), $submitted_id_list)) || in_array(intval($row['post_id']), $checked_ids)) ? true : false,
|
||||
'S_CHECKED' => ($post_id_list && in_array(intval($row['post_id']), $post_id_list)) ? true : false,
|
||||
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
|
||||
|
||||
'U_POST_DETAILS' => "$url&i=$id&p={$row['post_id']}&mode=post_details" . (($forum_id) ? "&f=$forum_id" : ''),
|
||||
@@ -287,7 +279,6 @@ function mcp_topic_view($id, $mode, $action)
|
||||
|
||||
$s_hidden_fields = build_hidden_fields(array(
|
||||
'st_old' => $sort_days,
|
||||
'post_ids' => $post_id_list,
|
||||
));
|
||||
|
||||
$template->assign_vars(array(
|
||||
@@ -337,7 +328,7 @@ function mcp_topic_view($id, $mode, $action)
|
||||
*/
|
||||
function split_topic($action, $topic_id, $to_forum_id, $subject)
|
||||
{
|
||||
global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $config;
|
||||
global $db, $template, $user, $phpEx, $phpbb_root_path, $auth;
|
||||
|
||||
$post_id_list = request_var('post_id_list', array(0));
|
||||
$forum_id = request_var('forum_id', 0);
|
||||
@@ -379,11 +370,11 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
|
||||
return;
|
||||
}
|
||||
|
||||
$forum_info = get_forum_data(array($to_forum_id), 'f_post');
|
||||
$forum_info = get_forum_data(array($to_forum_id), 'm_split');
|
||||
|
||||
if (!sizeof($forum_info))
|
||||
{
|
||||
$template->assign_var('MESSAGE', $user->lang['USER_CANNOT_POST']);
|
||||
$template->assign_var('MESSAGE', $user->lang['NOT_MODERATOR']);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -500,9 +491,6 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
|
||||
|
||||
$success_msg = 'TOPIC_SPLIT_SUCCESS';
|
||||
|
||||
// Update forum statistics
|
||||
set_config_count('num_topics', 1, true);
|
||||
|
||||
// Link back to both topics
|
||||
$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>');
|
||||
}
|
||||
|
@@ -249,25 +249,6 @@ class mcp_warn
|
||||
$this->u_action .= "&f=$forum_id&p=$post_id";
|
||||
}
|
||||
|
||||
// Check if can send a notification
|
||||
if ($config['allow_privmsg'])
|
||||
{
|
||||
$auth2 = new auth();
|
||||
$auth2->acl($user_row);
|
||||
$s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false;
|
||||
unset($auth2);
|
||||
}
|
||||
else
|
||||
{
|
||||
$s_can_notify = false;
|
||||
}
|
||||
|
||||
// Prevent against clever people
|
||||
if ($notify && !$s_can_notify)
|
||||
{
|
||||
$notify = false;
|
||||
}
|
||||
|
||||
if ($warning && $action == 'add_warning')
|
||||
{
|
||||
if (check_form_key('mcp_warn'))
|
||||
@@ -326,8 +307,6 @@ class mcp_warn
|
||||
'RANK_IMG' => $rank_img,
|
||||
|
||||
'L_WARNING_POST_DEFAULT' => sprintf($user->lang['WARNING_POST_DEFAULT'], generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&p=$post_id#p$post_id"),
|
||||
|
||||
'S_CAN_NOTIFY' => $s_can_notify,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -372,25 +351,6 @@ class mcp_warn
|
||||
$this->u_action .= "&u=$user_id";
|
||||
}
|
||||
|
||||
// Check if can send a notification
|
||||
if ($config['allow_privmsg'])
|
||||
{
|
||||
$auth2 = new auth();
|
||||
$auth2->acl($user_row);
|
||||
$s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false;
|
||||
unset($auth2);
|
||||
}
|
||||
else
|
||||
{
|
||||
$s_can_notify = false;
|
||||
}
|
||||
|
||||
// Prevent against clever people
|
||||
if ($notify && !$s_can_notify)
|
||||
{
|
||||
$notify = false;
|
||||
}
|
||||
|
||||
if ($warning && $action == 'add_warning')
|
||||
{
|
||||
if (check_form_key('mcp_warn'))
|
||||
@@ -420,20 +380,15 @@ class mcp_warn
|
||||
$template->assign_vars(array(
|
||||
'U_POST_ACTION' => $this->u_action,
|
||||
|
||||
'USERNAME' => $user_row['username'],
|
||||
'USER_COLOR' => (!empty($user_row['user_colour'])) ? $user_row['user_colour'] : '',
|
||||
'RANK_TITLE' => $rank_title,
|
||||
'JOINED' => $user->format_date($user_row['user_regdate']),
|
||||
'POSTS' => ($user_row['user_posts']) ? $user_row['user_posts'] : 0,
|
||||
'WARNINGS' => ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0,
|
||||
|
||||
'USERNAME_FULL' => get_username_string('full', $user_row['user_id'], $user_row['username'], $user_row['user_colour']),
|
||||
'USERNAME_COLOUR' => get_username_string('colour', $user_row['user_id'], $user_row['username'], $user_row['user_colour']),
|
||||
'USERNAME' => get_username_string('username', $user_row['user_id'], $user_row['username'], $user_row['user_colour']),
|
||||
'U_PROFILE' => get_username_string('profile', $user_row['user_id'], $user_row['username'], $user_row['user_colour']),
|
||||
|
||||
'AVATAR_IMG' => $avatar_img,
|
||||
'RANK_IMG' => $rank_img,
|
||||
|
||||
'S_CAN_NOTIFY' => $s_can_notify,
|
||||
));
|
||||
|
||||
return $user_id;
|
||||
|
@@ -391,7 +391,7 @@ class bbcode_firstpass extends bbcode
|
||||
|
||||
/**
|
||||
* Parse code text from code tag
|
||||
* @access private
|
||||
* @private
|
||||
*/
|
||||
function bbcode_parse_code($stx, &$code)
|
||||
{
|
||||
@@ -400,10 +400,7 @@ class bbcode_firstpass extends bbcode
|
||||
case 'php':
|
||||
|
||||
$remove_tags = false;
|
||||
|
||||
$str_from = array('<', '>', '[', ']', '.', ':', ':');
|
||||
$str_to = array('<', '>', '[', ']', '.', ':', ':');
|
||||
$code = str_replace($str_from, $str_to, $code);
|
||||
$code = str_replace(array('<', '>'), array('<', '>'), $code);
|
||||
|
||||
if (!preg_match('/\<\?.*?\?\>/is', $code))
|
||||
{
|
||||
@@ -604,10 +601,10 @@ class bbcode_firstpass extends bbcode
|
||||
$out .= array_pop($list_end_tags) . ']';
|
||||
$tok = '[';
|
||||
}
|
||||
else if (preg_match('#^list(=[0-9a-z]+)?$#i', $buffer, $m))
|
||||
else if (preg_match('#^list(=[0-9a-z])?$#i', $buffer, $m))
|
||||
{
|
||||
// sub-list, add a closing tag
|
||||
if (empty($m[1]) || preg_match('/^=(?:disc|square|circle)$/i', $m[1]))
|
||||
if (empty($m[1]) || preg_match('/^(?:disc|square|circle)$/i', $m[1]))
|
||||
{
|
||||
array_push($list_end_tags, '/list:u:' . $this->bbcode_uid);
|
||||
}
|
||||
@@ -695,7 +692,6 @@ class bbcode_firstpass extends bbcode
|
||||
* [quote="[i]test[/i]"]test[/quote] (correct: parsed)
|
||||
* [quote="[quote]test[/quote]"]test[/quote] (correct: parsed - Username displayed as [quote]test[/quote])
|
||||
* #20735 - [quote]test[/[/b]quote] test [/quote][/quote] test - (correct: quoted: "test[/[/b]quote] test" / non-quoted: "[/quote] test" - also failed if layout distorted)
|
||||
* #40565 - [quote="a"]a[/quote][quote="a]a[/quote] (correct: first quote tag parsed, second quote tag unparsed)
|
||||
*/
|
||||
|
||||
$in = str_replace("\r\n", "\n", str_replace('\"', '"', trim($in)));
|
||||
@@ -706,7 +702,7 @@ class bbcode_firstpass extends bbcode
|
||||
}
|
||||
|
||||
// To let the parser not catch tokens within quote_username quotes we encode them before we start this...
|
||||
$in = preg_replace('#quote="(.*?)"\]#ie', "'quote="' . str_replace(array('[', ']', '\\\"'), array('[', ']', '\"'), '\$1') . '"]'", $in);
|
||||
$in = preg_replace('#quote="(.*?)"\]#ie', "'quote="' . str_replace(array('[', ']'), array('[', ']'), '\$1') . '"]'", $in);
|
||||
|
||||
$tok = ']';
|
||||
$out = '[';
|
||||
@@ -859,8 +855,6 @@ class bbcode_firstpass extends bbcode
|
||||
}
|
||||
while ($in);
|
||||
|
||||
$out .= $buffer;
|
||||
|
||||
if (sizeof($close_tags))
|
||||
{
|
||||
$out .= '[' . implode('][', $close_tags) . ']';
|
||||
@@ -1052,7 +1046,11 @@ class parse_message extends bbcode_firstpass
|
||||
{
|
||||
// Init BBCode UID
|
||||
$this->bbcode_uid = substr(base_convert(unique_id(), 16, 36), 0, BBCODE_UID_LEN);
|
||||
$this->message = $message;
|
||||
|
||||
if ($message)
|
||||
{
|
||||
$this->message = $message;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1101,6 +1099,13 @@ class parse_message extends bbcode_firstpass
|
||||
}
|
||||
}
|
||||
|
||||
// Check for "empty" message
|
||||
if ($mode !== 'sig' && utf8_clean_string($this->message) === '')
|
||||
{
|
||||
$this->warn_msg[] = $user->lang['TOO_FEW_CHARS'];
|
||||
return (!$update_this_message) ? $return_message : $this->warn_msg;
|
||||
}
|
||||
|
||||
// Prepare BBcode (just prepares some tags for better parsing)
|
||||
if ($allow_bbcode && strpos($this->message, '[') !== false)
|
||||
{
|
||||
@@ -1143,14 +1148,6 @@ class parse_message extends bbcode_firstpass
|
||||
}
|
||||
}
|
||||
|
||||
// Check for "empty" message. We do not check here for maximum length, because bbcode, smilies, etc. can add to the length.
|
||||
// The maximum length check happened before any parsings.
|
||||
if ($mode !== 'sig' && utf8_clean_string($this->message) === '')
|
||||
{
|
||||
$this->warn_msg[] = $user->lang['TOO_FEW_CHARS'];
|
||||
return (!$update_this_message) ? $return_message : $this->warn_msg;
|
||||
}
|
||||
|
||||
// Check number of links
|
||||
if ($config['max_' . $mode . '_urls'] && $num_urls > $config['max_' . $mode . '_urls'])
|
||||
{
|
||||
|
@@ -118,7 +118,7 @@ class fulltext_mysql extends search_backend
|
||||
*/
|
||||
function split_keywords(&$keywords, $terms)
|
||||
{
|
||||
global $config, $user;
|
||||
global $config;
|
||||
|
||||
if ($terms == 'all')
|
||||
{
|
||||
@@ -167,12 +167,6 @@ class fulltext_mysql extends search_backend
|
||||
$this->split_words = $matches[1];
|
||||
}
|
||||
|
||||
// We limit the number of allowed keywords to minimize load on the database
|
||||
if ($config['max_num_search_keywords'] && sizeof($this->split_words) > $config['max_num_search_keywords'])
|
||||
{
|
||||
trigger_error($user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', $config['max_num_search_keywords'], sizeof($this->split_words)));
|
||||
}
|
||||
|
||||
// to allow phrase search, we need to concatenate quoted words
|
||||
$tmp_split_words = array();
|
||||
$phrase = '';
|
||||
@@ -710,7 +704,7 @@ class fulltext_mysql extends search_backend
|
||||
|
||||
if (!isset($this->stats['post_subject']))
|
||||
{
|
||||
if ($db->sql_layer == 'mysqli' || version_compare($db->sql_server_info(true), '4.1.3', '>='))
|
||||
if ($db->sql_layer == 'mysqli' || version_compare($db->mysql_version, '4.1.3', '>='))
|
||||
{
|
||||
//$alter[] = 'MODIFY post_subject varchar(100) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL';
|
||||
}
|
||||
@@ -723,7 +717,7 @@ class fulltext_mysql extends search_backend
|
||||
|
||||
if (!isset($this->stats['post_text']))
|
||||
{
|
||||
if ($db->sql_layer == 'mysqli' || version_compare($db->sql_server_info(true), '4.1.3', '>='))
|
||||
if ($db->sql_layer == 'mysqli' || version_compare($db->mysql_version, '4.1.3', '>='))
|
||||
{
|
||||
$alter[] = 'MODIFY post_text mediumtext COLLATE utf8_unicode_ci NOT NULL';
|
||||
}
|
||||
|
@@ -81,7 +81,7 @@ class fulltext_native extends search_backend
|
||||
*/
|
||||
function split_keywords($keywords, $terms)
|
||||
{
|
||||
global $db, $user, $config;
|
||||
global $db, $user;
|
||||
|
||||
$keywords = trim($this->cleanup($keywords, '+-|()*'));
|
||||
|
||||
@@ -167,13 +167,6 @@ class fulltext_native extends search_backend
|
||||
);
|
||||
|
||||
$keywords = preg_replace($match, $replace, $keywords);
|
||||
$num_keywords = sizeof(explode(' ', $keywords));
|
||||
|
||||
// We limit the number of allowed keywords to minimize load on the database
|
||||
if ($config['max_num_search_keywords'] && $num_keywords > $config['max_num_search_keywords'])
|
||||
{
|
||||
trigger_error($user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', $config['max_num_search_keywords'], $num_keywords));
|
||||
}
|
||||
|
||||
// $keywords input format: each word separated by a space, words in a bracket are not separated
|
||||
|
||||
@@ -454,15 +447,13 @@ class fulltext_native extends search_backend
|
||||
'FROM' => array(
|
||||
SEARCH_WORDMATCH_TABLE => array(),
|
||||
SEARCH_WORDLIST_TABLE => array(),
|
||||
POSTS_TABLE => 'p'
|
||||
),
|
||||
'LEFT_JOIN' => array(array(
|
||||
'FROM' => array(POSTS_TABLE => 'p'),
|
||||
'ON' => 'm0.post_id = p.post_id',
|
||||
)),
|
||||
'LEFT_JOIN' => array()
|
||||
);
|
||||
$sql_where[] = 'm0.post_id = p.post_id';
|
||||
|
||||
$title_match = '';
|
||||
$left_join_topics = false;
|
||||
$group_by = true;
|
||||
// Build some display specific sql strings
|
||||
switch ($fields)
|
||||
@@ -472,7 +463,7 @@ class fulltext_native extends search_backend
|
||||
$group_by = false;
|
||||
// no break
|
||||
case 'firstpost':
|
||||
$left_join_topics = true;
|
||||
$sql_array['FROM'][TOPICS_TABLE] = 't';
|
||||
$sql_where[] = 'p.post_id = t.topic_first_post_id';
|
||||
break;
|
||||
|
||||
@@ -484,7 +475,11 @@ class fulltext_native extends search_backend
|
||||
|
||||
if ($type == 'topics')
|
||||
{
|
||||
$left_join_topics = true;
|
||||
if (!isset($sql_array['FROM'][TOPICS_TABLE]))
|
||||
{
|
||||
$sql_array['FROM'][TOPICS_TABLE] = 't';
|
||||
$sql_where[] = 'p.topic_id = t.topic_id';
|
||||
}
|
||||
$group_by = true;
|
||||
}
|
||||
|
||||
@@ -645,21 +640,13 @@ class fulltext_native extends search_backend
|
||||
$sql = '';
|
||||
$sql_array_count = $sql_array;
|
||||
|
||||
if ($left_join_topics)
|
||||
{
|
||||
$sql_array_count['LEFT_JOIN'][] = array(
|
||||
'FROM' => array(TOPICS_TABLE => 't'),
|
||||
'ON' => 'p.topic_id = t.topic_id'
|
||||
);
|
||||
}
|
||||
|
||||
switch ($db->sql_layer)
|
||||
{
|
||||
case 'mysql4':
|
||||
case 'mysqli':
|
||||
|
||||
// 3.x does not support SQL_CALC_FOUND_ROWS
|
||||
// $sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT'];
|
||||
$sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT'];
|
||||
$is_mysql = true;
|
||||
|
||||
break;
|
||||
@@ -700,7 +687,11 @@ class fulltext_native extends search_backend
|
||||
break;
|
||||
|
||||
case 't':
|
||||
$left_join_topics = true;
|
||||
if (!isset($sql_array['FROM'][TOPICS_TABLE]))
|
||||
{
|
||||
$sql_array['FROM'][TOPICS_TABLE] = 't';
|
||||
$sql_where[] = 'p.topic_id = t.topic_id';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
@@ -709,14 +700,6 @@ class fulltext_native extends search_backend
|
||||
break;
|
||||
}
|
||||
|
||||
if ($left_join_topics)
|
||||
{
|
||||
$sql_array['LEFT_JOIN'][] = array(
|
||||
'FROM' => array(TOPICS_TABLE => 't'),
|
||||
'ON' => 'p.topic_id = t.topic_id'
|
||||
);
|
||||
}
|
||||
|
||||
$sql_array['WHERE'] = implode(' AND ', $sql_where);
|
||||
$sql_array['GROUP_BY'] = ($group_by) ? (($type == 'posts') ? 'p.post_id' : 'p.topic_id') . ', ' . $sort_by_sql[$sort_key] : '';
|
||||
$sql_array['ORDER_BY'] = $sql_sort;
|
||||
@@ -740,16 +723,6 @@ class fulltext_native extends search_backend
|
||||
// if we use mysql and the total result count is not cached yet, retrieve it from the db
|
||||
if (!$total_results && $is_mysql)
|
||||
{
|
||||
// Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it.
|
||||
$sql_array_copy = $sql_array;
|
||||
$sql_array_copy['SELECT'] = 'SQL_CALC_FOUND_ROWS p.post_id ';
|
||||
|
||||
$sql = $db->sql_build_query('SELECT', $sql_array_copy);
|
||||
unset($sql_array_copy);
|
||||
|
||||
$db->sql_query($sql);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT FOUND_ROWS() as total_results';
|
||||
$result = $db->sql_query($sql);
|
||||
$total_results = (int) $db->sql_fetchfield('total_results');
|
||||
@@ -873,7 +846,7 @@ class fulltext_native extends search_backend
|
||||
{
|
||||
case 'mysql4':
|
||||
case 'mysqli':
|
||||
// $select = 'SQL_CALC_FOUND_ROWS ' . $select;
|
||||
$select = 'SQL_CALC_FOUND_ROWS ' . $select;
|
||||
$is_mysql = true;
|
||||
break;
|
||||
|
||||
@@ -966,12 +939,6 @@ class fulltext_native extends search_backend
|
||||
|
||||
if (!$total_results && $is_mysql)
|
||||
{
|
||||
// Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it.
|
||||
$sql = str_replace('SELECT ' . $select, 'SELECT DISTINCT SQL_CALC_FOUND_ROWS p.post_id', $sql);
|
||||
|
||||
$db->sql_query($sql);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT FOUND_ROWS() as total_results';
|
||||
$result = $db->sql_query($sql);
|
||||
$total_results = (int) $db->sql_fetchfield('total_results');
|
||||
@@ -1141,7 +1108,7 @@ class fulltext_native extends search_backend
|
||||
|
||||
// Get unique words from the above arrays
|
||||
$unique_add_words = array_unique(array_merge($words['add']['post'], $words['add']['title']));
|
||||
|
||||
|
||||
// We now have unique arrays of all words to be added and removed and
|
||||
// individual arrays of added and removed words for text and title. What
|
||||
// we need to do now is add the new words (if they don't already exist)
|
||||
@@ -1706,7 +1673,7 @@ class fulltext_native extends search_backend
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="fulltext_native_common_thres">' . $user->lang['COMMON_WORD_THRESHOLD'] . ':</label><br /><span>' . $user->lang['COMMON_WORD_THRESHOLD_EXPLAIN'] . '</span></dt>
|
||||
<dd><input id="fulltext_native_common_thres" type="text" size="3" maxlength="3" name="config[fulltext_native_common_thres]" value="' . (double) $config['fulltext_native_common_thres'] . '" /> %</dd>
|
||||
<dd><input id="fulltext_native_common_thres" type="text" size="3" maxlength="3" name="config[fulltext_native_common_thres]" value="' . (int) $config['fulltext_native_common_thres'] . '" /> %</dd>
|
||||
</dl>
|
||||
';
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user