diff options
| author | Andreas Fischer <bantu@phpbb.com> | 2010-02-15 15:04:44 +0000 |
|---|---|---|
| committer | Andreas Fischer <bantu@phpbb.com> | 2010-02-15 15:04:44 +0000 |
| commit | c6e176d88edb882a1cc02a4f6d83114554b38121 (patch) | |
| tree | 14199aa8a4c464803dbb7ff8d31d8a73d37d4569 /phpBB/includes/db/dbal.php | |
| parent | 7332b3b741332479726ebb203f821eab5186cb3b (diff) | |
| download | forums-c6e176d88edb882a1cc02a4f6d83114554b38121.tar forums-c6e176d88edb882a1cc02a4f6d83114554b38121.tar.gz forums-c6e176d88edb882a1cc02a4f6d83114554b38121.tar.bz2 forums-c6e176d88edb882a1cc02a4f6d83114554b38121.tar.xz forums-c6e176d88edb882a1cc02a4f6d83114554b38121.zip | |
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
Diffstat (limited to 'phpBB/includes/db/dbal.php')
| -rw-r--r-- | phpBB/includes/db/dbal.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index a962696bb8..eeddf1f41b 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -430,6 +430,24 @@ class dbal } /** + * Run binary OR operator on DB column. + * Results in sql statement: "{$column_name} | (1 << {$bit}) {$compare}" + * + * @param string $column_name The column name to use + * @param int $bit The value to use for the OR operator, will be converted to (1 << $bit). Is used by options, using the number schema... 0, 1, 2...29 + * @param string $compare Any custom SQL code after the check (for example "= 0") + */ + function sql_bit_or($column_name, $bit, $compare = '') + { + if (method_exists($this, '_sql_bit_or')) + { + return $this->_sql_bit_or($column_name, $bit, $compare); + } + + return $column_name . ' | ' . (1 << $bit) . (($compare) ? ' ' . $compare : ''); + } + + /** * Run more than one insert statement. * * @param string $table table name to run the statements on |
