aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/develop
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/develop')
-rw-r--r--phpBB/develop/benchmark.php10
-rw-r--r--phpBB/develop/create_schema_files.php30
-rw-r--r--phpBB/develop/fill.php2
-rw-r--r--phpBB/develop/merge_post_tables.php4
-rw-r--r--phpBB/develop/mysql_upgrader.php24
5 files changed, 42 insertions, 28 deletions
diff --git a/phpBB/develop/benchmark.php b/phpBB/develop/benchmark.php
index c867b9262e..c653fdaa24 100644
--- a/phpBB/develop/benchmark.php
+++ b/phpBB/develop/benchmark.php
@@ -192,13 +192,13 @@ function get_topic_count($forum_id)
{
global $db;
- $sql = "SELECT forum_topics
+ $sql = "SELECT forum_topics_approved
FROM " . FORUMS_TABLE . "
WHERE (forum_id = $forum_id)";
if($result = $db->sql_query($sql))
{
$row = $db->sql_fetchrow($result);
- $topic_count = $row['forum_topics'];
+ $topic_count = $row['forum_topics_approved'];
unset($result);
unset($row);
@@ -263,7 +263,7 @@ function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $m
$post_message = prepare_message($text, $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
- $sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, attach_id, icon_id, post_username, post_time, poster_ip, post_approved, bbcode_uid, enable_bbcode, enable_html, enable_smilies, enable_sig, post_subject, post_text)
+ $sql = "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, attach_id, icon_id, post_username, post_time, poster_ip, post_visibility, bbcode_uid, enable_bbcode, enable_html, enable_smilies, enable_sig, post_subject, post_text)
VALUES ($new_topic_id, $forum_id, $user_id, 0, 0, '$post_username', $current_time, '$user_ip', 1, '$bbcode_uid', $bbcode_on, $html_on, $smilies_on, $attach_sig, '$post_subject', '$post_message')";
$result = $db->sql_query($sql);
@@ -282,10 +282,10 @@ function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $m
if($db->sql_query($sql))
{
$sql = "UPDATE " . FORUMS_TABLE . "
- SET forum_last_post_id = $new_post_id, forum_posts = forum_posts + 1";
+ SET forum_last_post_id = $new_post_id, forum_posts_approved = forum_posts_approved + 1";
if($mode == "newtopic")
{
- $sql .= ", forum_topics = forum_topics + 1";
+ $sql .= ", forum_topics_approved = forum_topics_approved + 1";
}
$sql .= " WHERE forum_id = $forum_id";
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index b454fb2c16..0f6b7ae0fa 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -1104,9 +1104,12 @@ function get_schema_struct()
'forum_topics_per_page' => array('TINT:4', 0),
'forum_type' => array('TINT:4', 0),
'forum_status' => array('TINT:4', 0),
- 'forum_posts' => array('UINT', 0),
- 'forum_topics' => array('UINT', 0),
- 'forum_topics_real' => array('UINT', 0),
+ 'forum_posts_approved' => array('UINT', 0),
+ 'forum_posts_unapproved' => array('UINT', 0),
+ 'forum_posts_softdeleted' => array('UINT', 0),
+ 'forum_topics_approved' => array('UINT', 0),
+ 'forum_topics_unapproved' => array('UINT', 0),
+ 'forum_topics_softdeleted' => array('UINT', 0),
'forum_last_post_id' => array('UINT', 0),
'forum_last_poster_id' => array('UINT', 0),
'forum_last_post_subject' => array('STEXT_UNI', ''),
@@ -1377,7 +1380,7 @@ function get_schema_struct()
'icon_id' => array('UINT', 0),
'poster_ip' => array('VCHAR:40', ''),
'post_time' => array('TIMESTAMP', 0),
- 'post_approved' => array('BOOL', 1),
+ 'post_visibility' => array('TINT:3', 0),
'post_reported' => array('BOOL', 0),
'enable_bbcode' => array('BOOL', 1),
'enable_smilies' => array('BOOL', 1),
@@ -1396,6 +1399,9 @@ function get_schema_struct()
'post_edit_user' => array('UINT', 0),
'post_edit_count' => array('USINT', 0),
'post_edit_locked' => array('BOOL', 0),
+ 'post_delete_time' => array('TIMESTAMP', 0),
+ 'post_delete_reason' => array('STEXT_UNI', ''),
+ 'post_delete_user' => array('UINT', 0),
),
'PRIMARY_KEY' => 'post_id',
'KEYS' => array(
@@ -1403,7 +1409,7 @@ function get_schema_struct()
'topic_id' => array('INDEX', 'topic_id'),
'poster_ip' => array('INDEX', 'poster_ip'),
'poster_id' => array('INDEX', 'poster_id'),
- 'post_approved' => array('INDEX', 'post_approved'),
+ 'post_visibility' => array('INDEX', 'post_visibility'),
'post_username' => array('INDEX', 'post_username'),
'tid_post_time' => array('INDEX', array('topic_id', 'post_time')),
),
@@ -1735,15 +1741,16 @@ function get_schema_struct()
'forum_id' => array('UINT', 0),
'icon_id' => array('UINT', 0),
'topic_attachment' => array('BOOL', 0),
- 'topic_approved' => array('BOOL', 1),
+ 'topic_visibility' => array('TINT:3', 0),
'topic_reported' => array('BOOL', 0),
'topic_title' => array('STEXT_UNI', '', 'true_sort'),
'topic_poster' => array('UINT', 0),
'topic_time' => array('TIMESTAMP', 0),
'topic_time_limit' => array('TIMESTAMP', 0),
'topic_views' => array('UINT', 0),
- 'topic_replies' => array('UINT', 0),
- 'topic_replies_real' => array('UINT', 0),
+ 'topic_posts_approved' => array('UINT', 0),
+ 'topic_posts_unapproved' => array('UINT', 0),
+ 'topic_posts_softdeleted' => array('UINT', 0),
'topic_status' => array('TINT:3', 0),
'topic_type' => array('TINT:3', 0),
'topic_first_post_id' => array('UINT', 0),
@@ -1765,14 +1772,17 @@ function get_schema_struct()
'poll_max_options' => array('TINT:4', 1),
'poll_last_vote' => array('TIMESTAMP', 0),
'poll_vote_change' => array('BOOL', 0),
+ 'topic_delete_time' => array('TIMESTAMP', 0),
+ 'topic_delete_reason' => array('STEXT_UNI', ''),
+ 'topic_delete_user' => array('UINT', 0),
),
'PRIMARY_KEY' => 'topic_id',
'KEYS' => array(
'forum_id' => array('INDEX', 'forum_id'),
'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')),
'last_post_time' => array('INDEX', 'topic_last_post_time'),
- 'topic_approved' => array('INDEX', 'topic_approved'),
- 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_approved', 'topic_last_post_id')),
+ 'topic_visibility' => array('INDEX', 'topic_visibility'),
+ 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_visibility', 'topic_last_post_id')),
'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')),
),
);
diff --git a/phpBB/develop/fill.php b/phpBB/develop/fill.php
index e3b986e163..696b1e31c0 100644
--- a/phpBB/develop/fill.php
+++ b/phpBB/develop/fill.php
@@ -86,7 +86,7 @@ switch ($mode)
$topic_rows[] = "($topic_id, $forum_id, '$forum_id-$topic_id', " . (($topic_id % 34) ? '0' : '1') . ')';
- $sql = 'INSERT IGNORE INTO ' . POSTS_TABLE . ' (topic_id, forum_id, poster_id, post_subject, post_text, post_username, post_approved, post_time, post_reported)
+ $sql = 'INSERT IGNORE INTO ' . POSTS_TABLE . ' (topic_id, forum_id, poster_id, post_subject, post_text, post_username, post_visibility, post_time, post_reported)
VALUES ';
$rows = array();
diff --git a/phpBB/develop/merge_post_tables.php b/phpBB/develop/merge_post_tables.php
index 8edc330a0a..d687a292f2 100644
--- a/phpBB/develop/merge_post_tables.php
+++ b/phpBB/develop/merge_post_tables.php
@@ -50,7 +50,7 @@ switch ($db->sql_layer)
ADD PRIMARY KEY (post_id),
ADD INDEX topic_id (topic_id),
ADD INDEX poster_ip (poster_ip),
- ADD INDEX post_approved (post_approved),
+ ADD INDEX post_visibility (post_visibility),
MODIFY COLUMN post_id mediumint(8) UNSIGNED NOT NULL auto_increment,
ADD COLUMN post_encoding varchar(11) DEFAULT \'iso-8859-15\' NOT NULL';
break;
@@ -162,7 +162,7 @@ while ($row = $db->sql_fetchrow($result))
$forum_id = $row['forum_id'];
$sql_ary[] = "UPDATE " . $table_prefix . "forums
- SET forum_last_poster_id = " . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? $row['user_id'] : ANONYMOUS) . ", forum_last_poster_name = '" . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? addslashes($row['username']) : addslashes($row['post_username'])) . "', forum_last_post_time = " . $row['post_time'] . ", forum_posts = " . (($post_count[$forum_id]) ? $post_count[$forum_id] : 0) . ", forum_topics = " . (($topic_count[$forum_id]) ? $topic_count[$forum_id] : 0) . "
+ SET forum_last_poster_id = " . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? $row['user_id'] : ANONYMOUS) . ", forum_last_poster_name = '" . ((!empty($row['user_id']) && $row['user_id'] != ANONYMOUS) ? addslashes($row['username']) : addslashes($row['post_username'])) . "', forum_last_post_time = " . $row['post_time'] . ", forum_posts_approved = " . (($post_count[$forum_id]) ? $post_count[$forum_id] : 0) . ", forum_topics_approved = " . (($topic_count[$forum_id]) ? $topic_count[$forum_id] : 0) . "
WHERE forum_id = $forum_id";
$sql = "SELECT t.topic_id, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php
index 7f82ebfeab..597dd5e932 100644
--- a/phpBB/develop/mysql_upgrader.php
+++ b/phpBB/develop/mysql_upgrader.php
@@ -552,9 +552,12 @@ function get_schema_struct()
'forum_topics_per_page' => array('TINT:4', 0),
'forum_type' => array('TINT:4', 0),
'forum_status' => array('TINT:4', 0),
- 'forum_posts' => array('UINT', 0),
- 'forum_topics' => array('UINT', 0),
- 'forum_topics_real' => array('UINT', 0),
+ 'forum_posts_approved' => array('UINT', 0),
+ 'forum_posts_unapproved' => array('UINT', 0),
+ 'forum_posts_softdeleted' => array('UINT', 0),
+ 'forum_topics_approved' => array('UINT', 0),
+ 'forum_topics_unapproved' => array('UINT', 0),
+ 'forum_topics_softdeleted' => array('UINT', 0),
'forum_last_post_id' => array('UINT', 0),
'forum_last_poster_id' => array('UINT', 0),
'forum_last_post_subject' => array('STEXT_UNI', ''),
@@ -768,7 +771,7 @@ function get_schema_struct()
'icon_id' => array('UINT', 0),
'poster_ip' => array('VCHAR:40', ''),
'post_time' => array('TIMESTAMP', 0),
- 'post_approved' => array('BOOL', 1),
+ 'post_visibility' => array('TINT:3', 0),
'post_reported' => array('BOOL', 0),
'enable_bbcode' => array('BOOL', 1),
'enable_smilies' => array('BOOL', 1),
@@ -794,7 +797,7 @@ function get_schema_struct()
'topic_id' => array('INDEX', 'topic_id'),
'poster_ip' => array('INDEX', 'poster_ip'),
'poster_id' => array('INDEX', 'poster_id'),
- 'post_approved' => array('INDEX', 'post_approved'),
+ 'post_visibility' => array('INDEX', 'post_visibility'),
'post_username' => array('INDEX', 'post_username'),
'tid_post_time' => array('INDEX', array('topic_id', 'post_time')),
),
@@ -1107,15 +1110,16 @@ function get_schema_struct()
'forum_id' => array('UINT', 0),
'icon_id' => array('UINT', 0),
'topic_attachment' => array('BOOL', 0),
- 'topic_approved' => array('BOOL', 1),
+ 'topic_visibility' => array('TINT:3', 0),
'topic_reported' => array('BOOL', 0),
'topic_title' => array('STEXT_UNI', '', 'true_sort'),
'topic_poster' => array('UINT', 0),
'topic_time' => array('TIMESTAMP', 0),
'topic_time_limit' => array('TIMESTAMP', 0),
'topic_views' => array('UINT', 0),
- 'topic_replies' => array('UINT', 0),
- 'topic_replies_real' => array('UINT', 0),
+ 'topic_posts_approved' => array('UINT', 0),
+ 'topic_posts_unapproved' => array('UINT', 0),
+ 'topic_posts_softdeleted' => array('UINT', 0),
'topic_status' => array('TINT:3', 0),
'topic_type' => array('TINT:3', 0),
'topic_first_post_id' => array('UINT', 0),
@@ -1143,8 +1147,8 @@ function get_schema_struct()
'forum_id' => array('INDEX', 'forum_id'),
'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')),
'last_post_time' => array('INDEX', 'topic_last_post_time'),
- 'topic_approved' => array('INDEX', 'topic_approved'),
- 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_approved', 'topic_last_post_id')),
+ 'topic_visibility' => array('INDEX', 'topic_visibility'),
+ 'forum_appr_last' => array('INDEX', array('forum_id', 'topic_visibility', 'topic_last_post_id')),
'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')),
),
);