Permalink
Browse files

fix schema (thanks mort for reporting) + fix typo (POST_APPROVAL)

  • Loading branch information...
1 parent 39d9562 commit e8646f3da0ebc2d4e6f35d171e7bf7a03845233c @Informpro committed Jun 14, 2011
@@ -171,7 +171,7 @@ function get_forum_most_active($user_id)
{
$sql_most = "SELECT *
FROM " . POSTS_TABLE . "
- WHERE forum_id = " . $f_id . " AND post_approval = " . POST_APPROVAL . " AND poster_id = " . $user_id;
+ WHERE forum_id = " . $f_id . " AND post_approval = " . POST_APPROVED . " AND poster_id = " . $user_id;
$result = $db->sql_query($sql_most);
if ($db->sql_numrows($result) > $most_active_posts)
@@ -987,7 +987,7 @@
// All IP addresses this user has posted from section
$total_ips = 0;
- $sql = 'SELECT poster_ip, COUNT(*) AS postings FROM ' . POSTS_TABLE . ' WHERE post_approval = ' . POST_APPROVAL . ' AND poster_id = "' . $profiledata['user_id'] . '" GROUP BY poster_ip ORDER BY ' . ((SQL_LAYER == 'msaccess') ? 'COUNT(*)' : 'postings') . ' DESC';
+ $sql = 'SELECT poster_ip, COUNT(*) AS postings FROM ' . POSTS_TABLE . ' WHERE post_approval = ' . POST_APPROVED . ' AND poster_id = "' . $profiledata['user_id'] . '" GROUP BY poster_ip ORDER BY ' . ((SQL_LAYER == 'msaccess') ? 'COUNT(*)' : 'postings') . ' DESC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -1399,9 +1399,10 @@ CREATE TABLE `phpbb_posts` (
`post_attachment` tinyint(1) NOT NULL DEFAULT '0',
`post_bluecard` tinyint(1) DEFAULT NULL,
`post_likes` mediumint(8) unsigned NOT NULL DEFAULT '0',
- `deleted` boolean default false,
+ `post_approval` tinyint(1) default 1,
`deleter_user_id` int(9),
`deleter_username` varchar(255),
+ `deleted_time` int(9),
PRIMARY KEY (`post_id`),
KEY `forum_id` (`forum_id`),
KEY `topic_id` (`topic_id`),
@@ -4326,8 +4326,8 @@
case '1.3.18.71':
$sql[] = "ALTER TABLE `" . $table_prefix . "posts` ADD `post_approval` tinyint(1) DEFAULT 1";
$sql[] = "ALTER TABLE `" . $table_prefix . "posts` ADD `deleter_user_id` int(9)";
+ $sql[] = "ALTER TABLE `" . $table_prefix . "posts` ADD `deleter_username` varchar(255)";
$sql[] = "ALTER TABLE `" . $table_prefix . "posts` ADD `deleted_time` int(9)";
- $sql[] = "ALTER TABLE `" . $table_prefix . "posts` ADD `deleter_user_username` varchar(255)";
}
$sql[] = "INSERT INTO " . $table_prefix . "config VALUES ('ip_version', '" . $ip_version . "')";

0 comments on commit e8646f3

Please sign in to comment.