#i72


git-svn-id: file:///svn/phpbb/trunk@8128 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M 2007-10-04 04:42:39 +00:00
parent 4f094bdb48
commit eca02ecbf3
12 changed files with 17 additions and 11 deletions

View file

@ -1285,7 +1285,7 @@ function get_schema_struct()
'post_checksum' => array('VCHAR:32', ''),
'post_attachment' => array('BOOL', 0),
'bbcode_bitfield' => array('VCHAR:255', ''),
'bbcode_uid' => array('VCHAR:5', ''),
'bbcode_uid' => array('VCHAR:8', ''),
'post_postcount' => array('BOOL', 1),
'post_edit_time' => array('TIMESTAMP', 0),
'post_edit_reason' => array('STEXT_UNI', ''),

View file

@ -140,7 +140,7 @@ define('ATTACHMENT_CATEGORY_FLASH', 5); // Flash/SWF files
define('ATTACHMENT_CATEGORY_QUICKTIME', 6); // Quicktime/Mov files
// BBCode UID length
define('BBCODE_UID_LEN', 5);
define('BBCODE_UID_LEN', 8);
// Number of core BBCodes
define('NUM_CORE_BBCODES', 12);

View file

@ -1006,7 +1006,7 @@ class parse_message extends bbcode_firstpass
function parse_message($message = '')
{
// Init BBCode UID
$this->bbcode_uid = substr(md5(time()), 0, BBCODE_UID_LEN);
$this->bbcode_uid = substr(base_convert(unique_id(), 16, 36), 0, BBCODE_UID_LEN);
if ($message)
{

View file

@ -432,6 +432,12 @@ $database_update_info = array(
'user_form_salt' => array('VCHAR_UNI:32', ''),
),
),
// Change the following columns
'change_columns' => array(
POSTS_TABLE => array(
'bbcode_uid' => array('VCHAR_UNI:8', ''),
),
),
),
);

View file

@ -629,7 +629,7 @@ CREATE TABLE phpbb_posts (
post_checksum VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
post_attachment INTEGER DEFAULT 0 NOT NULL,
bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
bbcode_uid VARCHAR(5) CHARACTER SET NONE DEFAULT '' NOT NULL,
bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
post_postcount INTEGER DEFAULT 1 NOT NULL,
post_edit_time INTEGER DEFAULT 0 NOT NULL,
post_edit_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,

View file

@ -764,7 +764,7 @@ CREATE TABLE [phpbb_posts] (
[post_checksum] [varchar] (32) DEFAULT ('') NOT NULL ,
[post_attachment] [int] DEFAULT (0) NOT NULL ,
[bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
[bbcode_uid] [varchar] (5) DEFAULT ('') NOT NULL ,
[bbcode_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
[post_postcount] [int] DEFAULT (1) NOT NULL ,
[post_edit_time] [int] DEFAULT (0) NOT NULL ,
[post_edit_reason] [varchar] (255) DEFAULT ('') NOT NULL ,

View file

@ -441,7 +441,7 @@ CREATE TABLE phpbb_posts (
post_checksum varbinary(32) DEFAULT '' NOT NULL,
post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
bbcode_bitfield varbinary(255) DEFAULT '' NOT NULL,
bbcode_uid varbinary(5) DEFAULT '' NOT NULL,
bbcode_uid varbinary(8) DEFAULT '' NOT NULL,
post_postcount tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
post_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
post_edit_reason blob NOT NULL,

View file

@ -441,7 +441,7 @@ CREATE TABLE phpbb_posts (
post_checksum varchar(32) DEFAULT '' NOT NULL,
post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
bbcode_uid varchar(5) DEFAULT '' NOT NULL,
bbcode_uid varchar(8) DEFAULT '' NOT NULL,
post_postcount tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
post_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
post_edit_reason varchar(255) DEFAULT '' NOT NULL,

View file

@ -853,7 +853,7 @@ CREATE TABLE phpbb_posts (
post_checksum varchar2(32) DEFAULT '' ,
post_attachment number(1) DEFAULT '0' NOT NULL,
bbcode_bitfield varchar2(255) DEFAULT '' ,
bbcode_uid varchar2(5) DEFAULT '' ,
bbcode_uid varchar2(8) DEFAULT '' ,
post_postcount number(1) DEFAULT '1' NOT NULL,
post_edit_time number(11) DEFAULT '0' NOT NULL,
post_edit_reason varchar2(765) DEFAULT '' ,

View file

@ -610,7 +610,7 @@ CREATE TABLE phpbb_posts (
post_checksum varchar(32) DEFAULT '' NOT NULL,
post_attachment INT2 DEFAULT '0' NOT NULL CHECK (post_attachment >= 0),
bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
bbcode_uid varchar(5) DEFAULT '' NOT NULL,
bbcode_uid varchar(8) DEFAULT '' NOT NULL,
post_postcount INT2 DEFAULT '1' NOT NULL CHECK (post_postcount >= 0),
post_edit_time INT4 DEFAULT '0' NOT NULL CHECK (post_edit_time >= 0),
post_edit_reason varchar(255) DEFAULT '' NOT NULL,

View file

@ -428,7 +428,7 @@ CREATE TABLE phpbb_posts (
post_checksum varchar(32) NOT NULL DEFAULT '',
post_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
bbcode_bitfield varchar(255) NOT NULL DEFAULT '',
bbcode_uid varchar(5) NOT NULL DEFAULT '',
bbcode_uid varchar(8) NOT NULL DEFAULT '',
post_postcount INTEGER UNSIGNED NOT NULL DEFAULT '1',
post_edit_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
post_edit_reason text(65535) NOT NULL DEFAULT '',

View file

@ -674,7 +674,7 @@ if ($submit || $preview || $refresh)
$message_md5 = md5($message_parser->message);
// Check checksum ... don't re-parse message if the same
$update_message = ($mode != 'edit' || $message_md5 != $post_data['post_checksum'] || $status_switch) ? true : false;
$update_message = ($mode != 'edit' || $message_md5 != $post_data['post_checksum'] || $status_switch || strlen($post_data['bbcode_uid']) < BBCODE_UID_LEN) ? true : false;
// Parse message
if ($update_message)