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

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

New message not appearing on portal 2.1.0

Post by mahugin »

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 :) !

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

Re: New message not appearing on portal 2.1.0

Post by mahugin »

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
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: New message not appearing on portal 2.1.0

Post by Marc »

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.

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

Re: New message not appearing on portal 2.1.0

Post by mahugin »

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!

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

Re: New message not appearing on portal 2.1.0

Post by mahugin »

Hello Marc,

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

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

Re: New message not appearing on portal 2.1.0

Post by mahugin »

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!

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

Re: New message not appearing on portal 2.1.0

Post by mahugin »

Anyone :)?
User avatar

Kirk
Dev
Posts: 1956
Joined: 27. July 2010 18:02
phpBB.de User: Kirk
Contact:

Re: New message not appearing on portal 2.1.0

Post by Kirk »

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.
Gruß Udo

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

Re: New message not appearing on portal 2.1.0

Post by mahugin »

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
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: New message not appearing on portal 2.1.0

Post by Marc »

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.

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

Re: New message not appearing on portal 2.1.0

Post by mahugin »

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.

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

Re: New message not appearing on portal 2.1.0

Post by mahugin »

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
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: New message not appearing on portal 2.1.0

Post by Marc »

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

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

Re: New message not appearing on portal 2.1.0

Post by mahugin »

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
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 »

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

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