1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-15 13:34:41 +01:00
- cleaned up the TRUNCATE/DELETE FROM in the native search backend
- fixed an imporoper default value on some upgrades


git-svn-id: file:///svn/phpbb/trunk@7036 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M 2007-02-22 19:58:05 +00:00
parent a8f6aafa43
commit 42f3115763
10 changed files with 30 additions and 29 deletions

View File

@ -1757,7 +1757,7 @@ function get_schema_struct()
'topic_moved_id' => array('UINT', 0),
'topic_bumped' => array('BOOL', 0),
'topic_bumper' => array('UINT', 0),
'poll_title' => array('XSTEXT_UNI', ''),
'poll_title' => array('STEXT_UNI', ''),
'poll_start' => array('TIMESTAMP', 0),
'poll_length' => array('TIMESTAMP', 0),
'poll_max_options' => array('TINT:4', 1),

View File

@ -1507,7 +1507,15 @@ class parse_message extends bbcode_firstpass
}
else
{
if (utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message)) > 100)
{
$this->warn_msg[] = $user->lang['POLL_TITLE_TOO_LONG'];
}
$poll['poll_title'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false);
if (strlen($poll['poll_title']) > 255)
{
$this->warn_msg[] = $user->lang['POLL_TITLE_COMP_TOO_LONG'];
}
}
$this->message = $tmp_message;

View File

@ -1271,33 +1271,13 @@ class fulltext_native extends search_backend
case 'sqlite':
case 'firebird':
$db->sql_query('DELETE FROM ' . SEARCH_WORDLIST_TABLE);
break;
default:
$db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDLIST_TABLE);
break;
}
switch ($db->sql_layer)
{
case 'sqlite':
case 'firebird':
$db->sql_query('DELETE FROM ' . SEARCH_WORDMATCH_TABLE);
break;
default:
$db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDMATCH_TABLE);
break;
}
switch ($db->sql_layer)
{
case 'sqlite':
case 'firebird':
$db->sql_query('DELETE FROM ' . SEARCH_RESULTS_TABLE);
break;
default:
$db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDLIST_TABLE);
$db->sql_query('TRUNCATE TABLE ' . SEARCH_WORDMATCH_TABLE);
$db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE);
break;
}

View File

@ -317,7 +317,7 @@ $database_update_info = array(
'seed' => array('UINT:10', 0),
),
SESSIONS_TABLE => array(
'session_forwarded_for' => array('VCHAR:255', 0),
'session_forwarded_for' => array('VCHAR:255', ''),
),
),
'change_columns' => array(
@ -351,6 +351,17 @@ $database_update_info = array(
),
),
),
// Changes from 3.0.b5 to the next version
'3.0.b5' => array(
'change_columns' => array(
TOPICS_TABLE => array(
'poll_title' => array('STEXT_UNI', ''),
),
SESSIONS_TABLE => array(
'session_forwarded_for' => array('VCHAR:255', ''),
),
),
),
);
// Determine mapping database type

View File

@ -1284,7 +1284,7 @@ CREATE TABLE phpbb_topics (
topic_moved_id INTEGER DEFAULT 0 NOT NULL,
topic_bumped INTEGER DEFAULT 0 NOT NULL,
topic_bumper INTEGER DEFAULT 0 NOT NULL,
poll_title VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
poll_title VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
poll_start INTEGER DEFAULT 0 NOT NULL,
poll_length INTEGER DEFAULT 0 NOT NULL,
poll_max_options INTEGER DEFAULT 1 NOT NULL,

View File

@ -1481,7 +1481,7 @@ CREATE TABLE [phpbb_topics] (
[topic_moved_id] [int] DEFAULT (0) NOT NULL ,
[topic_bumped] [int] DEFAULT (0) NOT NULL ,
[topic_bumper] [int] DEFAULT (0) NOT NULL ,
[poll_title] [varchar] (100) DEFAULT ('') NOT NULL ,
[poll_title] [varchar] (255) DEFAULT ('') NOT NULL ,
[poll_start] [int] DEFAULT (0) NOT NULL ,
[poll_length] [int] DEFAULT (0) NOT NULL ,
[poll_max_options] [int] DEFAULT (1) NOT NULL ,

View File

@ -900,7 +900,7 @@ CREATE TABLE phpbb_topics (
topic_moved_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
topic_bumped tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
topic_bumper mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
poll_title varchar(100) DEFAULT '' NOT NULL,
poll_title varchar(255) DEFAULT '' NOT NULL,
poll_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
poll_length int(11) UNSIGNED DEFAULT '0' NOT NULL,
poll_max_options tinyint(4) DEFAULT '1' NOT NULL,

View File

@ -1666,7 +1666,7 @@ CREATE TABLE phpbb_topics (
topic_moved_id number(8) DEFAULT '0' NOT NULL,
topic_bumped number(1) DEFAULT '0' NOT NULL,
topic_bumper number(8) DEFAULT '0' NOT NULL,
poll_title varchar2(300) DEFAULT '' ,
poll_title varchar2(765) DEFAULT '' ,
poll_start number(11) DEFAULT '0' NOT NULL,
poll_length number(11) DEFAULT '0' NOT NULL,
poll_max_options number(4) DEFAULT '1' NOT NULL,

View File

@ -1148,7 +1148,7 @@ CREATE TABLE phpbb_topics (
topic_moved_id INT4 DEFAULT '0' NOT NULL CHECK (topic_moved_id >= 0),
topic_bumped INT2 DEFAULT '0' NOT NULL CHECK (topic_bumped >= 0),
topic_bumper INT4 DEFAULT '0' NOT NULL CHECK (topic_bumper >= 0),
poll_title varchar(100) DEFAULT '' NOT NULL,
poll_title varchar(255) DEFAULT '' NOT NULL,
poll_start INT4 DEFAULT '0' NOT NULL CHECK (poll_start >= 0),
poll_length INT4 DEFAULT '0' NOT NULL CHECK (poll_length >= 0),
poll_max_options INT2 DEFAULT '1' NOT NULL,

View File

@ -141,6 +141,8 @@ $lang = array_merge($lang, array(
'POLL_OPTIONS' => 'Poll options',
'POLL_OPTIONS_EXPLAIN' => 'Place each option on a new line. You may enter up to <strong>%d</strong> options',
'POLL_QUESTION' => 'Poll question',
'POLL_TITLE_TOO_LONG' => 'The poll title must contain fewer than 100 characters',
'POLL_TITLE_COMP_TOO_LONG' => 'The parsed size of your poll title is too large, consider removing BBCodes or smilies',
'POLL_VOTE_CHANGE' => 'Allow re-voting',
'POLL_VOTE_CHANGE_EXPLAIN' => 'If enabled users are able to change their vote.',
'POSTED_ATTACHMENTS' => 'Posted attachments',