Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

November 29, 2022, 05:23:04 AM

Login with username, password and session length
Members
  • Total Members: 3853
  • Latest: tty456
Stats
  • Total Posts: 193622
  • Total Topics: 21106
  • Online today: 71
  • Online ever: 3540
  • (September 02, 2022, 06:38:54 PM)
Users Online
Users: 1
Guests: 40
Total: 41

Author Topic: Recent Topics not showing  (Read 800 times)

0 Members and 1 Guest are viewing this topic.

Offline Kokoro

  • Jr. Member
  • **
  • Posts: 11
Recent Topics not showing
« on: July 10, 2022, 02:54:25 PM »
Link to my forum: https://www.AnimeRPGs dot com/
SMF version: 2.1.2
TP version: 2.2.2
Default Forum Language: English
Theme name and version: Default (with Curve Color Changer v. 1.3 MOD)
Browser Name and Version: Firefox 102.0.1 (64-bit)
Mods installed: Activity Bar (2.0.1), Avatars Display Integration (1.5.3), Curve2 Color Changer (1.3), Dice Roller BBcode (2.0), Login Menu Button (2.0), Members Online Today (1.0), More Spiders (1.3.1), Post as Another Member (1.6), SMF 2.1.2 Update (1.0), SMF Gallery Lite (7.1), SMFPacks Social Login (2.3.2), Similar Topics (1.2.2), Yet Another Spoiler Mod (1.2)
Related Error messages: N/A

Problem:  I am using the Recent Topics block to display the latest topic in a specified board.  However, nothing appears on in the block.  Attached are my settings.  Thank you!

Offline Kokoro

  • Jr. Member
  • **
  • Posts: 11
Re: Recent Topics not showing
« Reply #1 on: July 10, 2022, 03:02:59 PM »
Okay, I think I found a bug.  While doing some testing, I started from displaying 5 replies.  Then 4, then 3.  All works fine.  But when I selected 2 posts, only one showed, and then when I selected 1 post, zero showed.

Offline @rjen

  • Support Team
  • *
  • Posts: 3341
    • FJR-club Nederland
Re: Recent Topics not showing
« Reply #2 on: July 10, 2022, 03:07:35 PM »
Will need to check that: the block uses standard ssi_recenttopics to pull the data. It may be related to that SMF functionality..,
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Offline Kokoro

  • Jr. Member
  • **
  • Posts: 11
Re: Recent Topics not showing
« Reply #3 on: July 10, 2022, 03:52:49 PM »
There does seem to be a bug with the Recent posts on the SMF side as well.  The layout changes when I crank the number of posts to one.  The post author and date disappears.

(But it looks like that's by design)

Offline @rjen

  • Support Team
  • *
  • Posts: 3341
    • FJR-club Nederland
Re: Recent Topics not showing
« Reply #4 on: July 11, 2022, 02:24:48 AM »
Yeah, I think I know the reason.

The standard SMF function: ssi_recentTopics has 'limited' for performance reasons.
This means it will ony select a certain block of recent posts from the tables, and then it starts filtering by board.
This means that if you specify a board which is not very active or a small number of recent topics the selection may not find any relevant topics in the 'read'

This code in is SSI.php

Code: [Select]
'min_message_id' => $modSettings['maxMsgID'] - (!empty($context['min_message_topics']) ? $context['min_message_topics'] : 35) * min($num_recent, 5),

what is means is that the query selects the newest messages using 35 x 1 = 35 messages.
If you selected board does not have any posts in the last 35 messages the query reports no results...

You can fix this by changing the query ccode in SSI.php
This code will always read the 350 latest messages. If you still have issues you can increase the number 100 to a larger value. Mind you this query will also run on the board index, don't go too wild......

Code: [Select]
'min_message_id' => $modSettings['maxMsgID'] - (!empty($context['min_message_topics']) ? $context['min_message_topics'] : 35) * 100,

Addition: I see that in SMF2.1 this variable is introduced: $context['min_message_topics']. I cannot see if this is being set anywhere though
« Last Edit: July 11, 2022, 03:21:51 AM by @rjen »
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Offline @rjen

  • Support Team
  • *
  • Posts: 3341
    • FJR-club Nederland
Re: Recent Topics not showing
« Reply #5 on: July 11, 2022, 03:15:22 AM »
There does seem to be a bug with the Recent posts on the SMF side as well.  The layout changes when I crank the number of posts to one.  The post author and date disappears.

(But it looks like that's by design)

I think you are right: pretty sure the SMF team will not accept that as a bug...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Offline @rjen

  • Support Team
  • *
  • Posts: 3341
    • FJR-club Nederland
Re: Recent Topics not showing
« Reply #6 on: July 11, 2022, 04:31:36 AM »
Actually the new parameter now allows us to fix this from TP code.

Place attached file in your /Themes/default folder and it should fix it for you
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Offline Kokoro

  • Jr. Member
  • **
  • Posts: 11
Re: Recent Topics not showing
« Reply #7 on: July 11, 2022, 04:56:11 AM »
Thank you!  That fixed the problem!  :)

Offline @rjen

  • Support Team
  • *
  • Posts: 3341
    • FJR-club Nederland
Re: Recent Topics not showing
« Reply #8 on: July 11, 2022, 05:00:47 AM »
Thank you!  That fixed the problem!  :)

Did you use the new TP file?
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Offline Kokoro

  • Jr. Member
  • **
  • Posts: 11
Re: Recent Topics not showing
« Reply #9 on: July 11, 2022, 05:09:10 AM »
Yes.  Just uploaded it and refreshed my page.  Works beautifully!