Firefox PHP

Module: Mark All Forums Read

Posted by Maurice Makaay 
All files from this thread

File Name File Size   Posted by Date  
markallforumsread-1.0.9.tar.gz 4 KB open | download Maurice Makaay 07/22/2009 Read message
markallforumsread-1.0.9.zip 7 KB open | download Maurice Makaay 07/22/2009 Read message
Module: Mark All Forums Read
August 20, 2007 04:04PM
Displays a link to mark all forums read on the forum index page.

Changelog:
----------

2009-07-22 v1.0.9

    - Added French language file.
      Thanks to Phorum.org user manuvb (Manu).

    - Added Czech language file.
      Thanks to Phorum.org user timqui.

2008-04-21 v1.0.8

   - Instead of only marking the forums read that are visible on the
     index page, the "mark all forums read" link now marks all forums
     that are in the current vroot as read (which does cover the
     definition of "all forums" a lot better). Thanks to Phorum user
     "Lammi41" for noticing the deficiency.

2007-10-23 v1.0.7

    - Added Turkish language file.
      Thanks to Serdar of paticik.com.

2007-07-07 v1.0.6

    - Fixed a small logic fix, which caused automatic displaying of
      the "Mark all forums read" link to fail.

2007-07-07 v1.0.5

    - Just a small change to add the 5.2 style URL format
      {URL->MARKALLFORUMSREAD}. The old URL template var is still
      available as well.

2007-01-03 v1.0.4

    - Adjusted cleaning up the newflags cache to work with the cache_version
      forum field too (only for 5.2 development version, not for 5.1.x).

2006-10-03 v1.0.3

    - Fixed an undefined index warning in case there are no forums
      displayed on the index page.

2006-08-24 v1.0.2

    - Added a redirect back to the plain index URL, to prevent people from
      bookmarking the URL with the mark all read argument in it.

2006-08-23 v1.0.1

    - Found out what was causing announcements not to be marked read when
      marking a forum read. This turned out to be a core problem. This has
      been fixed in Phorum 5.1.16. I removed the experimental code for marking
      announcements read from this mod.

2006-08-23 v1.0.0

    - Initial revision


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce



Edited 2 time(s). Last edit at 07/22/2009 11:29AM by Maurice Makaay.
Attachments:
open | download - markallforumsread-1.0.9.tar.gz (4 KB)
open | download - markallforumsread-1.0.9.zip (7 KB)
Re: Module: Mark All Forums Read
January 15, 2008 12:36PM
On a test web site I encounter that problem after upgraded to 5.2.6 (with any template):

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /lpv/phorum/mods/markallforumsread/markallforumsread.php on line 19

Warning: Cannot modify header information - headers already sent by (output started at /lpv/phorum/mods/markallforumsread/markallforumsread.php:19) in /lpv/phorum/cache/tpl-lpv-header-dadb346b7c32ed541d25d07d05cd49f5.php-stage2 on line 5
Phorum 5 test


And the module don't work ....
Re: Module: Mark All Forums Read
January 15, 2008 01:10PM
On line 19, that argument would be $PHORUM['args']. Apparently, it is not an array, which might happen if no arguments are provided at all. It might be a good idea to setup $PHORUM['args'] as an empty array from common.php to not run into this problem. As a quick hack for you, you could change line 19 to this:
18    .....
19    if (!empty($PHORUM['args'] && 
20        in_array("markallforumsread", $PHORUM["args"])) {
21        .....

I don't know why others didn't see this problem before.
Maybe some stricter PHP setting.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Mark All Forums Read
January 16, 2008 12:26AM
Thanks, it works with

18 .....
19 if (!empty($PHORUM['args']) &&
20 in_array("markallforumsread", $PHORUM["args"])) {
21 .....
Re: Module: Mark All Forums Read
January 16, 2008 03:19AM
Hehe, untested code ;-) Next version of Phorum should take care of that from the core by making sure that $PHORUM['args'] always contains an array.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Mark All Forums Read
April 10, 2008 06:46AM
thanx for that mod :-)

i noticed that it marks only posts in forums that are stored in the same folder. my phorum installation is something like

folder
forum1
subfolder
forum2
forum3
subfolder
forum4

aso. so i have to jump in forum1, forum2 or forum3 and forum4 to mark all messages read.
luckily, we've organized all users in groups, so it's really easy to change.

line 20ff:
//foreach ($forums as $id => $data) {
foreach ($PHORUM['DATA']['USERINFO']['group_permissions'] as $id => $permission)
{
//if ($data["folder_flag"]) continue; //not really necessary, $PHORUM['DATA']['USERINFO']['group_permissions'] holds no folder-ids

// Mark forum read.
phorum_db_newflag_allread($id);

------------------------------------------------- edit -------------------------------------------------------------

on phorum 5.2 it needs to be

foreach ($PHORUM['DATA']['USER']['group_permissions'] as $id => $permission)


1.0.8 marks ALL messages as read, but i want only the messages a user may read marked. of course this still works only if you're users are in groups.



Edited 2 time(s). Last edit at 05/23/2008 05:26AM by Lammi41.
Re: Module: Mark All Forums Read
April 10, 2008 04:55PM
That's right, the module will probably only take a look at the modules at the current level. It might be a good idea to change that to take all forums in the active vroot into account. Your solutions will work for your group based situation, but not for others.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Mark All Forums Read
April 22, 2008 12:59AM
Please check if version 1.0.8 fixes your problem. That version marks all forums in the active vroot as read, instead of the forums that are visible on the index page.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Mark All Forums Read
March 06, 2009 12:47PM
Hey,
I'm quite new to phorum, so I don't really understand the file structure yet...
I copied the mod to the directory.
Where do I now set the link to mark all forums read?
I know I can put it anywhere, but I have no idea which file is for which part of the phorum...
I'd like to have the link above the announcements on the index page.
Maybe you can help me with that...
thx
Re: Module: Mark All Forums Read
March 06, 2009 05:33PM
Quote
munich
Hey,
I'm quite new to phorum, so I don't really understand the file structure yet...
I copied the mod to the directory.
Where do I now set the link to mark all forums read?
I know I can put it anywhere, but I have no idea which file is for which part of the phorum...
I'd like to have the link above the announcements on the index page.
Maybe you can help me with that...
thx



If your using flat structure index then edit the template below to put the link in
/template/*yourtemplate*/index_new.tpl



If your using directory structure index then edit the template below put the link in
/template/*yourtemplate*/index_classic.tpl


Bill
Sorry, only registered users may post in this forum.

Click here to login