New message not appearing on portal 2.1.0

Current Version: 2.1.0
Released: 2015-10-26
Forum rules
Before creating a new support thread, please take a look at the board3 Portal FAQ and use the search!
Many questions have already been answered.
mahugin
Topic author
Active Member
Active Member
Posts: 12
Joined: 21. November 2015 17:17
phpBB.de User: mahugin
phpBB.com User: mahugin

New message not appearing on portal 2.1.0

Post by mahugin » 21. November 2015 17:21

Your Portal Version: 2.1.0
Your phpBB Type: Standard phpBB3
MODs installed: Yes
Your knowledge: Basic Knowledge

What have you done before the problem was there?


What have you already tryed to solve the problem?


Description and Message
Hello,

I also installed the 2.1.0 portal over 3.1.6 Phpbb. Everything works fine but the NEW messages do not appear in the modules New Posts and Recent topics . I must purge the cache each time in the administrator panel so that new messages appear. This problem only happens on the portal. The forum (Index) shows new messages correctly.

Thank you very much for your help :) !

mahugin
Topic author
Active Member
Active Member
Posts: 12
Joined: 21. November 2015 17:17
phpBB.de User: mahugin
phpBB.com User: mahugin

Re: New message not appearing on portal 2.1.0

Post by mahugin » 23. November 2015 06:26

Is there any body that can help me, please?

Server is: Debian GMU/Linux
Running Php 5.4 with Mysql 5.5.38

User avatar
Marc
Dev
Dev
Posts: 2487
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München

Re: New message not appearing on portal 2.1.0

Post by Marc » 23. November 2015 19:31

The portal caches the data on the portal for 30 seconds. If you refresh the page after 30 seconds, the new messages should properly show.
This was added to reduce the database load on data that doesn't necessarily need to be instantly up to date.

mahugin
Topic author
Active Member
Active Member
Posts: 12
Joined: 21. November 2015 17:17
phpBB.de User: mahugin
phpBB.com User: mahugin

Re: New message not appearing on portal 2.1.0

Post by mahugin » 24. November 2015 01:46

Hello Marc,

Thank you very much for your reply :). BTW, I love your portal, it is extremely well done!!

I did some testing and if I stay connected (logged in), then the message does not appear (even after 30 secondes). It is only when I log off that the new messages appear in the new post module on the portal. Would you know what might be causing that and how to fix this :)?

Also, if I prefer the messages to appear live, like on the index forum, can this be changed (file & sql script)?

Thank you very much for your help!

mahugin
Topic author
Active Member
Active Member
Posts: 12
Joined: 21. November 2015 17:17
phpBB.de User: mahugin
phpBB.com User: mahugin

Re: New message not appearing on portal 2.1.0

Post by mahugin » 26. November 2015 21:31

Hello Marc,

Did you get a chance to look at my reply. I really would like to fix this, please :)

mahugin
Topic author
Active Member
Active Member
Posts: 12
Joined: 21. November 2015 17:17
phpBB.de User: mahugin
phpBB.com User: mahugin

Re: New message not appearing on portal 2.1.0

Post by mahugin » 29. November 2015 16:53

Since I am not going anywhere with this issue, I did a temporary fix but I would need your help to tweak it.

I did a file call cache.php with the following script (where it clears the cache):
<?PHP
// Deletes everything but index.htm and .htaccess from the phpBB cache directory

$cachedir = "cache";

$dir = opendir($cachedir);

// Delete everything but index.htm and .htaccess

while( $file = readdir( $dir ) ) {
if ($file == "." or $file == ".." or $file == "index.htm" or $file == ".htaccess") {
continue;
}
echo "Deleting $cachedir/$file ... ";
if (unlink("$cachedir/$file")) {
echo "Done.<BR>";
} else {
echo "Not done.<BR>";
}
}

// Do not remove subdirectory because we want two files to remain.
//
// if (rmdir($cachedir)) {
// echo "<BR>Directory $cachedir was completely deleted.<BR>";
// } else {
// echo "<BR>Directory $cachedir could not be completely deleted. Check permissions.";
// }

?>
I then included this line in the app.php
exec( "php cache.php > /dev/null" );
This solve the problem that I had where the New Message block was not updating itself (showing new posts).

Now, I would like to implement a trigger that would clear the cache every refresh of the page but at an interval of 30 seconds. For example, the first user that refreshes the page would clear the cache but the cache would not be cleared for the next 30 seconds even if somebody else do a refresh within this 30 seconds. Therefore, what would I need to add to this script to get this feature?

Thank you!

mahugin
Topic author
Active Member
Active Member
Posts: 12
Joined: 21. November 2015 17:17
phpBB.de User: mahugin
phpBB.com User: mahugin

Re: New message not appearing on portal 2.1.0

Post by mahugin » 1. December 2015 03:00

Anyone :)?

User avatar
Kirk
Portal Professional
Portal Professional
Posts: 1496
Joined: 27. July 2010 18:02
phpBB.de User: Kirk

Re: New message not appearing on portal 2.1.0

Post by Kirk » 1. December 2015 18:22

Maybe it works so:
Open: root/ext/board3/portal/modules/news.php and root/ext/board3/portal/ portal/fetch_posts.php
Find:

Code: Select all

$result = $this->db->sql_query($sql, 30);
Change the value of 30 according to your wishes.

mahugin
Topic author
Active Member
Active Member
Posts: 12
Joined: 21. November 2015 17:17
phpBB.de User: mahugin
phpBB.com User: mahugin

Re: New message not appearing on portal 2.1.0

Post by mahugin » 2. December 2015 04:27

Thank you very much for your hint but it is unfortunatly doing the same thing :(. Messages only appear if I clear the cache or when I log off. Don't know why it is working perfectly in the forum index and not on the portal. I only have this problem on the portal. I tried to uninstall and install again and I am getting the exact same problem.

User avatar
Marc
Dev
Dev
Posts: 2487
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München

Re: New message not appearing on portal 2.1.0

Post by Marc » 7. December 2015 12:55

Have you tried removing the occurences of the above code to look like this?

Code: Select all

$result = $this->db->sql_query($sql);
That will remove the caching of the queries.

mahugin
Topic author
Active Member
Active Member
Posts: 12
Joined: 21. November 2015 17:17
phpBB.de User: mahugin
phpBB.com User: mahugin

Re: New message not appearing on portal 2.1.0

Post by mahugin » 8. December 2015 03:11

Hello Marc,

I tried but the problem is the same. Everytime I clear the cache, the mew message appears on the portal. Mystery! It only do this on the portal, I don't have this problem in the forum index.

mahugin
Topic author
Active Member
Active Member
Posts: 12
Joined: 21. November 2015 17:17
phpBB.de User: mahugin
phpBB.com User: mahugin

Re: New message not appearing on portal 2.1.0

Post by mahugin » 8. December 2015 04:52

Ok Marc, I have a good one for you ;)

I did 1 post and refreshed the screen every 2-3 seconds (For a maximum of 10 minutes). At 9 minutes, the message appeared on the portal. I therefore did another message and same result!! The messages appear after +/- 9 minutes.

Do you understand this??

User avatar
Marc
Dev
Dev
Posts: 2487
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München

Re: New message not appearing on portal 2.1.0

Post by Marc » 10. December 2015 11:38

Seems like a part of the caching was missed earlier. You should take a look at this:
https://github.com/board3/Board3-Portal ... s.php#L269

The 600 at the end caches it for 10 minutes. Reduce that to a normal value like 30 for 30 seconds.

It should be solved by this PR: https://github.com/board3/Board3-Portal/pull/667

mahugin
Topic author
Active Member
Active Member
Posts: 12
Joined: 21. November 2015 17:17
phpBB.de User: mahugin
phpBB.com User: mahugin

Re: New message not appearing on portal 2.1.0

Post by mahugin » 10. December 2015 15:45

Marc,

It works!!! I had to clear the cache in the admin panel after changing this setting and the posts are now showing :)

Case closed :)

HomeRacingWorld
Active Member
Active Member
Posts: 6
Joined: 10. September 2012 14:41
phpBB.com User: Homeracingworld

Re: New message not appearing on portal 2.1.0

Post by HomeRacingWorld » 28. July 2016 02:42

Thanks for this code and clear instructions on performing the fix.

Was having the same issue. Now the Portal updates as it should.

Thank you again.

Return to “Board3 Portal 2.1.x - English Support”