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

Recent

Welcome to TinyPortal. Please login or sign up.

April 19, 2024, 07:12:56 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 266
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 119
  • Total: 120
  • @rjen

Recent Topics Block - having some issues

Started by Skb, July 30, 2017, 12:00:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Skb

2 months ago, we installed a SSL certificate on our forum and adapted to https. After a while I noticed the red warning icon in the right corner of the browser address bar. It conveyed that the site was trying to load unsafe images. I narrowed that issue down to the "FaceBook Like" & "Google +1" buttons in the posts which were loading from the Mod developer's site. So I made some changes to our SMF forum;

1. I uninstalled the Facebook Like & Google +1 Mods for which I had to make manual changes to ManageSettings.php & DisplayTemplate.php
2. I also removed an unused Mod "Read the Rules link" for which I made some manual changes to Sources/ManageSettings.php
3. I also uninstalled the Mod called "Unknown Action"
4. I made some text changes to InlineAttachments.english.php for the Inline Attachments Mod that we have running.

All the manual changes were as suggested by the Package Manager.

After the above changes, the "Recent Posts" block on our forum is behaving funnily. The settings for the block are kept at "10", but it shows the following last posts - 5 to Guests, 6 to Members, 8 to the Moderators & 9 to the Admin.

Can anyone tell me, what's at play & how I could go about correcting this ? Thanks. 


SMF 2.1 RC4 (default theme) / TP 2.1.0

@rjen

I guess the forum is not very active and the various positions have a different view in what amount of topics they can see?

I had the same problem. Recent topics code had a certain limit in the amount of topics it reviews. I believe the code is in tpsubs.php.

Increase that limit and the problem Goes away.

Change
'min_message_id' => $modSettings['maxMsgID'] - 35 * min($num_recent, 5),

To

'min_message_id' => $modSettings['maxMsgID'] - 200 * min($num_recent, 5),
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Skb

Quote from: @rjen on July 30, 2017, 12:15:20 PM
I guess the forum is not very active

That is quite true, but the block was working just fine up until now. However, I will apply the changes you suggested and revert back.

SMF 2.1 RC4 (default theme) / TP 2.1.0

Skb

Quote from: @rjen on July 30, 2017, 12:15:20 PM
I believe the code is in tpsubs.php.

Increase that limit and the problem Goes away.

Change
'min_message_id' => $modSettings['maxMsgID'] - 35 * min($num_recent, 5),

To

'min_message_id' => $modSettings['maxMsgID'] - 200 * min($num_recent, 5),

Thanks Boss. That worked perfectly. However, I didn't change the first number. I changed the second from 5 to 10.

SMF 2.1 RC4 (default theme) / TP 2.1.0

@rjen

Then Your guests can see more than mine. I had to make this change cause guests only see about a percentage of all posts. Your fix does not help in my case.

In the standard code the block only considers 35*5 is 175 of the most recent Posts.
And selects up to the amount of Posts You set, but only those that the user is allowed to see. If a guest only has permission to see 4 out of these 175 posts the block only returns 4.

You have now extended the horizon to 35*10 messages.
Mij change extended the horizon to 200*5...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Skb

Another nerd question.
Apologies for continuing in the same thread, but the question is relevant to this topic.

This week, I made a change in TP Settings. I removed the collapse option for the Right Panel, so that it is shown as a default feature across all themes being used on our forum. After making the change, I found the recent topics block showing the same erratic behaviour. On checking TP-Subs, I found that it had reverted back to 'min_message_id' => $modSettings['maxMsgID'] - 35 * min($num_recent, 5),

So, the question is where is the old TP-Subs file being picked up from, if the latest edits are being lost ?

SMF 2.1 RC4 (default theme) / TP 2.1.0