aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-09-02 13:33:06 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-09-02 13:33:06 +0000
commit3ea2d53cb2b2554e944beb96fb98ea5c4c3aa23e (patch)
tree99adb7132f8294497e6deb2615801229b2a061c3 /phpBB/includes
parentcf7a2614088ad7a17de201abfc6e8a93d4cea5d7 (diff)
downloadforums-3ea2d53cb2b2554e944beb96fb98ea5c4c3aa23e.tar
forums-3ea2d53cb2b2554e944beb96fb98ea5c4c3aa23e.tar.gz
forums-3ea2d53cb2b2554e944beb96fb98ea5c4c3aa23e.tar.bz2
forums-3ea2d53cb2b2554e944beb96fb98ea5c4c3aa23e.tar.xz
forums-3ea2d53cb2b2554e944beb96fb98ea5c4c3aa23e.zip
some changes/fixes
git-svn-id: file:///svn/phpbb/trunk@6345 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acm/acm_file.php2
-rw-r--r--phpBB/includes/acp/acp_profile.php7
-rw-r--r--phpBB/includes/diff/diff.php6
-rw-r--r--phpBB/includes/functions.php1
-rw-r--r--phpBB/includes/functions_admin.php8
-rw-r--r--phpBB/includes/functions_user.php6
-rwxr-xr-xphpBB/includes/search/search.php4
7 files changed, 22 insertions, 12 deletions
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php
index f79a94c987..f74ab2707f 100644
--- a/phpBB/includes/acm/acm_file.php
+++ b/phpBB/includes/acm/acm_file.php
@@ -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)
{
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index e0339ddccb..e68e8c10f8 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -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:
diff --git a/phpBB/includes/diff/diff.php b/phpBB/includes/diff/diff.php
index 102f1119b2..fd2d557a19 100644
--- a/phpBB/includes/diff/diff.php
+++ b/phpBB/includes/diff/diff.php
@@ -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
{
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index ef01263abc..3278a54619 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -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'],
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index bb889eae12..822d17367c 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -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];
}
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 7183c96e1b..1da1fd962d 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -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);
diff --git a/phpBB/includes/search/search.php b/phpBB/includes/search/search.php
index fa91b9eef5..4c8387bd22 100755
--- a/phpBB/includes/search/search.php
+++ b/phpBB/includes/search/search.php
@@ -285,7 +285,7 @@ class search_backend
{
$cache->destroy('_search_results_' . $row['search_key']);
}
- $db->sql_freeresult();
+ $db->sql_freeresult($result);
}
// clear all searches that searched for the specified authors
@@ -306,7 +306,7 @@ class search_backend
{
$cache->destroy('_search_results_' . $row['search_key']);
}
- $db->sql_freeresult();
+ $db->sql_freeresult($result);
}
$sql = 'DELETE