EzPortal - Portal Software for Forums

EzPortal - Made to Fit Your SMF Forum - Glad You Found Us!
+- +-

UserBox

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Recent Posts

Smiley missing in shoutbox 2.1.4 by hustreamload
July 26, 2023, 08:14:02 am

Re: Theme Select Box question? by Shades
March 15, 2023, 06:49:49 pm

Re: Theme Select Box question? by Shades
March 09, 2023, 02:09:24 pm

Re: Theme Select Box question? by Shades
March 09, 2023, 01:55:53 pm

Re: Theme Select Box question? by EzPortal
March 09, 2023, 01:47:42 pm

Re: Theme Select Box question? by Shades
March 09, 2023, 01:34:07 pm

Re: Theme Select Box question? by EzPortal
March 09, 2023, 12:20:17 pm

Re: Theme Select Box question? by EzPortal
March 02, 2023, 11:26:15 pm

+- HTML Menu


Sample HTML Block Usage - You May Custom Code it, as needed!

Recent Topics ezBlock

Smiley missing in shoutbox 2.1.4 by hustreamload
July 26, 2023, 08:14:02 am

Theme Select Box question? by Shades
March 15, 2023, 06:49:49 pm

Where is the facebook button color? by EzPortal
February 28, 2023, 06:45:09 pm

Display on Mobile - SMF 2.1.3 and EZ 5.5.2 by BugginIn
December 29, 2022, 04:07:13 pm

Blocks Help by Riggs1973
November 20, 2022, 12:59:30 pm

Surface ol lite theme release Free! by Steffen K.
November 18, 2022, 03:57:24 am

Undefined index: href by EzPortal
October 04, 2022, 08:49:59 pm

SMF-ezportal_column_5.cache): failed to open stream: No such file or directory by EzPortal
June 04, 2022, 11:40:13 am

Arcade block error: failed to open stream: No such file or directory by Shades
May 20, 2022, 02:47:13 pm

ezPortal 5.5 by EzPortal
May 20, 2022, 09:59:30 am

Author Topic: Recent Topic Ezblock randomly showing "New" message indicator  (Read 36640 times)

0 Members and 1 Guest are viewing this topic.

Offline Paul_123

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Recent Topic Ezblock randomly showing "New" message indicator
« on: January 13, 2020, 12:23:55 pm »
I just upgraded from 3.5 to 4.5.6b, and the new message indicator is randomly showing by the topics in the Recent Topic Ezblock.  If I goto just the forum view and look at unread messages, the correct messages are shown.

Sometimes it shows correctly, sometimes it shows none as new, and other times it shows everything.

Not quite sure where to look at what is causing this.

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1298
  • Karma: 67
Re: Recent Topic Ezblock randomly showing "New" message indicator
« Reply #1 on: January 13, 2020, 01:53:35 pm »
What version of SMF? And what caching system setup in SMF what level?. Are you logged in same account?
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

Offline Paul_123

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: Recent Topic Ezblock randomly showing "New" message indicator
« Reply #2 on: January 13, 2020, 04:53:04 pm »
SMF 2.0.17

Caching Level 1

Yes, Even if I stay Logged in, Don't actually visit any posts,   And just refresh the page, the state of the "NEW" indicator will change.

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1298
  • Karma: 67
Re: Recent Topic Ezblock randomly showing "New" message indicator
« Reply #3 on: January 13, 2020, 04:55:05 pm »
Hmm, Ok will review and see what I can find out.
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

Offline Paul_123

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: Recent Topic Ezblock randomly showing "New" message indicator
« Reply #4 on: January 13, 2020, 09:47:44 pm »
The question about the caching helped.

in Subs-EzPortalMain2.php.

First I just removed the if statement doing the cache lookup, so that there was a database call every time.  And that worked to cleanup the issue.

So I got to looking at the data in the cache file.  When I read a topic, that gets recorded in the database, however the cache files that are being saved appear to be user independent......meaning, how does ezportal know if the cache was saved based on my lookup, or the user lookup that loaded the page right before me?  Should the cache file have a userid in the file name....such that only my information is saved.

Also, when writing the cache, it is putting a 300 second expiry, should this be 30 seconds like the Recent Posts?  At which point is there any value in caching these entries at all?

Here is a diff of what I was describing.

Code: [Select]
diff --git a/Sources/Subs-EzPortalMain2.php b/Sources/Subs-EzPortalMain2.php
index 3bccdfb..ea306e6 100644
--- a/Sources/Subs-EzPortalMain2.php
+++ b/Sources/Subs-EzPortalMain2.php
@@ -752,7 +752,7 @@ function EzBlockRecentTopicsBlock($paramters = array(), $numTopics = 10, $exclud

        $posts = array();

-       if (($posts = cache_get_data('ezprecenttopics_block_' . $ezblocklayoutid . '_' . $modSettings['maxMsgID'], 30)) == null)
+       if (($posts = cache_get_data('ezprecenttopics_block_' . $user_info['id'] . '_' . $ezblocklayoutid . '_' . $modSettings['maxMsgID'], 30)) == null)
        {
        // Find all the posts in distinct topics.  Newer ones will have higher IDs.
        $request = $smcFunc['db_query']('', "
@@ -822,7 +822,7 @@ function EzBlockRecentTopicsBlock($paramters = array(), $numTopics = 10, $exclud

                // Check if cache is enabled
                if (!empty($modSettings['cache_enable']))
-                       cache_put_data('ezprecenttopics_block_' . $ezblocklayoutid . '_' . $modSettings['maxMsgID'], $posts, 300);
+                       cache_put_data('ezprecenttopics_block_' . $user_info['id'] . '_' . $ezblocklayoutid . '_' . $modSettings['maxMsgID'], $posts, 30);

        }

@@ -3919,4 +3919,4 @@ function EzBlockCalendar($paramters = array(), $showBirthdays = 1, $showEvents =

        echo $endHtml;
 }

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1298
  • Karma: 67
Re: Recent Topic Ezblock randomly showing "New" message indicator
« Reply #5 on: January 14, 2020, 09:03:57 am »
You are right should be user dependent for recent topics and blocks.

I think setting caching time  to 10 seconds would be safe. I might make the caching level 3 in order for the ezportal to turn on caching for those blocks.

The caching is mainly done to prevent high load or a lot of bots from slowing down the forum.
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1298
  • Karma: 67
Re: Recent Topic Ezblock randomly showing "New" message indicator
« Reply #6 on: January 14, 2020, 09:44:10 am »
Posted an update to fix thanks for troubleshooting!!!

4.5.7
!Fixed new indicator for recent posts and recent topics block for SMF 2.0 to cache per user instead of global cached.
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

Offline Paul_123

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: Recent Topic Ezblock randomly showing "New" message indicator
« Reply #7 on: January 14, 2020, 09:31:26 pm »
Installed...looks good.

Offline EzPortal

  • Administrator
  • *****
  • Posts: 1298
  • Karma: 67
Re: Recent Topic Ezblock randomly showing "New" message indicator
« Reply #8 on: January 14, 2020, 10:17:10 pm »
Great glad that helped.
Like ezPortal? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
6612 Views
Last post June 16, 2009, 12:05:34 pm
by EzPortal
2 Replies
6602 Views
Last post March 23, 2010, 06:50:41 am
by Marian
2 Replies
8798 Views
Last post July 30, 2010, 11:03:46 pm
by North East FL 4x4
2 Replies
18520 Views
Last post May 03, 2011, 11:24:04 am
by geogeo
2 Replies
14554 Views
Last post September 30, 2016, 01:11:56 pm
by timidapsin

+-SMF Gallery

Quick Menu


Powered by EzPortal