News: June 24th, 2017, The Tinyportal team is pleased to announce the release of ~~ TinyPortal 1.3! GET IT NOW!!!

Login  |  Register
* * *
TinyPortal on Twitter
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 18, 2017, 05:12:31 AM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 181490
  • Total Topics: 20355
  • Online Today: 43
  • Online Ever: 383
  • (January 02, 2015, 05:58:49 AM)
Users Online
Users: 2
Guests: 37
Total: 39

Skinz





Author Topic: Recent Topics Block - having some issues  (Read 643 times)

0 Members and 1 Guest are viewing this topic.

Offline Skb

  • Jr. Member
  • **
  • Posts: 56
    • Metabolically Challenged
Recent Topics Block - having some issues
« on: July 30, 2017, 05:00:43 AM »
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. 

www.diabetic.pub/forum
because every diabetic needs help.

Offline @rjen

  • Beta Tester
  • *
  • Posts: 172
    • FJR-club Nederland
Re: Recent Topics Block - having some issues
« Reply #1 on: July 30, 2017, 05:15:20 AM »
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 TP1.3R on SMF2.0 at: www.fjr-club.nl
Testing TP1.3R on SMF2.0 at: https://test.fjr-club.nl
Testing TP2.0 on SMF2.1 at: https://test2.fjr-club.nl

Offline Skb

  • Jr. Member
  • **
  • Posts: 56
    • Metabolically Challenged
Re: Recent Topics Block - having some issues
« Reply #2 on: July 30, 2017, 08:41:51 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.
www.diabetic.pub/forum
because every diabetic needs help.

Offline Skb

  • Jr. Member
  • **
  • Posts: 56
    • Metabolically Challenged
Re: Recent Topics Block - having some issues
« Reply #3 on: July 31, 2017, 12:55:53 AM »
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.
www.diabetic.pub/forum
because every diabetic needs help.

Offline @rjen

  • Beta Tester
  • *
  • Posts: 172
    • FJR-club Nederland
Re: Recent Topics Block - having some issues
« Reply #4 on: July 31, 2017, 10:08:34 AM »
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 TP1.3R on SMF2.0 at: www.fjr-club.nl
Testing TP1.3R on SMF2.0 at: https://test.fjr-club.nl
Testing TP2.0 on SMF2.1 at: https://test2.fjr-club.nl

Offline Skb

  • Jr. Member
  • **
  • Posts: 56
    • Metabolically Challenged
Re: Recent Topics Block - having some issues
« Reply #5 on: September 30, 2017, 08:22:56 PM »
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
Code: [Select]
'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 ?
www.diabetic.pub/forum
because every diabetic needs help.