aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-10-23 21:13:45 +0200
committerJoas Schilling <nickvergessen@gmx.de>2013-10-23 21:13:45 +0200
commit881ad935d55dd69876f9c5aee1a9d100242fbbaa (patch)
tree8488fcd49a6544f2c454cd3f1313a88d3e52d439 /phpBB
parent6dd462060999f81baa67c20f536f86e6bb6198ce (diff)
downloadforums-881ad935d55dd69876f9c5aee1a9d100242fbbaa.tar
forums-881ad935d55dd69876f9c5aee1a9d100242fbbaa.tar.gz
forums-881ad935d55dd69876f9c5aee1a9d100242fbbaa.tar.bz2
forums-881ad935d55dd69876f9c5aee1a9d100242fbbaa.tar.xz
forums-881ad935d55dd69876f9c5aee1a9d100242fbbaa.zip
[ticket/11031] Fix conversion of topic_replies to topic_posts
PHPBB3-11031
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/install/convertors/convert_phpbb20.php6
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php9
2 files changed, 12 insertions, 3 deletions
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php
index 03ed15c0ec..e8f8a2033f 100644
--- a/phpBB/install/convertors/convert_phpbb20.php
+++ b/phpBB/install/convertors/convert_phpbb20.php
@@ -399,7 +399,7 @@ if (!$get_info)
array('is_orphan', 0, ''),
array('poster_id', 'attachments.user_id_1 AS poster_id', 'phpbb_user_id'),
array('physical_filename', 'attachments_desc.physical_filename', 'import_attachment'),
- array('real_filename', 'attachments_desc.real_filename', ''),
+ array('real_filename', 'attachments_desc.real_filename', 'phpbb_set_encoding'),
array('download_count', 'attachments_desc.download_count', ''),
array('attach_comment', 'attachments_desc.comment', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')),
array('extension', 'attachments_desc.extension', ''),
@@ -497,7 +497,7 @@ if (!$get_info)
array('topic_title', 'topics.topic_title', 'phpbb_set_encoding'),
array('topic_time', 'topics.topic_time', ''),
array('topic_views', 'topics.topic_views', ''),
- array('topic_posts_approved', 'topics.topic_replies + 1', ''),
+ array('topic_posts_approved', 'topics.topic_replies', 'phpbb_topic_replies_to_posts'),
array('topic_posts_unapproved', 0, ''),
array('topic_posts_softdeleted',0, ''),
array('topic_last_post_id', 'topics.topic_last_post_id', ''),
@@ -531,7 +531,7 @@ if (!$get_info)
array('topic_title', 'topics.topic_title', 'phpbb_set_encoding'),
array('topic_time', 'topics.topic_time', ''),
array('topic_views', 'topics.topic_views', ''),
- array('topic_posts_approved', 'topics.topic_replies + 1', ''),
+ array('topic_posts_approved', 'topics.topic_replies', 'phpbb_topic_replies_to_posts'),
array('topic_posts_unapproved', 0, ''),
array('topic_posts_softdeleted',0, ''),
array('topic_last_post_id', 'topics.topic_last_post_id', ''),
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php
index a698f0ef13..136ca991ae 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -540,6 +540,15 @@ function phpbb_user_id($user_id)
return (int) $user_id;
}
+/**
+* Return correct user id value
+* Everyone's id will be one higher to allow the guest/anonymous user to have a positive id as well
+*/
+function phpbb_topic_replies_to_posts($num_replies)
+{
+ return (int) $num_replies + 1;
+}
+
/* Copy additional table fields from old forum to new forum if user wants this (for Mod compatibility for example)
function phpbb_copy_table_fields()
{