my english is bad
Hi andowson and everybody, i like jforum, i using jforum 2.1.9, but this version not show last post title in .../forums/list.. , and I did the following:
In file \WEB-INF\config\database\generic\generic_queries.sql, i edit
ForumModel.lastPostInfo = SELECT post_time, p.topic_id, t.topic_replies, post_id, u.user_id, username, t.topic_title \
FROM jforum_posts p, jforum_users u, jforum_topics t, jforum_forums f \
WHERE t.forum_id = f.forum_id \
AND t.topic_id = p.topic_id \
AND f.forum_last_post_id = t.topic_last_post_id \
AND t.topic_last_post_id = p.post_id \
AND p.forum_id = ? \
AND p.user_id = u.user_id \
AND p.need_moderate = 0
In file \net\jforum\dao\generic\GenericForumDAO.java, i edit it and compile to class file
if (rs.next()) {
lpi.setUsername(rs.getString("username"));
lpi.setUserId(rs.getInt("user_id"));
final SimpleDateFormat sdf = new SimpleDateFormat(SystemGlobals.getValue(ConfigKeys.DATE_TIME_FORMAT), Locale.getDefault());
lpi.setPostDate(sdf.format(rs.getTimestamp("post_time")));
lpi.setPostId(rs.getInt("post_id"));
lpi.setTopicId(rs.getInt("topic_id"));
lpi.setPostTimeMillis(rs.getTimestamp("post_time").getTime());
lpi.setTopicReplies(rs.getInt("topic_replies"));
lpi.setTitle(rs.getString("topic_title"));
lpi.setHasInfo(true);
// Check if the topic is consistent
TopicDAO topicDao = DataAccessDriver.getInstance().newTopicDAO();
Topic topic = topicDao.selectById(lpi.getTopicId());
if (topic.getId() == 0) {
// Hm, that's not good. Try to fix it
topicDao.fixFirstLastPostId(lpi.getTopicId());
}
tryFix = false;
}
In file \net\jforum\entities\LastPostInfo.java, i edit it and compile to class file:
/**
* @return Returns the title.
*/
public String getTitle() {
return this.topicTitle;
}
/**
* @param title The title to set.
*/
public void setTitle(final String title) {
this.topicTitle = title;
}
In the forum_list.htm, :
<#assign url = JForumContext.encodeURL("/posts/list/${startPage}${lpi.topicId}") + "#p" + lpi.postId/>
<a href="${url}" class="last_title"><img src="${contextPath}/templates/${templateName}/images/icon_latest_reply.gif" border="0" alt="[Latest Reply]" />${lpi.title}</a>
I restart tomcat, and it show title

, but, when i post a new topic, it show old title

(, when i restart tomcat, it show new title,
I need your help, thank you very much :">