mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
some changes/fixes
git-svn-id: file:///svn/phpbb/trunk@6345 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -180,7 +180,7 @@ class acm
|
||||
*/
|
||||
function purge()
|
||||
{
|
||||
// Purge sql data
|
||||
// Purge all phpbb cache files
|
||||
$dir = opendir($this->cache_dir);
|
||||
while (($entry = readdir($dir)) !== false)
|
||||
{
|
||||
|
@@ -119,6 +119,8 @@ class acp_profile
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$db->sql_transaction('begin');
|
||||
|
||||
// Create a temp table and populate it, destroy the existing one
|
||||
$db->sql_query(preg_replace('#CREATE\s+TABLE\s+"?' . PROFILE_FIELDS_DATA_TABLE . '"?#i', 'CREATE TEMPORARY TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp', $row['sql']));
|
||||
$db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . '_temp SELECT * FROM ' . PROFILE_FIELDS_DATA_TABLE);
|
||||
@@ -127,8 +129,9 @@ class acp_profile
|
||||
preg_match('#\((.*)\)#s', $row['sql'], $matches);
|
||||
|
||||
$new_table_cols = trim($matches[1]);
|
||||
$old_table_cols = explode(',', $new_table_cols);
|
||||
$old_table_cols = preg_split('/,(?=[\\sa-z])/im', $new_table_cols);
|
||||
$column_list = array();
|
||||
|
||||
foreach ($old_table_cols as $declaration)
|
||||
{
|
||||
$entities = preg_split('#\s+#', trim($declaration));
|
||||
@@ -146,6 +149,8 @@ class acp_profile
|
||||
$db->sql_query('CREATE TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $new_table_cols . ');');
|
||||
$db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . PROFILE_FIELDS_DATA_TABLE . '_temp;');
|
||||
$db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp');
|
||||
|
||||
$db->sql_transaction('commit');
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@@ -430,12 +430,13 @@ class diff3 extends diff
|
||||
*
|
||||
* @param string $label1 the cvs file version/label from the original set of lines
|
||||
* @param string $label2 the cvs file version/label from the new set of lines
|
||||
* @param string $label_sep the explanation between label1 and label2 - more of a helper for the user
|
||||
* @param bool $get_conflicts if set to true only the number of conflicts is returned
|
||||
* @param bool $merge_new if set to true the merged output will have the new file contents on a conflicting merge
|
||||
*
|
||||
* @return mixed the merged output
|
||||
*/
|
||||
function merged_output($label1 = 'CURRENT_FILE', $label2 = 'NEW_FILE', $get_conflicts = false, $merge_new = false)
|
||||
function merged_output($label1 = 'CURRENT_FILE', $label2 = 'NEW_FILE', $label_sep = 'DIFF_SEP_EXPLAIN', $get_conflicts = false, $merge_new = false)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@@ -454,6 +455,7 @@ class diff3 extends diff
|
||||
|
||||
$label1 = (!empty($user->lang[$label1])) ? $user->lang[$label1] : $label1;
|
||||
$label2 = (!empty($user->lang[$label2])) ? $user->lang[$label2] : $label2;
|
||||
$label_sep = (!empty($user->lang[$label_sep])) ? $user->lang[$label_sep] : $label_sep;
|
||||
|
||||
$lines = array();
|
||||
|
||||
@@ -463,7 +465,7 @@ class diff3 extends diff
|
||||
{
|
||||
if (!$merge_new)
|
||||
{
|
||||
$lines = array_merge($lines, array('<<<<<<<' . ($label1 ? ' ' . $label1 : '')), $edit->final1, array('======='), $edit->final2, array('>>>>>>>' . ($label2 ? ' ' . $label2 : '')));
|
||||
$lines = array_merge($lines, array('<<<<<<<' . ($label1 ? ' ' . $label1 : '')), $edit->final1, array('=======' . ($label_sep ? ' ' . $label_sep : '')), $edit->final2, array('>>>>>>>' . ($label2 ? ' ' . $label2 : '')));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -3148,6 +3148,7 @@ function page_header($page_title = '', $display_online_list = true)
|
||||
'S_USER_PM_POPUP' => $user->optionget('popuppm'),
|
||||
'S_USER_LANG' => $user->data['user_lang'],
|
||||
'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'],
|
||||
'S_USERNAME' => $user->data['username'],
|
||||
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
|
||||
'S_CONTENT_ENCODING' => $user->lang['ENCODING'],
|
||||
'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'],
|
||||
|
@@ -511,7 +511,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true)
|
||||
$forum_ids[] = $row['forum_id'];
|
||||
$topic_ids[] = $row['topic_id'];
|
||||
}
|
||||
$db->sql_freeresult();
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$return['topics'] = sizeof($topic_ids);
|
||||
|
||||
@@ -628,7 +628,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
|
||||
trigger_error('NO_SUCH_SEARCH_MODULE');
|
||||
}
|
||||
|
||||
require("{$phpbb_root_path}includes/search/$search_type.$phpEx");
|
||||
include_once("{$phpbb_root_path}includes/search/$search_type.$phpEx");
|
||||
|
||||
$error = false;
|
||||
$search = new $search_type($error);
|
||||
@@ -1142,7 +1142,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
|
||||
{
|
||||
$topic_ids[] = $row['topic_id'];
|
||||
}
|
||||
$db->sql_freeresult();
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!sizeof($topic_ids))
|
||||
{
|
||||
@@ -1728,7 +1728,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
|
||||
|
||||
foreach ($fieldnames as $fieldname)
|
||||
{
|
||||
if ($row['topic_' . $fieldname] != $row[$fieldname])
|
||||
if (isset($row[$fieldname]) && isset($row['topic_' . $fieldname]) && $row['topic_' . $fieldname] != $row[$fieldname])
|
||||
{
|
||||
$sql_ary['topic_' . $fieldname] = $row[$fieldname];
|
||||
}
|
||||
|
@@ -1681,6 +1681,8 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
|
||||
return 'GROUP_USERS_EXIST';
|
||||
}
|
||||
|
||||
$db->sql_transaction('begin');
|
||||
|
||||
if (sizeof($add_id_ary))
|
||||
{
|
||||
// Insert the new users
|
||||
@@ -1689,8 +1691,6 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
case 'mysqli':
|
||||
case 'mssql':
|
||||
case 'mssql_odbc':
|
||||
case 'sqlite':
|
||||
$sql = 'INSERT INTO ' . USER_GROUP_TABLE . " (user_id, group_id, group_leader, user_pending)
|
||||
VALUES " . implode(', ', preg_replace('#^([0-9]+)$#', "(\\1, $group_id, $leader, $pending)", $add_id_ary));
|
||||
@@ -1722,6 +1722,8 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
|
||||
group_set_user_default($group_id, $user_id_ary, $group_attributes);
|
||||
}
|
||||
|
||||
$db->sql_transaction('commit');
|
||||
|
||||
// Clear permissions cache of relevant users
|
||||
$auth->acl_clear_prefetch($user_id_ary);
|
||||
|
||||
|
@@ -285,7 +285,7 @@ class search_backend
|
||||
{
|
||||
$cache->destroy('_search_results_' . $row['search_key']);
|
||||
}
|
||||
$db->sql_freeresult();
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
// clear all searches that searched for the specified authors
|
||||
@@ -306,7 +306,7 @@ class search_backend
|
||||
{
|
||||
$cache->destroy('_search_results_' . $row['search_key']);
|
||||
}
|
||||
$db->sql_freeresult();
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
$sql = 'DELETE
|
||||
|
Reference in New Issue
Block a user