New Count module
Posted by Panu
Re: New message count next to "new" in list view May 05, 2005 10:41AM |
Registered: 20 years ago Posts: 278 |
I keep getting these errors when I'm using one template:
Warning: array_diff(): Argument #1 is not an array in /home/wtower/public_html/phorum/mods/new_count/new_count.php on line 39
Warning: Invalid argument supplied for foreach() in /home/wtower/public_html/phorum/mods/new_count/new_count.php on line 44
Warning: array_diff(): Argument #1 is not an array in /home/wtower/public_html/phorum/mods/new_count/new_count.php on line 39
Warning: Invalid argument supplied for foreach() in /home/wtower/public_html/phorum/mods/new_count/new_count.php on line 44
Re: New message count next to "new" in list view May 10, 2005 02:07PM |
Registered: 20 years ago Posts: 126 |
tkt Wrote:
> Two possible solutions (with polish translation
> files) in attachments
> (The 1st looks, maybe, more universal, but when
> I've written it I saw, that something like the 2nd
> one would be better)
Wersja 1 za cholere nie dzia³a po polsku.
Ale w sumie ³adnie zrobione gratuluje
--
Tomasz Regdos :: www.regdos.com
> Two possible solutions (with polish translation
> files) in attachments
> (The 1st looks, maybe, more universal, but when
> I've written it I saw, that something like the 2nd
> one would be better)
Wersja 1 za cholere nie dzia³a po polsku.
Ale w sumie ³adnie zrobione gratuluje
--
Tomasz Regdos :: www.regdos.com
Re: New message count next to "new" in list view May 12, 2005 06:29PM |
Registered: 23 years ago Posts: 1,076 |
Added total new messages in all threads by CBiLL's request.
Localisation of it kind of sucks, but modules lang-string wasn't visible to list-template for some reason so I had to parse the whole sucker in the module,
Works for me, but if you have read all messages in this thread, you can see there has been some weird errors...
---
-=[ Panu ]=-
Localisation of it kind of sucks, but modules lang-string wasn't visible to list-template for some reason so I had to parse the whole sucker in the module,
Works for me, but if you have read all messages in this thread, you can see there has been some weird errors...
---
-=[ Panu ]=-
December 15, 2005 12:00AM |
Admin Registered: 23 years ago Posts: 4,495 |
I have made some changes to this code. It addresses a couple of issues that Panu had. In addition, it add a total new thread count and adds the total posts and threads to the index.php page as well.
Edited 2 time(s). Last edit at 12/15/2005 08:19AM by brianlmoon.
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Edited 2 time(s). Last edit at 12/15/2005 08:19AM by brianlmoon.
Re: New message count next to "new" in list view December 15, 2005 04:40AM |
Admin Registered: 22 years ago Posts: 9,240 |
January 22, 2006 03:54PM |
Admin Registered: 20 years ago Posts: 8,532 |
I added a couple of features too and restructured the information for the module a bit. Here's the changelog and the 1.9 version of the module.
Announcements + replies to announcements are counted as a new message for every forum in the folder the announcement is in. So if you have 5 forums and post a new announcement, the new message count will be 5. The same way like Phorum will add a new flag to each forum in this case. The new flag isn't a real problem I think, but it would be good if the new count would at least be 1. This is probably something that has to be fixed in the Phorum db-layers.
Edit: attachments deleted, because a new version was released.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Edited 2 time(s). Last edit at 05/11/2007 06:23AM by mmakaay.
Added a settings screen so now users of this module can choose to either show the totals automatically in the header or hack the templates to exactly show it where they like it to be. Another setting has been added to configure if the totals for the index and list pages should be displayed in case no new messages are available. Hiding was the default behaviour in the previous versions. Displaying of forum totals for the list view now also works when in threaded view. Migrated information about the module from the module code to a README and Changelog file. Added a new localization option, so languages that use multiple plural words can set them in the language strings (you can now define the default new_count_single and new_count_multiple, but also new_count_2, new_count_3, etc.). Added a Dutch translation for the module.While testing this module, I did find another issue:
Announcements + replies to announcements are counted as a new message for every forum in the folder the announcement is in. So if you have 5 forums and post a new announcement, the new message count will be 5. The same way like Phorum will add a new flag to each forum in this case. The new flag isn't a real problem I think, but it would be good if the new count would at least be 1. This is probably something that has to be fixed in the Phorum db-layers.
Edit: attachments deleted, because a new version was released.
Maurice Makaay
Phorum Development Team



Edited 2 time(s). Last edit at 05/11/2007 06:23AM by mmakaay.
Re: New message count next to "new" in list view January 24, 2006 05:03PM |
Registered: 23 years ago Posts: 1,076 |
Great work B&M. The once hacky module is starting to look like a real polished piece of software :)
Only downside is the extra db hit with the latest version. (maybe it is as efficient as the previous way of calculating a little bit less tho)
---
-=[ Panu ]=-
Edited 1 time(s). Last edit at 01/24/2006 05:05PM by Panu.
Only downside is the extra db hit with the latest version. (maybe it is as efficient as the previous way of calculating a little bit less tho)
---
-=[ Panu ]=-
Edited 1 time(s). Last edit at 01/24/2006 05:05PM by Panu.
April 21, 2006 11:03AM |
Admin Registered: 19 years ago Posts: 746 |
Hi,
here is a new version which will work with the actual snapshot and with the future version 5.2 of Phorum. ATTENTION: this module version will not work with Phorum 5.1.x!
Message and thread count values are now formatted by the Phorum core so this module is calculating a wrong total because of the thousands separator.
The new version correct this error and format also the total with the separators given in the language file.
HTML-error reported by Chanh Ong is fixed also.
Bye
Oliver
[Attachement removed. New version available]
Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Edited 3 time(s). Last edit at 09/15/2006 09:53AM by Oliver Riesen.
here is a new version which will work with the actual snapshot and with the future version 5.2 of Phorum. ATTENTION: this module version will not work with Phorum 5.1.x!
Message and thread count values are now formatted by the Phorum core so this module is calculating a wrong total because of the thousands separator.
The new version correct this error and format also the total with the separators given in the language file.
HTML-error reported by Chanh Ong is fixed also.
Bye
Oliver
[Attachement removed. New version available]
Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Edited 3 time(s). Last edit at 09/15/2006 09:53AM by Oliver Riesen.
June 11, 2006 11:42PM |
Registered: 19 years ago Posts: 202 |
New count module fixes!
I tried to validate my site with the html validation service and found out there were a few error in the new_count.php
Missing ";" in new_count.php
line 128: ' <span class="PhorumNewFlag">' .
$PHORUM["DATA"]["NEW_MESSAGES"] .
'</span> ' .
$PHORUM["DATA"]["LANG"]["new_count_total_new_threads"] .
line 132: ' <span class="PhorumNewFlag">' .
[opensourceCMS.com]
[ongetc.com]
Chanh Ong
I tried to validate my site with the html validation service and found out there were a few error in the new_count.php
Missing ";" in new_count.php
line 128: ' <span class="PhorumNewFlag">' .
$PHORUM["DATA"]["NEW_MESSAGES"] .
'</span> ' .
$PHORUM["DATA"]["LANG"]["new_count_total_new_threads"] .
line 132: ' <span class="PhorumNewFlag">' .
[opensourceCMS.com]
[ongetc.com]
Chanh Ong
August 24, 2006 09:00AM |
Admin Registered: 20 years ago Posts: 8,532 |
Here's a followup release for version 1.9.2. This version can be used safely with both the stable Phorum 5.1 release and the current Phorum 5.2 development tree.
1.10 PHP warnings were shown in case there was a "thread moved" notification
in the forum. These notifications are now skipped when counting new
messages for the message list.
Modified the module, so now it will work for both Phorum 5.1 and 5.2.
Removed the need for the common hook in the code (it was used for
setting up some data to prevent undefined index warnings later on,
but this could be handled more gracefully).
Note to Oliver: If you extend on a module, please leave the Changelog and README files intact. Your 1.9.2 package did not contain these files anymore. Especially the README is useful for this module, because it contains installation and customization information. Thanks!
Edit: attachments deleted, because a new version was released.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Edited 1 time(s). Last edit at 05/11/2007 06:23AM by mmakaay.
1.10 PHP warnings were shown in case there was a "thread moved" notification
in the forum. These notifications are now skipped when counting new
messages for the message list.
Modified the module, so now it will work for both Phorum 5.1 and 5.2.
Removed the need for the common hook in the code (it was used for
setting up some data to prevent undefined index warnings later on,
but this could be handled more gracefully).
Note to Oliver: If you extend on a module, please leave the Changelog and README files intact. Your 1.9.2 package did not contain these files anymore. Especially the README is useful for this module, because it contains installation and customization information. Thanks!
Edit: attachments deleted, because a new version was released.
Maurice Makaay
Phorum Development Team



Edited 1 time(s). Last edit at 05/11/2007 06:23AM by mmakaay.
Sorry, only registered users may post in this forum.