TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

December 10, 2024, 04:30:03 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,443
  • Total Topics: 21,252
  • Online today: 144
  • Online ever: 6,457 (November 30, 2024, 02:40:09 PM)
Users Online
  • Users: 0
  • Guests: 98
  • Total: 98

Recent Topics not showing

Started by Kokoro, July 10, 2022, 09:54:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Kokoro

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!

Kokoro

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.

@rjen

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

Kokoro

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)

@rjen

#4
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


'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......


'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
Running Latest TP on SMF2.1 at: www.fjr-club.nl

@rjen

Quote from: Kokoro on July 10, 2022, 10: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)

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

@rjen

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

Kokoro

Thank you!  That fixed the problem!  :)

@rjen

Quote from: Kokoro on July 11, 2022, 11:56:11 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

Kokoro

Yes.  Just uploaded it and refreshed my page.  Works beautifully!