<#assign o = config.getProperty("registration.enabled")/>
Index: src/main/java/net/jforum/dao/generic/GenericTopicDAO.java
===================================================================
--- src/main/java/net/jforum/dao/generic/GenericTopicDAO.java (revision 194)
+++ src/main/java/net/jforum/dao/generic/GenericTopicDAO.java (working copy)
@@ -461,7 +461,15 @@
try {
pstmt = JForumExecutionContext.getConnection().prepareStatement(sql);
pstmt.setInt(1, forumId);
- pstmt.setInt(2, forumId);
+
+ // Generic SQL / Topic DAO only (not handled for HsqldbTopicDao or SqlServer, or etc).
+ boolean hideShadowTopics = SystemGlobals.getBoolValue(ConfigKeys.HIDE_SHADOW_TOPICS);
+ // If we need to hide the shadow topics, then from condition
+ // ... WHERE (t.forum_id = ? OR t.topic_moved_id = ?) ...
+ // we need to pass -1 for topic_moved_id so that it would never match.
+ int matchTopicMovedId = hideShadowTopics ? -1 : forumId;
+
+ pstmt.setInt(2, matchTopicMovedId);
pstmt.setInt(3, startFrom);
pstmt.setInt(4, count);
Index: src/main/java/net/jforum/util/preferences/ConfigKeys.java
===================================================================
--- src/main/java/net/jforum/util/preferences/ConfigKeys.java (revision 196)
+++ src/main/java/net/jforum/util/preferences/ConfigKeys.java (working copy)
@@ -173,6 +173,8 @@
public static final String RATE_LIMIT_AUTOLOCK_FORUM_IDS = "rate.limit.autolock.forum.ids";
public static final String RATE_LIMIT_TOPIC_INTERVAL_DAYS = "rate.limit.topic.interval.days";
+ public static final String HIDE_SHADOW_TOPICS = "hide.shadow.topics";
+
public static final String I18N_DEFAULT = "i18n.board.default";
public static final String I18N_DEFAULT_ADMIN = "i18n.internal";
public static final String I18N_IMAGES_DIR = "i18n.images.dir";
Index: src/main/java/net/jforum/entities/Topic.java
===================================================================
--- src/main/java/net/jforum/entities/Topic.java (revision 194)
+++ src/main/java/net/jforum/entities/Topic.java (working copy)
@@ -45,6 +45,9 @@
import java.io.Serializable;
import java.util.Date;
+import net.jforum.util.preferences.ConfigKeys;
+import net.jforum.util.preferences.SystemGlobals;
+
/**
* Represents every topic in the forum.
*
@@ -527,4 +530,14 @@
{
this.movedId = movedId;
}
+
+ /**
+ * Used by freemarker template (presentation.ftl) to indicate if a topic was moved to a
+ * different forum to help decide if the locked icon is to be used or not.
+ */
+ public static boolean isHideShadowTopics() {
+ boolean hideShadowTopics = SystemGlobals.getBoolValue(ConfigKeys.HIDE_SHADOW_TOPICS);
+
+ return hideShadowTopics;
+ }
}
Index: src/main/config/languages/en_US.properties
===================================================================
--- src/main/config/languages/en_US.properties (revision 196)
+++ src/main/config/languages/en_US.properties (working copy)
@@ -301,6 +301,7 @@
Config.Form.rateLimit = Post Rate Limiting
Config.Form.rateLimitAutolockForumIds = Forum IDs where topics will be autolocked ( separated by comma )
Config.Form.rateLimitTopicIntervalDays = Minimum days between new topic for standard users
+Config.Form.hideShadowTopics = Hide Shadow Topics (restart is needed after changing this)
# Category listing
Delete = Delete
Index: src/main/config/SystemGlobals.properties
===================================================================
--- src/main/config/SystemGlobals.properties (revision 196)
+++ src/main/config/SystemGlobals.properties (working copy)
@@ -151,6 +151,9 @@
# ###############
rate.limit.autolock.forum.ids = 2
rate.limit.topic.interval.days = 7
+
+hide.shadow.topics = true
+
# Allowed HTML tags to be used when posting a message
html.tags.welcome = a, img, font, b, i, u, li, ul, br, hr, p
html.attributes.welcome = href, target, rel, src, width, height, size, face, color