1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 23:25:30 +02:00
This commit should increase the total number of BBCodes from 31 to 2040. Some things to watch out for:

Each database likes to deal with binary data in its own, special way. They are, quite frankly, too cool for school.

MySQL, MSSQL and Oracle all allow me to send in a default value for their binary column using a hex number. However, MSSQL forces me to send the specific data as a hex number and thus we must CAST it.

PostgreSQL allows me to set a binary column, but with a twist. It demands that the default be in _octal_ and its datatype allows somewhere around a gigabyte's worth of BBCodes ( PGSQL users, we shut you down to 2040 for your own good! )

Firebird has no decent mechanism for allowing me to shuttle in binary data so I must force my way in. By virtue of triggers and a UDF, we ram in our default values.

SQLite is the most bizarre of them all. They have no mechanism for turning an ASCII code into a ASCII character. Because of this, we have a trigger and a UDF (just like Firebird!) but with a twist! The UDF is defined on the PHP side of things instead of SQL. SQLite also demands that it's data be encoded before being sent off.

Other notes:
- SQLite installs again :D
- Firebird nearly installs again :P
- Database backup is not screwed up :P

P.S.
I hope nothing broke :D


git-svn-id: file:///svn/phpbb/trunk@6209 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M 2006-07-24 10:08:36 +00:00
parent 48b2dc1277
commit 9532514c2a
26 changed files with 1526 additions and 616 deletions

View File

@ -164,7 +164,7 @@ class acp_bbcodes
$bbcode_id = NUM_CORE_BBCODES + 1;
}
if ($bbcode_id > 31)
if ($bbcode_id > 2039)
{
trigger_error('TOO_MANY_BBCODES');
}

View File

@ -210,11 +210,11 @@ class acp_database
case 'oracle':
case 'postgres':
case 'firebird':
$sql_data .= 'TRUNCATE TABLE ' . $table_name . "\n";
$sql_data .= 'TRUNCATE TABLE ' . $table_name . ";\n";
break;
case 'sqlite':
$sql_data .= 'DELETE FROM ' . $table_name . "\n";
$sql_data .= 'DELETE FROM ' . $table_name . ";\n";
break;
}
}
@ -1686,7 +1686,7 @@ class acp_database
if ($row['COLUMN_DEFAULT'])
{
$line .= ' CONSTRAINT [DF_' . $table_name . '_' . $row['COLUMN_NAME'] . '] DEFAULT ' . $row['COLUMN_DEFAULT'];
$line .= ' DEFAULT ' . $row['COLUMN_DEFAULT'];
}
$rows[] = $line;

View File

@ -104,7 +104,7 @@ class acp_forums
'forum_rules' => request_var('forum_rules', '', true),
'forum_rules_uid' => '',
'forum_rules_options' => 0,
'forum_rules_bitfield' => 0,
'forum_rules_bitfield' => '',
'forum_rules_link' => request_var('forum_rules_link', ''),
'forum_image' => request_var('forum_image', ''),
'forum_style' => request_var('forum_style', 0),
@ -419,7 +419,7 @@ class acp_forums
{
// Before we are able to display the preview and plane text, we need to parse our request_var()'d value...
$forum_data['forum_rules_uid'] = '';
$forum_data['forum_rules_bitfield'] = 0;
$forum_data['forum_rules_bitfield'] = '';
$forum_data['forum_rules_options'] = 0;
generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], request_var('rules_allow_bbcode', false), request_var('rules_allow_urls', false), request_var('rules_allow_smiliess', false));
@ -439,7 +439,7 @@ class acp_forums
{
// Before we are able to display the preview and plane text, we need to parse our request_var()'d value...
$forum_data['forum_desc_uid'] = '';
$forum_data['forum_desc_bitfield'] = 0;
$forum_data['forum_desc_bitfield'] = '';
$forum_data['forum_desc_options'] = 0;
generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], request_var('desc_allow_bbcode', false), request_var('desc_allow_urls', false), request_var('desc_allow_smiliess', false));
@ -919,8 +919,72 @@ class acp_forums
$forum_id = $forum_data_sql['forum_id'];
unset($forum_data_sql['forum_id']);
$query = '';
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$values = array();
foreach ($forum_data_sql as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'forum_desc_bitfield' && $key != 'forum_rules_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
case 'sqlite':
$values = array();
foreach ($forum_data_sql as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'forum_desc_bitfield' && $key != 'forum_rules_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = '" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
default:
$query = $db->sql_build_array('UPDATE', $forum_data_sql);
break;
}
$sql = 'UPDATE ' . FORUMS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $forum_data_sql) . '
SET ' . $query . '
WHERE forum_id = ' . $forum_id;
$db->sql_query($sql);

View File

@ -27,7 +27,14 @@ class acp_styles
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
// Hardcoded template bitfield to add for new templates
define('TEMPLATE_BITFIELD', 6921);
$bitfield = new bitfield();
$bitfield->set(0);
$bitfield->set(3);
$bitfield->set(8);
$bitfield->set(9);
$bitfield->set(11);
$bitfield->set(12);
define('TEMPLATE_BITFIELD', $bitfield->data);
$user->add_lang('acp/styles');
@ -2917,10 +2924,78 @@ pagination_sep = \'{PAGINATION_SEP}\'
unset($cfg_data);
}
$query = '';
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$fields = array();
foreach ($sql_ary as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
case 'sqlite':
$fields = array();
foreach ($sql_ary as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "'" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
default:
$query = $db->sql_build_array('INSERT', $sql_ary);
break;
}
$db->sql_transaction('begin');
$sql = "INSERT INTO $sql_from
" . $db->sql_build_array('INSERT', $sql_ary);
" . $query;
$db->sql_query($sql);
$id = $db->sql_nextid();

View File

@ -15,7 +15,7 @@
class bbcode
{
var $bbcode_uid = '';
var $bbcode_bitfield = 0;
var $bbcode_bitfield = '';
var $bbcode_cache = array();
var $bbcode_template = array();
@ -69,32 +69,31 @@ class bbcode
$str = array('search' => array(), 'replace' => array());
$preg = array('search' => array(), 'replace' => array());
$bitlen = strlen(decbin($this->bbcode_bitfield));
for ($bbcode_id = 0; $bbcode_id < $bitlen; ++$bbcode_id)
$bitfield = new bitfield($this->bbcode_bitfield);
$bbcodes_set = $bitfield->get_all_set();
foreach ($bbcodes_set as $bbcode_id)
{
if ($this->bbcode_bitfield & (1 << $bbcode_id))
if (!empty($this->bbcode_cache[$bbcode_id]))
{
if (!empty($this->bbcode_cache[$bbcode_id]))
foreach ($this->bbcode_cache[$bbcode_id] as $type => $array)
{
foreach ($this->bbcode_cache[$bbcode_id] as $type => $array)
foreach ($array as $search => $replace)
{
foreach ($array as $search => $replace)
{
${$type}['search'][] = str_replace('$uid', $this->bbcode_uid, $search);
${$type}['replace'][] = $replace;
}
${$type}['search'][] = str_replace('$uid', $this->bbcode_uid, $search);
${$type}['replace'][] = $replace;
}
if (sizeof($str['search']))
{
$message = str_replace($str['search'], $str['replace'], $message);
$str = array('search' => array(), 'replace' => array());
}
if (sizeof($str['search']))
{
$message = str_replace($str['search'], $str['replace'], $message);
$str = array('search' => array(), 'replace' => array());
}
if (sizeof($preg['search']))
{
$message = preg_replace($preg['search'], $preg['replace'], $message);
$preg = array('search' => array(), 'replace' => array());
}
if (sizeof($preg['search']))
{
$message = preg_replace($preg['search'], $preg['replace'], $message);
$preg = array('search' => array(), 'replace' => array());
}
}
}
@ -129,9 +128,12 @@ class bbcode
$bbcode_ids = $rowset = array();
$bitlen = strlen(decbin($this->bbcode_bitfield));
for ($bbcode_id = 0; $bbcode_id < $bitlen; ++$bbcode_id)
$bitfield = new bitfield($this->bbcode_bitfield);
$bbcodes_set = $bitfield->get_all_set();
foreach ($bbcodes_set as $bbcode_id)
{
if (isset($this->bbcode_cache[$bbcode_id]) || !($this->bbcode_bitfield & (1 << $bbcode_id)))
if (isset($this->bbcode_cache[$bbcode_id]))
{
// do not try to re-cache it if it's already in
continue;
@ -312,9 +314,13 @@ class bbcode
break;
default:
if (!isset($template_bitfield))
{
$template_bitfield = new bitfield($this->template_bitfield);
}
if (isset($rowset[$bbcode_id]))
{
if ($this->template_bitfield & (1 << $bbcode_id))
if ($template_bitfield->get($bbcode_id))
{
// The bbcode requires a custom template to be loaded
if (!$bbcode_tpl = $this->bbcode_tpl($rowset[$bbcode_id]['bbcode_tag'], $bbcode_id))
@ -390,9 +396,10 @@ class bbcode
'color' => '<span style="color: $1">$2</span>',
'email' => '<a href="mailto:$1">$2</a>'
);
$template_bitfield = new bitfield($this->template_bitfield);
}
if ($bbcode_id != -1 && !($this->template_bitfield & (1 << $bbcode_id)))
if ($bbcode_id != -1 && !$template_bitfield->get($bbcode_id))
{
return (isset($bbcode_hardtpl[$tpl_name])) ? $bbcode_hardtpl[$tpl_name] : false;
}

View File

@ -243,7 +243,7 @@ class dbal_mssql extends dbal
{
foreach ($row as $key => $value)
{
$row[$key] = ($value === ' ') ? '' : $value;
$row[$key] = ($value === ' ' && strpos($key, 'bitfield') === false) ? '' : $value;
}
}

View File

@ -47,6 +47,8 @@ class dbal_sqlite extends dbal
{
@sqlite_query('PRAGMA short_column_names = 1', $this->db_connect_id);
}
sqlite_create_function($this->db_connect_id, 'binary_insert', array('dbal_sqlite', '_sql_insert'), 1);
return ($this->db_connect_id) ? true : array('message' => $error);
}
@ -328,6 +330,31 @@ class dbal_sqlite extends dbal
}
}
/**
* Build the proper binary string used for the default
* @access: private
*/
function _sql_insert($mode)
{
if ($mode == 1)
{
$bitfield = new bitfield();
$bitfield->set(0);
$bitfield->set(3);
$bitfield->set(8);
$bitfield->set(9);
$bitfield->set(11);
$bitfield->set(12);
return sqlite_udf_encode_binary($bitfield->data);
}
/*
else
{
return sqlite_udf_encode_binary("\0");
}
*/
}
}
} // if ... define

View File

@ -1857,7 +1857,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb
global $phpbb_root_path, $phpEx;
$uid = '';
$bitfield = 0;
$bitfield = '';
if (!$text)
{
@ -2863,4 +2863,98 @@ function garbage_collection()
$db->sql_close();
}
class bitfield
{
var $data;
function bitfield($bitfield = '')
{
$this->data = $bitfield;
}
function get($n)
{
/**
* Get the ($n / 8)th char
*/
$byte = $n >> 3;
if (!isset($this->data[$byte]))
{
/**
* Of course, if it doesn't exist then the result if FALSE
*/
return FALSE;
}
$c = $this->data[$byte];
/**
* Lookup the ($n % 8)th bit of the byte
*/
$bit = 7 - ($n & 7);
return (bool) (ord($c) & (1 << $bit));
}
function set($n)
{
$byte = $n >> 3;
$bit = 7 - ($n & 7);
if (isset($this->data[$byte]))
{
$this->data[$byte] = $this->data[$byte] | chr(1 << $bit);
}
else
{
if ($byte - strlen($this->data) > 0)
{
$this->data .= str_repeat("\0", $byte - strlen($this->data));
}
$this->data .= chr(1 << $bit);
}
}
function clear($n)
{
$byte = $n >> 3;
if (!isset($this->data[$byte]))
{
return;
}
$bit = 7 - ($n & 7);
$this->data[$byte] = $this->data[$byte] &~ chr(1 << $bit);
}
function get_blob()
{
return $this->data;
}
function get_bin()
{
$bin = '';
$len = strlen($this->data);
for ($i = 0; $i < $len; ++$i)
{
$bin .= str_pad(decbin(ord($this->data[$i])), 8, '0', STR_PAD_LEFT);
}
return $bin;
}
function get_all_set()
{
return array_keys(array_filter(str_split($this->get_bin())));
}
function merge($bitfield)
{
$this->data = $this->data | $bitfield->get_blob();
}
}
?>

View File

@ -832,11 +832,11 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
return false;
}
$bbcode_bitfield = 0;
$bbcode_bitfield = '';
do
{
$rowset[] = $row;
$bbcode_bitfield |= $row['bbcode_bitfield'];
$bbcode_bitfield = $bbcode_bitfield | $row['bbcode_bitfield'];
}
while ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result);
@ -1537,8 +1537,76 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
);
}
$sql = 'INSERT INTO ' . POSTS_TABLE . ' ' .
$db->sql_build_array('INSERT', $sql_data[POSTS_TABLE]['sql']);
$query = '';
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$fields = array();
foreach ($sql_data[POSTS_TABLE]['sql'] as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
case 'sqlite':
$fields = array();
foreach ($sql_data[POSTS_TABLE]['sql'] as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "'" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
default:
$query = $db->sql_build_array('INSERT', $sql_data[POSTS_TABLE]['sql']);
break;
}
$sql = 'INSERT INTO ' . POSTS_TABLE . ' ' . $query;
$db->sql_query($sql);
$data['post_id'] = $db->sql_nextid();
@ -1614,8 +1682,70 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
// Update the posts table
if (isset($sql_data[POSTS_TABLE]['sql']))
{
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$values = array();
foreach ($sql_data as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
case 'sqlite':
$values = array();
foreach ($sql_data as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key ='" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
default:
$query = $db->sql_build_array('UPDATE', $sql_data);
break;
}
$sql = 'UPDATE ' . POSTS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_data[POSTS_TABLE]['sql']) . '
SET ' . $query . '
WHERE post_id = ' . $data['post_id'];
$db->sql_query($sql);
}

View File

@ -1302,15 +1302,145 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr
if (sizeof($sql_data))
{
$query = '';
if ($mode == 'post' || $mode == 'reply' || $mode == 'quote' || $mode == 'quotepost' || $mode == 'forward')
{
$db->sql_query('INSERT INTO ' . PRIVMSGS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_data));
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$fields = array();
foreach ($sql_data as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
case 'sqlite':
$fields = array();
foreach ($sql_data as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "'" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
default:
$query = $db->sql_build_array('INSERT', $sql_data);
break;
}
$db->sql_query('INSERT INTO ' . PRIVMSGS_TABLE . ' ' . $query);
$data['msg_id'] = $db->sql_nextid();
}
else if ($mode == 'edit')
{
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$values = array();
foreach ($sql_data as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'forum_desc_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
case 'sqlite':
$values = array();
foreach ($sql_data as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'forum_desc_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = '" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
default:
$query = $db->sql_build_array('UPDATE', $sql_data);
break;
}
$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
SET message_edit_count = message_edit_count + 1, ' . $db->sql_build_array('UPDATE', $sql_data) . '
SET message_edit_count = message_edit_count + 1, ' . $query . '
WHERE msg_id = ' . $data['msg_id'];
$db->sql_query($sql);
}

View File

@ -186,7 +186,7 @@ function user_add($user_row, $cp_data = false)
'user_sig' => '',
'user_sig_bbcode_uid' => '',
'user_sig_bbcode_bitfield' => 0,
'user_sig_bbcode_bitfield' => '',
);
// Now fill the sql array with not required variables
@ -207,7 +207,75 @@ function user_add($user_row, $cp_data = false)
}
}
$sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$query = '';
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$fields = array();
foreach ($sql_ary as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'user_sig_bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
case 'sqlite':
$fields = array();
foreach ($sql_ary as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'user_sig_bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "'" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
default:
$query = $db->sql_build_array('INSERT', $sql_ary);
break;
}
$sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $query;
$db->sql_query($sql);
$user_id = $db->sql_nextid();
@ -1388,7 +1456,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
'group_name' => (string) $name,
'group_desc' => (string) $desc,
'group_desc_uid' => '',
'group_desc_bitfield' => 0,
'group_desc_bitfield' => '',
'group_type' => (int) $type,
);
@ -1413,15 +1481,144 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
// Setting the log message before we set the group id (if group gets added)
$log = ($group_id) ? 'LOG_GROUP_UPDATED' : 'LOG_GROUP_CREATED';
$query = '';
if ($group_id)
{
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$values = array();
foreach ($sql_ary as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'group_desc_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
case 'sqlite':
$values = array();
foreach ($sql_ary as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'group_desc_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = '" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
default:
$query = $db->sql_build_array('UPDATE', $sql_ary);
break;
}
$sql = 'UPDATE ' . GROUPS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
SET ' . $query . "
WHERE group_id = $group_id";
}
else
{
$sql = 'INSERT INTO ' . GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$fields = array();
foreach ($sql_ary as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
case 'sqlite':
$fields = array();
foreach ($sql_ary as $key => $var)
{
$fields[] = $key;
if (is_null($var))
{
$values[] = 'NULL';
}
else if (is_string($var))
{
if ($key !== 'bbcode_bitfield')
{
$values[] = "'" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "'" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? intval($var) : $var;
}
}
$query = ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';
break;
default:
$query = $db->sql_build_array('INSERT', $sql_ary);
break;
}
$sql = 'INSERT INTO ' . GROUPS_TABLE . ' ' . $query;
}
$db->sql_query($sql);

View File

@ -43,7 +43,9 @@ class bbcode_firstpass extends bbcode
}
global $user;
$this->bbcode_bitfield = 0;
$this->bbcode_bitfield = '';
$bitfield = new bitfield();
$size = strlen($this->message);
foreach ($this->bbcodes as $bbcode_name => $bbcode_data)
@ -72,10 +74,12 @@ class bbcode_firstpass extends bbcode
$new_size = strlen($this->message);
if ($size != $new_size)
{
$this->bbcode_bitfield |= (1 << $bbcode_data['bbcode_id']);
$bitfield->set($bbcode_data['bbcode_id']);
$size = $new_size;
}
}
$this->bbcode_bitfield = $bitfield->get_blob();
}
/**
@ -1376,21 +1380,21 @@ class parse_message extends bbcode_firstpass
// Parse Poll Option text ;)
$tmp_message = $this->message;
$this->message = $poll['poll_option_text'];
$bbcode_bitfield = $this->bbcode_bitfield;
$poll['poll_option_text'] = $this->parse($poll['enable_bbcode'], $poll['enable_urls'], $poll['enable_smilies'], $poll['img_status'], false, false, false);
$this->bbcode_bitfield |= $bbcode_bitfield;
$this->message = $tmp_message;
// Parse Poll Title
$tmp_message = $this->message;
$this->message = $poll['poll_title'];
$bbcode_bitfield = $this->bbcode_bitfield;
$poll['poll_title'] = $this->parse($poll['enable_bbcode'], $poll['enable_urls'], $poll['enable_smilies'], $poll['img_status'], false, false, false);
$this->bbcode_bitfield |= $bbcode_bitfield;
$this->message = $tmp_message;
unset($tmp_message);

View File

@ -316,7 +316,7 @@ class ucp_groups
// Hide hidden groups unless user is an admin with group privileges
$sql_and = ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? '<> ' . GROUP_SPECIAL : 'NOT IN (' . GROUP_SPECIAL . ', ' . GROUP_HIDDEN . ')';
$sql = 'SELECT group_id, group_name, group_desc, group_desc_uid, group_desc_bitfield, group_type
$sql = 'SELECT group_id, group_name, group_desc, group_desc_uid, group_desc_bitfield, group_desc_options, group_type
FROM ' . GROUPS_TABLE . '
WHERE group_id NOT IN (' . implode(', ', $group_id_ary) . ")
AND group_type $sql_and

View File

@ -520,7 +520,7 @@ function compose_pm($id, $mode, $action)
'enable_bbcode' => (bool) $enable_bbcode,
'enable_smilies' => (bool) $enable_smilies,
'enable_urls' => (bool) $enable_urls,
'bbcode_bitfield' => (int) $message_parser->bbcode_bitfield,
'bbcode_bitfield' => $message_parser->bbcode_bitfield,
'bbcode_uid' => $message_parser->bbcode_uid,
'message' => $message_parser->message,
'attachment_data' => $message_parser->attachment_data,

View File

@ -264,7 +264,7 @@ function message_history($msg_id, $user_id, $message_row, $folder)
}
$rowset = array();
$bbcode_bitfield = 0;
$bbcode_bitfield = '';
$folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm') . '&amp;folder=';
$title = ($sort_dir == 'd') ? $row['message_subject'] : '';
@ -281,7 +281,7 @@ function message_history($msg_id, $user_id, $message_row, $folder)
else
{
$rowset[$row['msg_id']] = $row;
$bbcode_bitfield |= $row['bbcode_bitfield'];
$bbcode_bitfield = $bbcode_bitfield | $row['bbcode_bitfield'];
}
}
while ($row = $db->sql_fetchrow($result));

View File

@ -431,17 +431,81 @@ class ucp_profile
{
$error[] = implode('<br />', $message_parser->warn_msg);
}
if (!sizeof($error) && $submit)
{
$sql_ary = array(
'user_sig' => (string) $message_parser->message,
'user_sig_bbcode_uid' => (string) $message_parser->bbcode_uid,
'user_sig_bbcode_bitfield' => (int) $message_parser->bbcode_bitfield
'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield
);
$query = '';
switch (SQL_LAYER)
{
case 'mssql':
case 'mssql_odbc':
$values = array();
foreach ($sql_ary as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'user_sig_bbcode_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = CAST('" . $var . "' AS varbinary)";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
case 'sqlite':
$values = array();
foreach ($sql_ary as $key => $var)
{
if (is_null($var))
{
$values[] = "$key = NULL";
}
else if (is_string($var))
{
if ($key !== 'user_sig_bbcode_bitfield')
{
$values[] = "$key = '" . $db->sql_escape($var) . "'";
}
else
{
$values[] = "$key = '" . sqlite_udf_encode_binary($var) . "'";
}
}
else
{
$values[] = (is_bool($var)) ? "$key = " . intval($var) : "$key = $var";
}
}
$query = implode(', ', $values);
break;
default:
$query = $db->sql_build_array('UPDATE', $sql_ary);
break;
}
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
SET ' . $query . '
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);

View File

@ -1881,7 +1881,7 @@ class install_install extends module
'LABEL' => 'SQLite',
'SCHEMA' => 'sqlite',
'MODULE' => 'sqlite',
'DELIM' => ';',
'DELIM' => ';;',
'COMMENTS' => 'remove_remarks'
),
);

View File

@ -4,6 +4,24 @@
# $Id$
#
# Function declarations
# Emulation of STRLEN, might need to be checked out for FB 2.0
DECLARE EXTERNAL FUNCTION STRLEN CSTRING(32767)
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_strlen' MODULE_NAME 'ib_udf';;
# Emulation of LOWER, might need to be checked out for FB 2.0
DECLARE EXTERNAL FUNCTION LOWER CSTRING(80)
RETURNS CSTRING(80) FREE_IT
ENTRY_POINT 'IB_UDF_lower' MODULE_NAME 'ib_udf';;
# Only used for insertion of binary strings as defaults
DECLARE EXTERNAL FUNCTION ASCII_CHAR INTEGER
RETURNS CSTRING(1) FREE_IT
ENTRY_POINT 'IB_UDF_ascii_char' MODULE_NAME 'ib_udf';;
# Table: 'phpbb_attachments'
CREATE TABLE phpbb_attachments (
attach_id INTEGER NOT NULL,
@ -40,7 +58,6 @@ BEGIN
NEW.attach_id = GEN_ID(phpbb_attachments_gen, 1);
END;;
# Table: 'phpbb_acl_groups'
CREATE TABLE phpbb_acl_groups (
group_id INTEGER DEFAULT 0 NOT NULL,
@ -166,7 +183,7 @@ CREATE TABLE phpbb_bbcodes (
ALTER TABLE phpbb_bbcodes ADD PRIMARY KEY (bbcode_id);;
CREATE INDEX phpbb_bbcodes_display_in_posting ON phpbb_bbcodes(display_on_posting);;
CREATE INDEX phpbb_bbcodes_display_in_post ON phpbb_bbcodes(display_on_posting);;
# Table: 'phpbb_bookmarks'
CREATE TABLE phpbb_bookmarks (
@ -205,7 +222,7 @@ END;;
# Table: 'phpbb_config'
CREATE TABLE phpbb_config (
config_name VARCHAR(255) DEFAULT '' NOT NULL,
config_name VARCHAR(252) DEFAULT '' NOT NULL,
config_value VARCHAR(255) DEFAULT '' NOT NULL,
is_dynamic INTEGER DEFAULT 0 NOT NULL
);;
@ -328,7 +345,7 @@ CREATE TABLE phpbb_forums (
forum_parents BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL,
forum_name BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL,
forum_desc BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL,
forum_desc_bitfield INTEGER DEFAULT 0 NOT NULL,
forum_desc_bitfield CHAR(255) DEFAULT '' NOT NULL,
forum_desc_options INTEGER DEFAULT 0 NOT NULL,
forum_desc_uid VARCHAR(5) DEFAULT '' NOT NULL,
forum_link VARCHAR(255) DEFAULT '' NOT NULL,
@ -337,7 +354,7 @@ CREATE TABLE phpbb_forums (
forum_image VARCHAR(255) DEFAULT '' NOT NULL,
forum_rules BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL,
forum_rules_link VARCHAR(255) DEFAULT '' NOT NULL,
forum_rules_bitfield INTEGER DEFAULT 0 NOT NULL,
forum_rules_bitfield CHAR(255) DEFAULT '' NOT NULL,
forum_rules_options INTEGER DEFAULT 0 NOT NULL,
forum_rules_uid VARCHAR(5) DEFAULT '' NOT NULL,
forum_topics_per_page INTEGER DEFAULT 0 NOT NULL,
@ -376,6 +393,22 @@ BEGIN
NEW.forum_id = GEN_ID(phpbb_forums_gen, 1);
END;;
CREATE TRIGGER t_phpbb_forums_desc_bitf FOR phpbb_forums
ACTIVE BEFORE INSERT OR UPDATE POSITION 0
AS
BEGIN
IF (NEW.forum_desc_bitfield is null) THEN
NEW.forum_desc_bitfield = ASCII_CHAR(0);
END;;
CREATE TRIGGER t_phpbb_forums_rules_bitf FOR phpbb_forums
ACTIVE BEFORE INSERT OR UPDATE POSITION 0
AS
BEGIN
IF (NEW.forum_rules_bitfield is null) THEN
NEW.forum_rules_bitfield = ASCII_CHAR(0);
END;;
# Table: 'phpbb_forums_access'
CREATE TABLE phpbb_forums_access (
@ -406,7 +439,7 @@ CREATE TABLE phpbb_forums_watch (
CREATE INDEX phpbb_forums_watch_forum_id ON phpbb_forums_watch(forum_id);;
CREATE INDEX phpbb_forums_watch_user_id ON phpbb_forums_watch(user_id);;
CREATE INDEX phpbb_forums_watch_notify_status ON phpbb_forums_watch(notify_status);;
CREATE INDEX phpbb_forums_watch_notify_stat ON phpbb_forums_watch(notify_status);;
# Table: 'phpbb_groups'
CREATE TABLE phpbb_groups (
@ -414,7 +447,7 @@ CREATE TABLE phpbb_groups (
group_type INTEGER DEFAULT 1 NOT NULL,
group_name VARCHAR(255) DEFAULT '' NOT NULL,
group_desc BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL,
group_desc_bitfield INTEGER DEFAULT 0 NOT NULL,
group_desc_bitfield CHAR(255) DEFAULT '' NOT NULL,
group_desc_options INTEGER DEFAULT 0 NOT NULL,
group_desc_uid VARCHAR(5) DEFAULT '' NOT NULL,
group_display INTEGER DEFAULT 0 NOT NULL,
@ -444,6 +477,14 @@ BEGIN
NEW.group_id = GEN_ID(phpbb_groups_gen, 1);
END;;
CREATE TRIGGER t_phpbb_groups_bitf FOR phpbb_groups
ACTIVE BEFORE INSERT OR UPDATE POSITION 0
AS
BEGIN
IF (NEW.group_desc_bitfield is null) THEN
NEW.group_desc_bitfield = ASCII_CHAR(0);
END;;
# Table: 'phpbb_icons'
CREATE TABLE phpbb_icons (
@ -537,7 +578,7 @@ CREATE TABLE phpbb_moderator_cache (
display_on_index INTEGER DEFAULT 1 NOT NULL
);;
CREATE INDEX phpbb_moderator_cache_display_on_index ON phpbb_moderator_cache(display_on_index);;
CREATE INDEX phpbb_moderator_cche_dis_on_idx ON phpbb_moderator_cache(display_on_index);;
CREATE INDEX phpbb_moderator_cache_forum_id ON phpbb_moderator_cache(forum_id);;
# Table: 'phpbb_modules'
@ -580,7 +621,7 @@ CREATE TABLE phpbb_poll_options (
poll_option_total INTEGER DEFAULT 0 NOT NULL
);;
CREATE INDEX phpbb_poll_options_poll_option_id ON phpbb_poll_options(poll_option_id);;
CREATE INDEX phpbb_poll_options_poll_opt_id ON phpbb_poll_options(poll_option_id);;
CREATE INDEX phpbb_poll_options_topic_id ON phpbb_poll_options(topic_id);;
# Table: 'phpbb_poll_votes'
@ -616,7 +657,7 @@ CREATE TABLE phpbb_posts (
post_checksum VARCHAR(32) DEFAULT '' NOT NULL,
post_encoding VARCHAR(20) DEFAULT 'iso-8859-1' NOT NULL,
post_attachment INTEGER DEFAULT 0 NOT NULL,
bbcode_bitfield INTEGER DEFAULT 0 NOT NULL,
bbcode_bitfield CHAR(255) DEFAULT '' NOT NULL,
bbcode_uid VARCHAR(5) DEFAULT '' NOT NULL,
post_edit_time INTEGER DEFAULT 0 NOT NULL,
post_edit_reason BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL,
@ -644,6 +685,14 @@ BEGIN
NEW.post_id = GEN_ID(phpbb_posts_gen, 1);
END;;
CREATE TRIGGER t_phpbb_posts_bitf FOR phpbb_posts
ACTIVE BEFORE INSERT OR UPDATE POSITION 0
AS
BEGIN
IF (NEW.bbcode_bitfield is null) THEN
NEW.bbcode_bitfield = ASCII_CHAR(0);
END;;
# Table: 'phpbb_privmsgs'
CREATE TABLE phpbb_privmsgs (
@ -663,7 +712,7 @@ CREATE TABLE phpbb_privmsgs (
message_edit_user INTEGER DEFAULT 0 NOT NULL,
message_encoding VARCHAR(20) DEFAULT 'iso-8859-1' NOT NULL,
message_attachment INTEGER DEFAULT 0 NOT NULL,
bbcode_bitfield INTEGER DEFAULT 0 NOT NULL,
bbcode_bitfield CHAR(255) DEFAULT '' NOT NULL,
bbcode_uid VARCHAR(5) DEFAULT '' NOT NULL,
message_edit_time INTEGER DEFAULT 0 NOT NULL,
message_edit_count INTEGER DEFAULT 0 NOT NULL,
@ -688,6 +737,14 @@ BEGIN
NEW.msg_id = GEN_ID(phpbb_privmsgs_gen, 1);
END;;
CREATE TRIGGER t_phpbb_privmsgs_bitf FOR phpbb_privmsgs
ACTIVE BEFORE INSERT OR UPDATE POSITION 0
AS
BEGIN
IF (NEW.bbcode_bitfield is null) THEN
NEW.bbcode_bitfield = ASCII_CHAR(0);
END;;
# Table: 'phpbb_privmsgs_folder'
CREATE TABLE phpbb_privmsgs_folder (
@ -754,7 +811,7 @@ CREATE TABLE phpbb_privmsgs_to (
);;
CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to(msg_id);;
CREATE INDEX phpbb_privmsgs_to_user_folder_id ON phpbb_privmsgs_to(user_id, folder_id);;
CREATE INDEX phpbb_privmsgs_to_usr_flder_id ON phpbb_privmsgs_to(user_id, folder_id);;
# Table: 'phpbb_profile_fields'
CREATE TABLE phpbb_profile_fields (
@ -779,7 +836,7 @@ CREATE TABLE phpbb_profile_fields (
ALTER TABLE phpbb_profile_fields ADD PRIMARY KEY (field_id);;
CREATE INDEX phpbb_profile_fields_field_type ON phpbb_profile_fields(field_type);;
CREATE INDEX phpbb_profile_fields_field_order ON phpbb_profile_fields(field_order);;
CREATE INDEX phpbb_profile_fields_field_ordr ON phpbb_profile_fields(field_order);;
CREATE GENERATOR phpbb_profile_fields_gen;;
SET GENERATOR phpbb_profile_fields_gen TO 0;;
@ -1005,7 +1062,7 @@ CREATE TABLE phpbb_smilies (
ALTER TABLE phpbb_smilies ADD PRIMARY KEY (smiley_id);;
CREATE INDEX phpbb_smilies_display_on_posting ON phpbb_smilies(display_on_posting);;
CREATE INDEX phpbb_smilies_display_on_postng ON phpbb_smilies(display_on_posting);;
CREATE GENERATOR phpbb_smilies_gen;;
SET GENERATOR phpbb_smilies_gen TO 0;;
@ -1021,7 +1078,7 @@ END;;
# Table: 'phpbb_styles'
CREATE TABLE phpbb_styles (
style_id INTEGER NOT NULL,
style_name VARCHAR(255) DEFAULT '' NOT NULL,
style_name VARCHAR(252) DEFAULT '' NOT NULL,
style_copyright VARCHAR(255) DEFAULT '' NOT NULL,
style_active INTEGER DEFAULT 1 NOT NULL,
template_id INTEGER DEFAULT 0 NOT NULL,
@ -1050,16 +1107,16 @@ END;;
# Table: 'phpbb_styles_template'
CREATE TABLE phpbb_styles_template (
template_id INTEGER NOT NULL,
template_name VARCHAR(255) DEFAULT '' NOT NULL,
template_name VARCHAR(252) DEFAULT '' NOT NULL,
template_copyright VARCHAR(255) DEFAULT '' NOT NULL,
template_path VARCHAR(100) DEFAULT '' NOT NULL,
bbcode_bitfield INTEGER DEFAULT 6921 NOT NULL,
bbcode_bitfield CHAR(255) DEFAULT '' NOT NULL,
template_storedb INTEGER DEFAULT 0 NOT NULL
);;
ALTER TABLE phpbb_styles_template ADD PRIMARY KEY (template_id);;
CREATE UNIQUE INDEX phpbb_styles_template_template_name ON phpbb_styles_template(template_name);;
CREATE UNIQUE INDEX phpbb_styles_template_tmplte_nm ON phpbb_styles_template(template_name);;
CREATE GENERATOR phpbb_styles_template_gen;;
SET GENERATOR phpbb_styles_template_gen TO 0;;
@ -1071,6 +1128,14 @@ BEGIN
NEW.template_id = GEN_ID(phpbb_styles_template_gen, 1);
END;;
CREATE TRIGGER t_phpbb_styles_template_bitf FOR phpbb_styles_template
ACTIVE BEFORE INSERT OR UPDATE POSITION 0
AS
BEGIN
IF (NEW.bbcode_bitfield is null) THEN
NEW.bbcode_bitfield = ASCII_CHAR(144) || ASCII_CHAR(216);
END;;
# Table: 'phpbb_styles_template_data'
CREATE TABLE phpbb_styles_template_data (
@ -1081,13 +1146,13 @@ CREATE TABLE phpbb_styles_template_data (
template_data BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL
);;
CREATE INDEX phpbb_styles_template_data_template_id ON phpbb_styles_template_data(template_id);;
CREATE INDEX phpbb_styles_template_data_template_filename ON phpbb_styles_template_data(template_filename);;
CREATE INDEX phpbb_styles_tmplte_dt_tmplt_id ON phpbb_styles_template_data(template_id);;
CREATE INDEX phpbb_styles_tmplte_d_tmpl_flnm ON phpbb_styles_template_data(template_filename);;
CREATE GENERATOR phpbb_styles_template_data_gen;;
SET GENERATOR phpbb_styles_template_data_gen TO 0;;
CREATE TRIGGER t_phpbb_styles_template_data_gen FOR phpbb_styles_template_data
CREATE TRIGGER t_phpbb_styles_templte_data_gen FOR phpbb_styles_template_data
BEFORE INSERT
AS
BEGIN
@ -1098,7 +1163,7 @@ END;;
# Table: 'phpbb_styles_theme'
CREATE TABLE phpbb_styles_theme (
theme_id INTEGER NOT NULL,
theme_name VARCHAR(255) DEFAULT '' NOT NULL,
theme_name VARCHAR(252) DEFAULT '' NOT NULL,
theme_copyright VARCHAR(255) DEFAULT '' NOT NULL,
theme_path VARCHAR(100) DEFAULT '' NOT NULL,
theme_storedb INTEGER DEFAULT 0 NOT NULL,
@ -1124,7 +1189,7 @@ END;;
# Table: 'phpbb_styles_imageset'
CREATE TABLE phpbb_styles_imageset (
imageset_id INTEGER NOT NULL,
imageset_name VARCHAR(255) DEFAULT '' NOT NULL,
imageset_name VARCHAR(252) DEFAULT '' NOT NULL,
imageset_copyright VARCHAR(255) DEFAULT '' NOT NULL,
imageset_path VARCHAR(100) DEFAULT '' NOT NULL,
site_logo VARCHAR(200) DEFAULT '' NOT NULL,
@ -1220,16 +1285,16 @@ CREATE TABLE phpbb_styles_imageset (
ALTER TABLE phpbb_styles_imageset ADD PRIMARY KEY (imageset_id);;
CREATE UNIQUE INDEX phpbb_styles_imageset_imageset_name ON phpbb_styles_imageset(imageset_name);;
CREATE UNIQUE INDEX phpbb_styles_imageset_imgset_nm ON phpbb_styles_imageset(imageset_name);;
CREATE GENERATOR phpbb_styles_imageset_gen;;
SET GENERATOR phpbb_styles_imageset_gen TO 0;;
CREATE GENERATOR t_phpbb_styles_imageset_gen;;
SET GENERATOR t_phpbb_styles_imageset_gen TO 0;;
CREATE TRIGGER t_phpbb_styles_imageset_gen FOR phpbb_styles_imageset
CREATE TRIGGER phpbb_styles_imageset_imgset_nm FOR phpbb_styles_imageset
BEFORE INSERT
AS
BEGIN
NEW.imageset_id = GEN_ID(phpbb_styles_imageset_gen, 1);
NEW.imageset_id = GEN_ID(t_phpbb_styles_imageset_gen, 1);
END;;
@ -1272,7 +1337,7 @@ ALTER TABLE phpbb_topics ADD PRIMARY KEY (topic_id);;
CREATE INDEX phpbb_topics_forum_id ON phpbb_topics(forum_id);;
CREATE INDEX phpbb_topics_forum_id_type ON phpbb_topics(forum_id, topic_type);;
CREATE INDEX phpbb_topics_topic_last_post_time ON phpbb_topics(topic_last_post_time);;
CREATE INDEX phpbb_topics_topic_last_pst_tme ON phpbb_topics(topic_last_post_time);;
CREATE GENERATOR phpbb_topics_gen;;
SET GENERATOR phpbb_topics_gen TO 0;;
@ -1316,7 +1381,7 @@ CREATE TABLE phpbb_topics_watch (
CREATE INDEX phpbb_topics_watch_topic_id ON phpbb_topics_watch(topic_id);;
CREATE INDEX phpbb_topics_watch_user_id ON phpbb_topics_watch(user_id);;
CREATE INDEX phpbb_topics_watch_notify_status ON phpbb_topics_watch(notify_status);;
CREATE INDEX phpbb_topics_watch_notify_stat ON phpbb_topics_watch(notify_status);;
# Table: 'phpbb_user_group'
CREATE TABLE phpbb_user_group (
@ -1339,7 +1404,7 @@ CREATE TABLE phpbb_users (
user_perm_from INTEGER DEFAULT 0 NOT NULL,
user_ip VARCHAR(40) DEFAULT '' NOT NULL,
user_regdate INTEGER DEFAULT 0 NOT NULL,
username VARCHAR(255) DEFAULT '' NOT NULL,
username VARCHAR(252) DEFAULT '' NOT NULL,
user_password VARCHAR(40) DEFAULT '' NOT NULL,
user_passchg INTEGER DEFAULT 0 NOT NULL,
user_email VARCHAR(100) DEFAULT '' NOT NULL,
@ -1389,7 +1454,7 @@ CREATE TABLE phpbb_users (
user_avatar_height INTEGER DEFAULT 0 NOT NULL,
user_sig BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL,
user_sig_bbcode_uid VARCHAR(5) DEFAULT '' NOT NULL,
user_sig_bbcode_bitfield INTEGER DEFAULT 0 NOT NULL,
user_sig_bbcode_bitfield CHAR(255) DEFAULT '' NOT NULL,
user_from VARCHAR(100) DEFAULT '' NOT NULL,
user_icq VARCHAR(15) DEFAULT '' NOT NULL,
user_aim VARCHAR(255) DEFAULT '' NOT NULL,
@ -1420,6 +1485,14 @@ BEGIN
NEW.user_id = GEN_ID(phpbb_users_gen, 1);
END;;
CREATE TRIGGER t_phpbb_users_bitf FOR phpbb_users
ACTIVE BEFORE INSERT OR UPDATE POSITION 0
AS
BEGIN
IF (NEW.user_sig_bbcode_bitfield is null) THEN
NEW.user_sig_bbcode_bitfield = ASCII_CHAR(0);
END;;
# Table: 'phpbb_warnings'
CREATE TABLE phpbb_warnings (
@ -1474,16 +1547,4 @@ CREATE TABLE phpbb_zebra (
);;
CREATE INDEX phpbb_zebra_user_id ON phpbb_zebra(user_id);;
CREATE INDEX phpbb_zebra_zebra_id ON phpbb_zebra(zebra_id);;
DECLARE EXTERNAL FUNCTION STRLEN
CSTRING(32767)
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_strlen' MODULE_NAME 'ib_udf';;
DECLARE EXTERNAL FUNCTION LOWER CSTRING(80)
RETURNS CSTRING(80) FREE_IT
ENTRY_POINT 'IB_UDF_lower' MODULE_NAME 'ib_udf';;
CREATE INDEX phpbb_zebra_zebra_id ON phpbb_zebra(zebra_id);;

View File

@ -352,7 +352,7 @@ CREATE TABLE [phpbb_forums] (
[forum_parents] [text] DEFAULT ('') NOT NULL ,
[forum_name] [varchar] (3000) DEFAULT ('') NOT NULL ,
[forum_desc] [varchar] (8000) DEFAULT ('') NOT NULL ,
[forum_desc_bitfield] [int] DEFAULT (0) NOT NULL ,
[forum_desc_bitfield] [varbinary] (255) DEFAULT (0x) NOT NULL ,
[forum_desc_options] [int] DEFAULT (0) NOT NULL ,
[forum_desc_uid] [varchar] (5) DEFAULT ('') NOT NULL ,
[forum_link] [varchar] (255) DEFAULT ('') NOT NULL ,
@ -361,7 +361,7 @@ CREATE TABLE [phpbb_forums] (
[forum_image] [varchar] (255) DEFAULT ('') NOT NULL ,
[forum_rules] [varchar] (8000) DEFAULT ('') NOT NULL ,
[forum_rules_link] [varchar] (255) DEFAULT ('') NOT NULL ,
[forum_rules_bitfield] [int] DEFAULT (0) NOT NULL ,
[forum_rules_bitfield] [varbinary] (255) DEFAULT (0x) NOT NULL ,
[forum_rules_options] [int] DEFAULT (0) NOT NULL ,
[forum_rules_uid] [varchar] (5) DEFAULT ('') NOT NULL ,
[forum_topics_per_page] [int] DEFAULT (0) NOT NULL ,
@ -459,7 +459,7 @@ CREATE TABLE [phpbb_groups] (
[group_type] [int] DEFAULT (1) NOT NULL ,
[group_name] [varchar] (255) DEFAULT ('') NOT NULL ,
[group_desc] [varchar] (8000) DEFAULT ('') NOT NULL ,
[group_desc_bitfield] [int] DEFAULT (0) NOT NULL ,
[group_desc_bitfield] [varbinary] DEFAULT (0x) NOT NULL ,
[group_desc_options] [int] DEFAULT (0) NOT NULL ,
[group_desc_uid] [varchar] (5) DEFAULT ('') NOT NULL ,
[group_display] [int] DEFAULT (0) NOT NULL ,
@ -673,7 +673,7 @@ CREATE TABLE [phpbb_posts] (
[post_checksum] [varchar] (32) DEFAULT ('') NOT NULL ,
[post_encoding] [varchar] (20) DEFAULT ('iso-8859-1') NOT NULL ,
[post_attachment] [int] DEFAULT (0) NOT NULL ,
[bbcode_bitfield] [int] DEFAULT (0) NOT NULL ,
[bbcode_bitfield] [varbinary] (255) DEFAULT (0x) NOT NULL ,
[bbcode_uid] [varchar] (5) DEFAULT ('') NOT NULL ,
[post_edit_time] [int] DEFAULT (0) NOT NULL ,
[post_edit_reason] [varchar] (3000) DEFAULT ('') NOT NULL ,
@ -727,7 +727,7 @@ CREATE TABLE [phpbb_privmsgs] (
[message_edit_user] [int] DEFAULT (0) NOT NULL ,
[message_encoding] [varchar] (20) DEFAULT ('iso-8859-1') NOT NULL ,
[message_attachment] [int] DEFAULT (0) NOT NULL ,
[bbcode_bitfield] [int] DEFAULT (0) NOT NULL ,
[bbcode_bitfield] [varbinary] (255) DEFAULT (0x) NOT NULL ,
[bbcode_uid] [varchar] (5) DEFAULT ('') NOT NULL ,
[message_edit_time] [int] DEFAULT (0) NOT NULL ,
[message_edit_count] [int] DEFAULT (0) NOT NULL ,
@ -1142,7 +1142,7 @@ CREATE TABLE [phpbb_styles_template] (
[template_name] [varchar] (255) DEFAULT ('') NOT NULL ,
[template_copyright] [varchar] (255) DEFAULT ('') NOT NULL ,
[template_path] [varchar] (100) DEFAULT ('') NOT NULL ,
[bbcode_bitfield] [int] DEFAULT (6921) NOT NULL ,
[bbcode_bitfield] [varbinary] (255) DEFAULT (0x90D8) NOT NULL ,
[template_storedb] [int] DEFAULT (0) NOT NULL
) ON [PRIMARY]
GO
@ -1494,7 +1494,7 @@ CREATE TABLE [phpbb_users] (
[user_avatar_height] [int] DEFAULT (0) NOT NULL ,
[user_sig] [text] DEFAULT ('') NOT NULL ,
[user_sig_bbcode_uid] [varchar] (5) DEFAULT ('') NOT NULL ,
[user_sig_bbcode_bitfield] [int] DEFAULT (0) NOT NULL ,
[user_sig_bbcode_bitfield] [varbinary] DEFAULT (255) NOT NULL ,
[user_from] [varchar] (100) DEFAULT ('') NOT NULL ,
[user_icq] [varchar] (15) DEFAULT ('') NOT NULL ,
[user_aim] [varchar] (255) DEFAULT ('') NOT NULL ,

View File

@ -216,7 +216,7 @@ CREATE TABLE phpbb_forums (
forum_parents mediumtext DEFAULT '' NOT NULL,
forum_name text DEFAULT '' NOT NULL,
forum_desc text DEFAULT '' NOT NULL,
forum_desc_bitfield int(11) UNSIGNED DEFAULT '0' NOT NULL,
forum_desc_bitfield varbinary(255) DEFAULT '\0' NOT NULL,
forum_desc_options int(11) UNSIGNED DEFAULT '0' NOT NULL,
forum_desc_uid varchar(5) DEFAULT '' NOT NULL,
forum_link varchar(255) DEFAULT '' NOT NULL,
@ -225,7 +225,7 @@ CREATE TABLE phpbb_forums (
forum_image varchar(255) DEFAULT '' NOT NULL,
forum_rules text DEFAULT '' NOT NULL,
forum_rules_link varchar(255) DEFAULT '' NOT NULL,
forum_rules_bitfield int(11) UNSIGNED DEFAULT '0' NOT NULL,
forum_rules_bitfield varbinary(255) DEFAULT '\0' NOT NULL,
forum_rules_options int(11) UNSIGNED DEFAULT '0' NOT NULL,
forum_rules_uid varchar(5) DEFAULT '' NOT NULL,
forum_topics_per_page tinyint(4) DEFAULT '0' NOT NULL,
@ -288,7 +288,7 @@ CREATE TABLE phpbb_groups (
group_type tinyint(4) DEFAULT '1' NOT NULL,
group_name varchar(255) DEFAULT '' NOT NULL,
group_desc text DEFAULT '' NOT NULL,
group_desc_bitfield int(11) UNSIGNED DEFAULT '0' NOT NULL,
group_desc_bitfield varbinary(255) DEFAULT '\0' NOT NULL,
group_desc_options int(11) UNSIGNED DEFAULT '0' NOT NULL,
group_desc_uid varchar(5) DEFAULT '' NOT NULL,
group_display tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
@ -430,7 +430,7 @@ CREATE TABLE phpbb_posts (
post_checksum varchar(32) DEFAULT '' NOT NULL,
post_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL,
post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
bbcode_bitfield int(11) UNSIGNED DEFAULT '0' NOT NULL,
bbcode_bitfield varbinary(255) DEFAULT '\0' NOT NULL,
bbcode_uid varchar(5) DEFAULT '' NOT NULL,
post_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
post_edit_reason text DEFAULT '' NOT NULL,
@ -465,7 +465,7 @@ CREATE TABLE phpbb_privmsgs (
message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
message_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL,
message_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
bbcode_bitfield int(11) UNSIGNED DEFAULT '0' NOT NULL,
bbcode_bitfield varbinary(255) DEFAULT '\0' NOT NULL,
bbcode_uid varchar(5) DEFAULT '' NOT NULL,
message_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
message_edit_count smallint(4) UNSIGNED DEFAULT '0' NOT NULL,
@ -717,7 +717,7 @@ CREATE TABLE phpbb_styles_template (
template_name varchar(255) DEFAULT '' NOT NULL,
template_copyright varchar(255) DEFAULT '' NOT NULL,
template_path varchar(100) DEFAULT '' NOT NULL,
bbcode_bitfield int(11) UNSIGNED DEFAULT '6921' NOT NULL,
bbcode_bitfield varbinary(255) DEFAULT 0x90D8 NOT NULL,
template_storedb tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (template_id),
UNIQUE template_name (template_name)
@ -992,7 +992,7 @@ CREATE TABLE phpbb_users (
user_avatar_height tinyint(4) DEFAULT '0' NOT NULL,
user_sig mediumtext DEFAULT '' NOT NULL,
user_sig_bbcode_uid varchar(5) DEFAULT '' NOT NULL,
user_sig_bbcode_bitfield int(11) UNSIGNED DEFAULT '0' NOT NULL,
user_sig_bbcode_bitfield varbinary(255) DEFAULT '\0' NOT NULL,
user_from varchar(100) DEFAULT '' NOT NULL,
user_icq varchar(15) DEFAULT '' NOT NULL,
user_aim varchar(255) DEFAULT '' NOT NULL,

View File

@ -432,7 +432,7 @@ CREATE TABLE phpbb_forums (
forum_parents clob DEFAULT '' NOT NULL,
forum_name varchar2(3000) DEFAULT '' NOT NULL,
forum_desc clob DEFAULT '' NOT NULL,
forum_desc_bitfield number(11) DEFAULT '0' NOT NULL,
forum_desc_bitfield raw(255) DEFAULT '' NOT NULL,
forum_desc_options number(1) DEFAULT '0' NOT NULL,
forum_desc_uid varchar2(5) DEFAULT '' NOT NULL,
forum_link varchar2(255) DEFAULT '' NOT NULL,
@ -441,7 +441,7 @@ CREATE TABLE phpbb_forums (
forum_image varchar2(255) DEFAULT '' NOT NULL,
forum_rules clob DEFAULT '' NOT NULL,
forum_rules_link varchar2(255) DEFAULT '' NOT NULL,
forum_rules_bitfield number(11) DEFAULT '0' NOT NULL,
forum_rules_bitfield raw(255) DEFAULT '' NOT NULL,
forum_rules_options number(1) DEFAULT '0' NOT NULL,
forum_rules_uid varchar2(5) DEFAULT '' NOT NULL,
forum_topics_per_page number(4) DEFAULT '0' NOT NULL,
@ -529,7 +529,7 @@ CREATE TABLE phpbb_groups (
group_type number(4) DEFAULT '1' NOT NULL,
group_name varchar2(255) DEFAULT '' NOT NULL,
group_desc clob DEFAULT '' NOT NULL,
group_desc_bitfield number(11) DEFAULT '0' NOT NULL,
group_desc_bitfield raw(255) DEFAULT '' NOT NULL,
group_desc_options number(1) DEFAULT '0' NOT NULL,
group_desc_uid varchar2(5) DEFAULT '' NOT NULL,
group_display number(1) DEFAULT '0' NOT NULL,
@ -776,7 +776,7 @@ CREATE TABLE phpbb_posts (
post_checksum varchar2(32) DEFAULT '' NOT NULL,
post_encoding varchar2(20) DEFAULT 'iso-8859-1' NOT NULL,
post_attachment number(1) DEFAULT '0' NOT NULL,
bbcode_bitfield number(11) DEFAULT '0' NOT NULL,
bbcode_bitfield raw(255) DEFAULT '' NOT NULL,
bbcode_uid varchar2(5) DEFAULT '' NOT NULL,
post_edit_time number(11) DEFAULT '0' NOT NULL,
post_edit_reason varchar2(3000) DEFAULT '' NOT NULL,
@ -834,7 +834,7 @@ CREATE TABLE phpbb_privmsgs (
message_edit_user number(8) DEFAULT '0' NOT NULL,
message_encoding varchar2(20) DEFAULT 'iso-8859-1' NOT NULL,
message_attachment number(1) DEFAULT '0' NOT NULL,
bbcode_bitfield number(11) DEFAULT '0' NOT NULL,
bbcode_bitfield raw(255) DEFAULT '' NOT NULL,
bbcode_uid varchar2(5) DEFAULT '' NOT NULL,
message_edit_time number(11) DEFAULT '0' NOT NULL,
message_edit_count number(4) DEFAULT '0' NOT NULL,
@ -1299,7 +1299,7 @@ CREATE TABLE phpbb_styles_template (
template_name varchar2(255) DEFAULT '' NOT NULL,
template_copyright varchar2(255) DEFAULT '' NOT NULL,
template_path varchar2(100) DEFAULT '' NOT NULL,
bbcode_bitfield number(11) DEFAULT '6921' NOT NULL,
bbcode_bitfield raw(255) DEFAULT '90D8' NOT NULL,
template_storedb number(1) DEFAULT '0' NOT NULL,
CONSTRAINT pk_phpbb_styles_template PRIMARY KEY (template_id),
CONSTRAINT u_phpbb_template_name UNIQUE (template_name)
@ -1675,7 +1675,7 @@ CREATE TABLE phpbb_users (
user_avatar_height number(4) DEFAULT '0' NOT NULL,
user_sig clob DEFAULT '' NOT NULL,
user_sig_bbcode_uid varchar2(5) DEFAULT '' NOT NULL,
user_sig_bbcode_bitfield number(11) DEFAULT '0' NOT NULL,
user_sig_bbcode_bitfield raw(255) DEFAULT '' NOT NULL,
user_from varchar2(100) DEFAULT '' NOT NULL,
user_icq varchar2(15) DEFAULT '' NOT NULL,
user_aim varchar2(255) DEFAULT '' NOT NULL,

View File

@ -308,7 +308,8 @@ CREATE TABLE phpbb_forums (
forum_parents TEXT DEFAULT '' NOT NULL,
forum_name varchar(3000) DEFAULT '' NOT NULL,
forum_desc varchar(8000) DEFAULT '' NOT NULL,
forum_desc_bitfield INT4 DEFAULT '0' NOT NULL CHECK (forum_desc_bitfield >= 0),
forum_desc_bitfield bytea DEFAULT '\000' NOT NULL,
forum_desc_options INT4 DEFAULT 0 NOT NULL,
forum_desc_uid varchar(5) DEFAULT '' NOT NULL,
forum_link varchar(255) DEFAULT '' NOT NULL,
forum_password varchar(40) DEFAULT '' NOT NULL,
@ -316,7 +317,8 @@ CREATE TABLE phpbb_forums (
forum_image varchar(255) DEFAULT '' NOT NULL,
forum_rules varchar(8000) DEFAULT '' NOT NULL,
forum_rules_link varchar(255) DEFAULT '' NOT NULL,
forum_rules_bitfield INT4 DEFAULT '0' NOT NULL CHECK (forum_rules_bitfield >= 0),
forum_rules_bitfield bytea DEFAULT '\000' NOT NULL,
forum_rules_options INT4 DEFAULT 0 NOT NULL,
forum_rules_uid varchar(5) DEFAULT '' NOT NULL,
forum_topics_per_page INT2 DEFAULT '0' NOT NULL,
forum_type INT2 DEFAULT '0' NOT NULL,
@ -380,7 +382,7 @@ CREATE TABLE phpbb_groups (
group_type INT2 DEFAULT '1' NOT NULL,
group_name varchar_ci DEFAULT '' NOT NULL,
group_desc varchar(8000) DEFAULT '' NOT NULL,
group_desc_bitfield INT4 DEFAULT '0' NOT NULL CHECK (group_desc_bitfield >= 0),
group_desc_bitfield bytea DEFAULT '\000' NOT NULL,
group_desc_uid varchar(5) DEFAULT '' NOT NULL,
group_display INT2 DEFAULT '0' NOT NULL CHECK (group_display >= 0),
group_avatar varchar(255) DEFAULT '' NOT NULL,
@ -531,7 +533,7 @@ CREATE TABLE phpbb_posts (
post_checksum varchar(32) DEFAULT '' NOT NULL,
post_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL,
post_attachment INT2 DEFAULT '0' NOT NULL CHECK (post_attachment >= 0),
bbcode_bitfield INT4 DEFAULT '0' NOT NULL CHECK (bbcode_bitfield >= 0),
bbcode_bitfield bytea DEFAULT '\000' NOT NULL,
bbcode_uid varchar(5) DEFAULT '' NOT NULL,
post_edit_time INT4 DEFAULT '0' NOT NULL CHECK (post_edit_time >= 0),
post_edit_reason varchar(3000) DEFAULT '' NOT NULL,
@ -568,7 +570,7 @@ CREATE TABLE phpbb_privmsgs (
message_edit_user INT4 DEFAULT '0' NOT NULL CHECK (message_edit_user >= 0),
message_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL,
message_attachment INT2 DEFAULT '0' NOT NULL CHECK (message_attachment >= 0),
bbcode_bitfield INT4 DEFAULT '0' NOT NULL CHECK (bbcode_bitfield >= 0),
bbcode_bitfield bytea DEFAULT '\000' NOT NULL,
bbcode_uid varchar(5) DEFAULT '' NOT NULL,
message_edit_time INT4 DEFAULT '0' NOT NULL CHECK (message_edit_time >= 0),
message_edit_count INT2 DEFAULT '0' NOT NULL CHECK (message_edit_count >= 0),
@ -690,7 +692,7 @@ CREATE SEQUENCE phpbb_ranks_seq;
CREATE TABLE phpbb_ranks (
rank_id INT4 DEFAULT nextval('phpbb_ranks_seq'),
rank_title varchar(255) DEFAULT '' NOT NULL,
rank_min INT4 DEFAULT '0' NOT NULL CHECK (rank_min >= 0),
rank_min INT4 DEFAULT '0' NOT NULL CHECK (rank_min >= -1),
rank_special INT2 DEFAULT '0' NOT NULL CHECK (rank_special >= 0),
rank_image varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (rank_id)
@ -842,7 +844,7 @@ CREATE TABLE phpbb_styles_template (
template_name varchar(255) DEFAULT '' NOT NULL,
template_copyright varchar(255) DEFAULT '' NOT NULL,
template_path varchar(100) DEFAULT '' NOT NULL,
bbcode_bitfield INT4 DEFAULT '6921' NOT NULL CHECK (bbcode_bitfield >= 0),
bbcode_bitfield bytea DEFAULT '\220\330' NOT NULL,
template_storedb INT2 DEFAULT '0' NOT NULL CHECK (template_storedb >= 0),
PRIMARY KEY (template_id)
);
@ -1127,7 +1129,7 @@ CREATE TABLE phpbb_users (
user_avatar_height INT2 DEFAULT '0' NOT NULL,
user_sig TEXT DEFAULT '' NOT NULL,
user_sig_bbcode_uid varchar(5) DEFAULT '' NOT NULL,
user_sig_bbcode_bitfield INT4 DEFAULT '0' NOT NULL CHECK (user_sig_bbcode_bitfield >= 0),
user_sig_bbcode_bitfield bytea DEFAULT '\000' NOT NULL,
user_from varchar(100) DEFAULT '' NOT NULL,
user_icq varchar(15) DEFAULT '' NOT NULL,
user_aim varchar(255) DEFAULT '' NOT NULL,

View File

@ -384,7 +384,7 @@ INSERT INTO phpbb_styles (style_name, style_copyright, template_id, theme_id, im
INSERT INTO phpbb_styles_imageset (imageset_name, imageset_copyright, imageset_path, site_logo, btn_post, btn_post_pm, btn_reply, btn_reply_pm, btn_locked, btn_profile, btn_pm, btn_delete, btn_info, btn_quote, btn_search, btn_edit, btn_report, btn_email, btn_www, btn_icq, btn_aim, btn_yim, btn_msnm, btn_jabber, btn_online, btn_offline, btn_friend, btn_foe, icon_unapproved, icon_reported, icon_attach, icon_post, icon_post_new, icon_post_latest, icon_post_newest, forum, forum_new, forum_locked, forum_link, sub_forum, sub_forum_new, folder, folder_moved, folder_posted, folder_new, folder_new_posted, folder_hot, folder_hot_posted, folder_hot_new, folder_hot_new_posted, folder_locked, folder_locked_posted, folder_locked_new, folder_locked_new_posted, folder_locked_announce, folder_locked_announce_new, folder_locked_announce_posted, folder_locked_announce_new_posted, folder_locked_global, folder_locked_global_new, folder_locked_global_posted, folder_locked_global_new_posted, folder_locked_sticky, folder_locked_sticky_new, folder_locked_sticky_posted, folder_locked_sticky_new_posted, folder_sticky, folder_sticky_posted, folder_sticky_new, folder_sticky_new_posted, folder_announce, folder_announce_posted, folder_announce_new, folder_announce_new_posted, folder_global, folder_global_posted, folder_global_new, folder_global_new_posted, poll_left, poll_center, poll_right, attach_progress_bar, user_icon1, user_icon2, user_icon3, user_icon4, user_icon5, user_icon6, user_icon7, user_icon8, user_icon9, user_icon10) VALUES ('subSilver', '&copy; phpBB Group', 'subSilver', 'sitelogo.gif*94*170', '{LANG}/btn_post.gif*27*97', '{LANG}/btn_post_pm.gif*27*97', '{LANG}/btn_reply.gif*27*97', '{LANG}/btn_reply_pm.gif*20*90', '{LANG}/btn_locked.gif*27*97', '{LANG}/btn_profile.gif*20*72', '{LANG}/btn_pm.gif*20*72', '{LANG}/btn_delete.gif*20*20', '{LANG}/btn_info.gif*20*20', '{LANG}/btn_quote.gif*20*90', '{LANG}/btn_search.gif*20*72', '{LANG}/btn_edit.gif*20*90', '{LANG}/btn_report.gif*20*20', '{LANG}/btn_email.gif*20*72', '{LANG}/btn_www.gif*20*72', '{LANG}/btn_icq.gif*20*72', '{LANG}/btn_aim.gif*20*72', '{LANG}/btn_yim.gif*20*72', '{LANG}/btn_msnm.gif*20*72', '{LANG}/btn_jabber.gif*20*72', '{LANG}/btn_online.gif*20*72', '{LANG}/btn_offline.gif*20*72', '', '', 'icon_unapproved.gif*18*19', 'icon_reported.gif*18*19', 'icon_attach.gif*18*14', 'icon_minipost.gif*9*12', 'icon_minipost_new.gif*9*12', 'icon_latest_reply.gif*9*18', 'icon_newest_reply.gif*9*18', 'folder_big.gif*25*46', 'folder_new_big.gif*25*46', 'folder_locked_big.gif*25*46', 'folder_link_big.gif*25*46', 'subfolder_big.gif*25*46', 'subfolder_new_big.gif*25*46', 'folder.gif*18*19', 'folder_moved.gif*18*19', 'folder_posted.gif*18*19', 'folder_new.gif*18*19', 'folder_new_posted.gif*18*19', 'folder_hot.gif*18*19', 'folder_hot_posted.gif*18*19', 'folder_new_hot.gif*18*19', 'folder_new_hot_posted.gif*18*19', 'folder_lock.gif*18*19', 'folder_lock_posted.gif*18*19', 'folder_lock_new.gif*18*19', 'folder_lock_new_posted.gif*18*19', 'folder_lock_announce.gif*18*19', 'folder_lock_announce_new.gif*18*19', 'folder_lock_announce_posted.gif*18*19', 'folder_lock_announce_new_posted.gif*18*19', 'folder_lock_announce.gif*18*19', 'folder_lock_announce_new.gif*18*19', 'folder_lock_announce_posted.gif*18*19', 'folder_lock_announce_new_posted.gif*18*19', 'folder_lock_sticky.gif*18*19', 'folder_lock_sticky_new.gif*18*19', 'folder_lock_sticky_posted.gif*18*19', 'folder_lock_sticky_new_posted.gif*18*19', 'folder_sticky.gif*18*19', 'folder_sticky_posted.gif*18*19', 'folder_sticky_new.gif*18*19', 'folder_sticky_new_posted.gif*18*19', 'folder_announce.gif*18*19', 'folder_announce_posted.gif*18*19', 'folder_announce_new.gif*18*19', 'folder_announce_new_posted.gif*18*19', 'folder_announce.gif*18*19', 'folder_announce_posted.gif*18*19', 'folder_announce_new.gif*18*19', 'folder_announce_new_posted.gif*18*19', 'vote_lcap.gif*12*4', 'voting_bar.gif*12', 'vote_rcap.gif*12*4', 'progress_bar.gif*16*280', '', '', '', '', '', '', '', '', '', '');
# -- phpbb_styles_template
INSERT INTO phpbb_styles_template (template_name, template_copyright, template_path, bbcode_bitfield) VALUES ('subSilver', '&copy; phpBB Group', 'subSilver', 6921);
INSERT INTO phpbb_styles_template (template_name, template_copyright, template_path) VALUES ('subSilver', '&copy; phpBB Group', 'subSilver');
# -- phpbb_styles_theme
INSERT INTO phpbb_styles_theme (theme_name, theme_copyright, theme_path, theme_data) VALUES ('subSilver', '&copy; phpBB Group', 'subSilver', '');

File diff suppressed because it is too large Load Diff

View File

@ -868,7 +868,7 @@ if ($submit || $preview || $refresh)
'notify_set' => $post_data['notify_set'],
'poster_ip' => (isset($post_data['poster_ip'])) ? $post_data['poster_ip'] : $user->ip,
'post_edit_locked' => (int) $post_data['post_edit_locked'],
'bbcode_bitfield' => (int) $message_parser->bbcode_bitfield,
'bbcode_bitfield' => $message_parser->bbcode_bitfield,
'bbcode_uid' => $message_parser->bbcode_uid,
'message' => $message_parser->message,
'attachment_data' => $message_parser->attachment_data,

View File

@ -796,8 +796,8 @@ else
// Container for user details, only process once
$post_list = $user_cache = $id_cache = $attachments = $attach_list = $rowset = $update_count = $post_edit_list = array();
$has_attachments = $display_notice = false;
$force_encoding = '';
$bbcode_bitfield = $i = $i_total = 0;
$bbcode_bitfield = $force_encoding = '';
$i = $i_total = 0;
// Go ahead and pull all data for this topic
$sql = 'SELECT p.post_id
@ -917,12 +917,12 @@ while ($row = $db->sql_fetchrow($result))
);
// Define the global bbcode bitfield, will be used to load bbcodes
$bbcode_bitfield |= $row['bbcode_bitfield'];
$bbcode_bitfield = $bbcode_bitfield | $row['bbcode_bitfield'];
// Is a signature attached? Are we going to display it?
if ($row['enable_sig'] && $config['allow_sig'] && $user->optionget('viewsigs'))
{
$bbcode_bitfield |= $row['user_sig_bbcode_bitfield'];
$bbcode_bitfield = $bbcode_bitfield | $row['user_sig_bbcode_bitfield'];
}
// Cache various user specific data ... so we don't have to recompute