From c6e176d88edb882a1cc02a4f6d83114554b38121 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 15 Feb 2010 15:04:44 +0000 Subject: Add sql_bit_or() dbal method. Add ability to enable quick reply in all forums. -- Voila ;-) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10491 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'phpBB/includes/functions_admin.php') diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index ea64bb3beb..955ef4df58 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -3309,4 +3309,24 @@ function obtain_latest_version_info($force_update = false, $warn_fail = false, $ return $info; } +/** + * Enables a particular flag in a bitfield column of a given table. + * + * @param string $table_name The table to update + * @param string $column_name The column containing a bitfield to update + * @param int $flag The binary flag which is OR-ed with the current column value + * @param string $sql_more This string is attached to the sql query generated to update the table. + * + * @return void + */ +function enable_bitfield_column_flag($table_name, $column_name, $flag, $sql_more = '') +{ + global $db; + + $sql = 'UPDATE ' . $table_name . ' + SET ' . $column_name . ' = ' . $db->sql_bit_or($column_name, $flag) . ' + ' . $sql_more; + $db->sql_query($sql); +} + ?> \ No newline at end of file -- cgit v1.2.1